Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use Linx arduino to do analog read and SPI write at the same time?

Simultaneously, for example to control a  SPI DAC chip output and read back the  output by the analog input of an Arduino.

0 Kudos
Message 1 of 11
(2,760 Views)

Sure can do, but not simultaneously, but sequentially at very close data rate. That for Arduino can be called simultaneously

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
0 Kudos
Message 2 of 11
(2,724 Views)

But, I am getting error with this vi. Couldn't figure out. I am new to Labview.

0 Kudos
Message 3 of 11
(2,713 Views)

What errors are you getting? can you use only SPI? can you use only analog read?
how is your circuit wired?

try to avoid those red coercion dots on analog read, by using expected data type.

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
0 Kudos
Message 4 of 11
(2,640 Views)

Apparently, I got rid of the error. By try and error.. I don't know if this is the correct way of doing. Please advise.

0 Kudos
Message 5 of 11
(2,616 Views)

Note that I don't have LINX or a newer version of LabVIEW.

But let me quote a LINX Makerhub FAQ 

"When you call the LINX Initialize VI it establishes a connection to the LINX device and the Init VI passes out the LINX Ref wire. You can think of this wire as the connection to the device and it contains all of the info needed to 'talk to' the device. You really shouldn't branch / split this wire because you only have one connection to the device. If you split the wire you don't get a new connection, you juts get the same connection. If you split the LINX Ref wire, the VIs downstream might both try to talk to the device at the same time. In this case a command might be sent to the LINX device before the previous one is complete, and the responses to the commands might get swapped resulting in incorrect data being returned. Since only one command can be sent at a time splitting the LINX Ref wire doesn't result in any performance increase and adds risk for incorrect data. When you call the close VI the connection is closed. This includes any copies of the connection in branched / split wires. Once the connection is closed you can no longer talk to the device unless you establish a new connection with the LINX Init vi."

So just keep those vi's inline. 

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 6 of 11
(2,606 Views)