05-05-2014 11:56 AM
I have five sensors connected to Arduino, how can I transfer their data to labview , using serial port as an array? what is the Arduino and Labview code ?
05-05-2014 01:43 PM
in your Arduino code you should implement a querry based or continiously streaming architecture and make the corresponding visa driver on the labview side. The streaming is easier to implement but less convienent to use in the long run from the labview side.
The quick and dirty method
Arduino:
periodically
Serial.write(str) where the str is a string with "sensorVal1, sensor2Val, sensorVal3, sensor4Val, sensorVal5 crlf"
and on LabView
Visa Open - same com settings as arduino (baud, parity...)
read until crlf
Parse the string for the 5 sensor values.
05-08-2014 12:40 PM
many thanks
That makes more sense than the array, but frankly im very new to LV and i dont understand the code you wrote for lavbiew can you please explain it a bit more ?
05-08-2014 01:17 PM
This is pseudocode.
You can look at the example code for visa serial read. Set up the serial to match the arduino setup and read using the same terminal character, you should get the string that the arduino is sending. Once you have this use scan from string to parse the individule sensors back out.