LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW with Arduino

Hello,

 

I am having trouble reading data on Elegoo UNO. I am getting correct data on the buffer but I want to capture those specific set of data on the table. Can someone help me please? I am having trouble with this.

Please, loop at the VI. 

Thank you! 

0 Kudos
Message 1 of 9
(3,401 Views)

What does the data look like coming out of the Arduino? I am guessing that you are also programming the Arduino so I suggest you send the data out this way.

 

 Serial.println(x","y","z)

 

That will send x, y, and z in one line separated by a comma and end with a carriage return.

 

Then use "Scan from String" to get the values out of the string.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 9
(3,376 Views)

Arduino is programmed like:

Serial.print(a.x());
Serial.print('\t');
Serial.print(a.y());
Serial.print('\t');
Serial.print(a.z());
Serial.print('\t');

This prints x, y, and z with a tab. 

What is Scan from String? How would I use that? Can you please provide an example? 

Thank you very much for taking your time. 

0 Kudos
Message 3 of 9
(3,368 Views)
  1. Use serial.println sending all three values at once separated by commas like I suggested.
  2. Make sure you have Termination Character enabled in your VISA serial setup (you do)
  3. Use Scan Number From String to get the three values out of the received string

sdCapture.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 9
(3,360 Views)

Hello, will this matter if the value gets really big or changes really fast?

Will the coma always separate the values not mattering the size of the string?

 

Thank you so much!

0 Kudos
Message 5 of 9
(3,356 Views)

Nope won't matter.

 

You might want to wire in a "default value" and consider error handling so it will not just crash in case you get bad data. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 9
(3,354 Views)

Thank you so much!

I will test everything. Hopefully this is enough.

 

0 Kudos
Message 7 of 9
(3,351 Views)

Another question. 

What if you are trying to read more than 3 parameters? 

Say x,y,z, and temperature? 

 

Thank you! 

0 Kudos
Message 8 of 9
(3,328 Views)

Just add it in to the data you are sending and right click on "Scan From String" and select Edit Scan String and add another operation to get the next vale out of the string.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 9
(3,312 Views)