LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

20-bit transmission using SPI in Labview 2013

Hello. I am using Labview 2013. I am still not familiar with SPI and the digital waveform instrument but I have already researched regarding them and I found a reference but it uses 16-bit transmission. I want to have a 20-bit transmission. I am using PXIe-6556 HSDIO channels for the CS, MISO, MOSI and SCLK. Do you have any idea how to make this code into 20-bit? [I am trying to control a DAC to output a specific voltage].

 

Reference (SPI 16-BIT):

https://forums.ni.com/t5/Example-Code/Serial-Protocol-Communication-Reference-Design-for-Digital/ta-...

 

sroulston_0-1686611435960.png

 

0 Kudos
Message 1 of 4
(945 Views)

SPI is a 4-wire self-clocking serial peripheral interface (or SPI).  The Master outputs the Clock signal, and the Chip Select line defines when data can be sent or received.  It is up to the Master and Servant to determine how many bits of data to send -- if you want to send 20-bit strings, you send them using 20 Clock transitions while Chip Select is (usually) low.  You generally need specialized hardware (a "SPI" chip), or an FPGA that can be programmed to recognize and implement the SPI protocol.  

 

Bob Schor

Message 2 of 4
(929 Views)

Thank you so much for the reply. I found a source to convert it to 27 bits. Do I just need to change the 27 if I want have 24 bits? Or is there another way to convert it? Also, do you have an idea how the Input Array is created? It's new to me as well. Thank you very much for your time and help.

sroulston_0-1686880074691.png

sroulston_2-1686880217630.png

 

 

 

0 Kudos
Message 3 of 4
(868 Views)

I'm sorry, but I can't "see details" in a "picture of LabVIEW code", neither can I edit it or try to run it.  If it only exists as an Image, attach the URL of this Image and maybe I can get something I can see better.  Best, of course, would be to attach the actual VI or entire Project, "Saved for Previous Version" as LabVIEW 2019 or 2021.

 

Looking at parts of someone else's code without being able to "move things around" and organize it so that it "makes sense to me" is frustrating.  Off-hand, if you have 24 bits of data and the code is sending 27, it seems "logical to me" that you can simply feed in 24 bits and change the 27 to a 24, but that's without closely examining the code.

 

Bob Schor

 

0 Kudos
Message 4 of 4
(846 Views)