LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Arduino data on Labview

I've connected an I2C sensor to Arduino, uploaded a code to get the data and I'm getting the output on Arduino IDE.

 

I want to get that that sensor data on Labview.

I've made the program using VISA, and I'm even getting the Arduino data on Labview, but that data is all text in one line, in ASCII, whereas I only want that specific sensor value.

 

This is my current Labview program: 

sarwatsarfaraz_2-1660897894895.png

 

 

This is the output on Arduino IDE:

sarwatsarfaraz_0-1660897635251.png

 

I want to get data on Labview like this:

sarwatsarfaraz_1-1660897799293.png

 

Is there any way to do this?

0 Kudos
Message 1 of 5
(1,266 Views)

Hi sarwat,

 


@sarwatsarfaraz wrote:

Is there any way to do this?


Yes.

You just need to parse the incoming data in LabVIEW!

 

Recommendation: change your Arduino code to deliver all data values in one line, separated by a common char like comma or semicolon...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(1,253 Views)

Okay so I'm trying Spreadsheet String to Array

 

This is the program I've designed, but I'm not getting any value in the array.

sarwatsarfaraz_0-1660905026226.png

 

What am I doing wrong?

0 Kudos
Message 3 of 5
(1,223 Views)

Try using a single dimension array here

 

sarwatsarfaraz_0-1660905026226.png

 

If you are using the Arduino Serial.PrintLn command to send your data. Enable the Termination Character in the VISA Serial Setup and make sure it matches what the Arduino is sending

 

Serial.println()
Description
Prints data to the serial port as human-readable ASCII text followed by a carriage return character (ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). This command takes the same forms as Serial.print().


========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 5
(1,201 Views)

Hi sarwat,

 


@sarwatsarfaraz wrote:

What am I doing wrong?


Why do you think you need a 4-dimensional array to store 4 elements in a 1D-array (aka vector)?

 

Did you do the basic LabVIEW courses? Have you learned about basic array handling in LabVIEW?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(1,178 Views)