Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-8452 SPI 16 bit communication

--> This post is about SPI and communicating to by sending 16bits

 

I am trying to communicate with an SPI channel that needs to receive 16bits as opposed to 8bits.

 

Is this possible to do with the NI8452?

Is it possible to do with the sample subVIs that come with Labview, specifically subVI: NI-845x SPI Write Read.vi?

Is there a Write Read vi for 16bits?

 

The sample VI in Labview is "NI-845x SPI Write Read.vi", it has an input for the can be changed to u16 (It is a u8 to start with) this in turn goes into a Call Library Function Node that coerces the input into a 8bits.  In other words, the DLL is looking for an 8bit string of data.

 

A solution that didn't quite work was to take the 16bit data and divide it into two 8 bits, sending it as two bytes but this did not work.

 

Thanks for any help,

 

Jorge Vega

 

0 Kudos
Message 1 of 2
(1,308 Views)

To write or read n bits, you need to split them into U8 values, this is clearly explained in the help for the API as shown below.

santo_13_0-1669261419313.png

Note: don't forget to configure the "Number of Bits Per Sample" property to tell SPI how many bits are part of a packet.

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 2
(1,274 Views)