Labview and Labjack T7 SPI Communication Help | LabJack
 

Labview and Labjack T7 SPI Communication Help

2 posts / 0 new
Last post
James_McCormick
JamesMcCormick's picture
Labview and Labjack T7 SPI Communication Help

Hello all, 

I am writing to seek advice from those experienced with the Labjack T4 and T7. I am a college student working on a senior design project. While most of the project is within my capabilities, I am learning how to work with the labjack device however I am stuck. 

I am asking for assistance learning how to use Labview to send SPI signals from the T7 to TMC5160-BOB microcontrollers in order to communicate with stepper motors, encoders, and limit switches. While I have experience with labview, I am not experienced with this type of communication between devices. I am looking for help writing adequate programs to communicate with these devices using SPI inputs and outputs. Any input or reference programs would be a great help!! 

Here is a link to the TMC breakout board for reference: TMC5160-BOB Trinamic Motion Control GmbH | Development Boards, Kits, Programmers | DigiKey

Thank you

LabJack Support
labjack support's picture
Unfortunately, we cannot help

Unfortunately, we cannot help much with device specific examples. To get started with SPI, we would recommend seeing the Wikipedia page. It has a pretty good overview of the important details like the different modes and what each I/O does:

https://en.wikipedia.org/wiki/Serial_Peripheral_Interface

Your motor controller datasheet also has some good looking information about SPI starting at page 23. Page 24 has a few examples. After you get your hardware connections straightened out, you should be able to modify our LabVIEW SPI example to test these examples out. For example, to read XACTUAL you need to write 5 bytes (0x2100000000) and read 5 bytes (which the first byte should be SS/status and the rest unused). In the example you should only need to set up the MOSI/MISO/CS/SPI_MODE configs as you want or need, set "SPI Num Bytes to transfer" to 5, change the Data Write array to [0x21, 0x00, 0x00, 0x00, 0x00], and run.

Our SPI documentation has additional information about the SPI configuration registers being used in our example VI:

https://labjack.com/support/datasheets/t-series/digital-io/spi

One thing with the electrical connections that may not be obvious is that you should connect a voltage of  ~3.3V to VCC_IO to ensure the 3.3V logic from our devices is processed correctly by the sensor. This could be achieved by connecting it to a DAC set to 3.3V.

If you do not currently have our LabVIEW example package, it can be downloaded from the following page:

https://labjack.com/support/software/examples/ljm/labview