From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.


Showing results for 
Search instead for 
Did you mean: 


Go to solution


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.




0 Kudos
Message 1 of 5



Have you seen the LabJack library in the tools network?



0 Kudos
Message 2 of 5
Accepted by topic author 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" (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

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

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