LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Port to Array for Data Acquisition

Solved!
Go to solution

I am currently working to present my data from my Arduino to LabVIEW in an XY graph and in a table. I have created a VI that reads the data printed from my Arduino into an XY graph that doesn't work as I expected. This is in the sense that the point on the graph is moving but not plotting any data, rather moving within the bounds of the graph according to my sensors. 

 

I am attempting to plot force v. angle (angle=x and force=y). I am using a linear taper potentiometer to correlate the change in voltage to a change in angle and a load cell for the force. I believe the problem is in the fact that I brute forced the data to show in the (x,y) form but I can't seem to properly create an array to hold the data and plot the XY graph using the non-existent array. I have attached the Arduino code as well if there are any confusions as to what I've done.

 

If someone could help me rebuild my block diagram to save the data from the Arduino into an array/table, so I can save the data and eventually have a graph actively built while the array and the entire VI is running that would be awesome. Any advice is appreciated and thank you!!!

Download All
0 Kudos
Message 1 of 3
(497 Views)

Hi Sean,

 


@SeanRobert wrote:

I believe the problem is in the fact that I brute forced the data to show in the (x,y) form but I can't seem to properly create an array to hold the data and plot the XY graph using the non-existent array.


Two suggestions:

  1. You can resize ScanFromString to scan for two values at once, no need to call it twice…
  2. To build an array you use BuildArray and a shift register to hold the previous data…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(457 Views)
Solution
Accepted by topic author SeanRobert

Program your Arduino to send your sensor data in one line separated by commas. 
Then it is really easy to parse the string and convert it to a numeric array by using "Spreadsheet string to array" with the the delimiter set to a comma.

 

SS2ACapture.PNG

 

 

 

========================
=== Engineer Ambiguously ===
========================
Message 3 of 3
(421 Views)