LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino I2C, 5003 error

Kevin, Thanks. Thats exactly what I needed. The labview code below seems to work fine with the Serial.print(analogRead(x)) on my arduino. I have just two questions:

1. What does the "byte count" and "return count" in the VISA read routine tell me? 

2. Thus far, Im getting just one analog channel and was just wondering what routine I can use to parse the data for two or more channels onto the chart? In the arduino code below there is a comma separating the two channels and a carriage return separating each read. I imagine theres a better way to do this as well. Like Serial.print(array) or something. Any suggestions are welcomed.

void setup()

{

Serial.begin(115200);

}

void loop()

{

Serial.print(int(Thermister(analogRead(0))));

Serial.print(",");

Serial.println(int(Thermister(analogRead(1))));

delay(50);

}

labview read.JPG

0 Kudos
Message 11 of 13
(816 Views)

Hey,

Byte count is the number of bytes the read will wait for before returning (can also return because of a timeout). Return count is how many bytes are actually returned.  There isn't a really great way to print back arrays from the Arduino other than doing it a byte at a time. Check out the Arduino serial documentation here:http://arduino.cc/en/Serial/Print its got some good information on the different data types it can take.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 12 of 13
(816 Views)

Kevin, Thanks. Ive got a single channel running well. Im wondering now how to parse data sent from more than one channel. Lets say I serial write out my data delimited with a comma. What VI do I need to add to parse that data and get it charted?

0 Kudos
Message 13 of 13
(816 Views)