LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming a Labjack T7 with Labview

Solved!
Go to solution

I am writing Labview programs to control experiments via a LabJack T7 PLC.  I have downloaded the necessary LJM libraries and integrated them into Labview via the Vi Package Manager.  When programming with Labview there are Labjack vi's to do many operations such as Open LJM, Handle LJM, Read and Write LJM (ie to file), Read via ADC (AIN0), etc.  The T7 has many features including 14 ADC inputs (AIN0-AIN13), and 23 digital i/o.  The Labjack-Labview library has a vi to read any of the ADC channels, but I cannot see a separate vi to read or write to a single I/o terminal.  Can anyone tell me the relevant vi to call.  There is plenty of general advice that point to websites that give information about communication between Labview-Labjack T7, but I cannot see the answer to this specific need.

 

I am somewhat of a novice so help appreciated.

 

Middle

Thanks

MiddleRoo

0 Kudos
Message 1 of 3
(110 Views)
Solution
Accepted by topic author MiddleRoo

Check out the sections "Communication Overview" and "Where is an example to do XYZ?" on the LabVIEW for LJM page:

https://support.labjack.com/docs/labview-for-ljm-windows-macos#LabVIEWforLJM-Windows&macOS-Communica...

 

To read from multiple inputs of any type, you can just use one call which is LJM_eReadNames.  You pass in a list of the inputs you want to read.

 

To write to multiple outputs of any type, you can just use one call which is LJM_eWriteNames. You pass in a list of the outputs you want to write.

 

To read from a single input, you can just use one call which is LJM_eReadName. You pass in the name of the input you want to read.

 

To write to a single output, you can just use one call which is LJM_eWriteName. You pass in the name of the output you want to write.

 

 


but I cannot see a separate vi to read or write to a single I/o terminal.  Can anyone tell me the relevant vi to call.

Say you want to set the digital channel FIO4/DIO4 to output-high.  Looking at the Digital I/O section of the T-series Datasheet, you can see that an easy way to do this is to write a 1 to the channel named "FIO4" or "DIO4" (both do the same thing).

https://support.labjack.com/docs/13-0-digital-i-o-t-series-datasheet#id-13.0DigitalI/O[T-SeriesDatas...

 

An easy way to do this is to call eWriteName with Name="FIO4" and Value=1.

https://support.labjack.com/docs/ewritename-ljm-user-s-guide

 

From our LabVIEW for LJM package, you can open "LJM_eWriteName Example.vi" and try this yourself.

 

0 Kudos
Message 2 of 3
(70 Views)

Thank you for your help.  Looks obvious for someone with experience, but a great help and time saver for me.

MiddleRoo

0 Kudos
Message 3 of 3
(53 Views)