12-09-2022 10:19 AM
Simultaneously, for example to control a SPI DAC chip output and read back the output by the analog input of an Arduino.
12-09-2022 01:43 PM
Sure can do, but not simultaneously, but sequentially at very close data rate. That for Arduino can be called simultaneously
12-09-2022 02:44 PM
But, I am getting error with this vi. Couldn't figure out. I am new to Labview.
12-12-2022 06:04 AM
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.
12-16-2022 11:06 AM
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.
12-16-2022 03:11 PM
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.
12-16-2022 03:35 PM
But it seems to work for multiple devices in the same wire. You can see the demo here: https://www.facebook.com/groups/291993951488587
12-16-2022 07:46 PM
Linx and the firmware for arduino is transactional. It sends a command, waits for the command to finish, returns the result. As posted previously, you shouldn't really branch the Linx wire.
If you want more simultaneous action you'd need to implement your own firmware and serial communication protocol to run on the arduino; Linx is designed to be simple. Usually though, you can just do the "quick" stuff first and then do the action that takes a bit more time. So in series do the digital I/O, then the analog, then external comms (SPI).
12-17-2022 05:17 AM
Somehow, I managed to cheat controlling 4 peripherals at the same time. SPI, PWM, Analog In, Digital I/O. Please see attached.
12-17-2022 08:43 AM
Linx isn't principally not capable to do that. What is usually the difficulty is that various pins have multiple purposes, so if you try to use multiple functions at the same time, you have to be very careful which pins you use for what.