LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Capture data from Arduino UNO

Greetings reader,

Please help me with this issue that I am having because I cannot solve it. I am connecting Arduino UNO R3 with labview. I am trying to capture data using the block diagram code but I cannot get correct data. I don't know what is the problem. Please, review the attached photos. 

I ran arduino and I am getting raw data as I am moving the sensor, but when I use labview and move the sensor I don't get the almost the same data. I tried same motion with arduino IDE and labVIEW. 

 

Thank you in advanced. 

Download All
0 Kudos
Message 1 of 15
(5,716 Views)

Reading serial data from an Arduino is no different than any other device with a serial interface.

 

DO NOT USE "Bytes at Port" (ever)

 

I am assuming you programmed the Arduino so you know the communication parameters and can change them.

 

Program the Arduino to send out a termination character (like a Line Feed) and set the VISA Configure Serial port to use a Termination Character. 

 

Set your VISA Read to read a lot more bytes than you expect to receive.

 

Now the VISA read will read until it sees the Termination Character or times out.

evvCapture.PNG

Also I don't see any setting for baud, data bits, parity, and stop bits in the VISA Configure Serial.

Are you sure the default (9600,8,N,1) are correct?

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 15
(5,670 Views)

A clear explanation of when/when not to use "Bytes at Port"

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 15
(5,667 Views)

Hello, 

Thank you so much for the reply. I am new to this Arduino and LabVIEW connection. Why should I not use the bytes to port? Can you please explain this?

On Arduino IDE code I have set up the baud 9600. I get readings from the Arduino. On LabVIEW I don't know how to set them up. Could you please help me?

 

Thank you!

0 Kudos
Message 4 of 15
(5,655 Views)

I believe Putnam linked to a very good explanation of when and when not to use Bytes at Port above.

 

You used VISA Configure Serial Port in your code, you just need to configure it.

 

Have you read the help for VISA Configure Serial Port?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 15
(5,649 Views)

Yes. I read the VISA serial port configuration. So, I have a BNO055 sensor but when I move it the string indicator data does not change. Why? Can you help me? 

0 Kudos
Message 6 of 15
(5,631 Views)

That's a tall order as the problem could be in your Arduino code...

 

Have you tried using the Arduino IDE serial monitor to inspect the data being sent by the Arduino?

 

Is it valid and changing when the sensor is moved?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 15
(5,625 Views)

Also are you still using "Bytes at Port"?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 15
(5,619 Views)

No I am not.

Bytes at port was removed. 

Everything works somewhat fine... but sometimes when I stop the program and run it again the values does not change when I move the IMU. Can you think of any reason? 

Arduino IDE work fine like expected. 

0 Kudos
Message 9 of 15
(5,617 Views)

Not without seeing your code

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 10 of 15
(5,605 Views)