03-29-2017 08:01 AM
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
Solved! Go to Solution.
04-07-2017 02:58 AM
Hello,
Have you seen the LabJack library in the tools network?
http://sine.ni.com/nips/cds/view/p/lang/en/nid/211373
Adam.
04-07-2017 10:43 AM
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.
04-27-2018 03:07 PM
This library supports only U series devices. Is there a similar library for T series devices as well?
04-27-2018 03:27 PM
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.