LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labjack

Solved!
Go to solution

Hi

Can somebody show me how to use an SPI vi (Labjack T7 Pro) to just read from the SPI, I have managed to use the read/write vi but I would just like to read a number of bytes without writing.

 

Regards

David

0 Kudos
Message 1 of 5
(4,145 Views)

Hello,

 

Have you seen the LabJack library in the tools network?

 

http://sine.ni.com/nips/cds/view/p/lang/en/nid/211373

 

Adam.

0 Kudos
Message 2 of 5
(4,072 Views)
Solution
Accepted by DPJones

SPI is a full-duplex protocol.  If you wanted to write 1 byte and then read 3 bytes, you would do a 4-byte transfer.  The write array and read array are both 4 bytes, but only the 1st byte matters to you in the write array and only the last 3 bytes matter to you in the read array.

So if you just want to read 3 bytes then in our example "SPI Simple.vi" (from the LabVIEW_LJM archive) you would just set #BytesToTransfer=3.  The write array does not matter.  You could set it to 0,0,0 or 255,255,255 or whatever.  You could even make it empty (0 elements) as the sub-VI will force it to the correct size.

0 Kudos
Message 3 of 5
(4,049 Views)

This library supports only U series devices. Is there a similar library for T series devices as well?

Download All
0 Kudos
Message 4 of 5
(3,657 Views)

The 3rd-party (Interface Innovations LLC) tool kit mentioned a few posts above links to the LabJack UD library, which supports the U3, U6, and UE9.

 

For T-series devices, there are 2 main options for communication:

 

1.  LJM library.

 

2.  Direct Modbus TCP.

 

We provide LabVIEW examples for both.  For #1 the LabVIEW examples are Windows only.  For option #2 native TCP is used so any LabVIEW platform that supports TCP will work.

 

0 Kudos
Message 5 of 5
(3,653 Views)