02-12-2024 02:00 PM
I am currently collecting data from two different sensors, an absolute encoder for angle measurements and a load cell for force measurements, off an Arduino Uno. I have both sensors printing the data into a 1D array and would like to plot an angle v. force graph. I have done some research and found that creating a 2D array is the simplest way to plot both sets of data in an (x,y) form in LabVIEW. However, I do not know how to approach this. I have been reading the forums and watching youtube videos and I continuously see 2D arrays.
My main question is how do I combine my two 1D arrays into a 2D array as part of my block diagram and how do I apply the 2D array into (x,y) for my XY graph? Thank you for the help.
Solved! Go to Solution.
02-12-2024 02:06 PM
I'm not sure if this is assumed, but I am collecting the data from a serial port with two analog channels (one for the absolute encoder and the other for the load cell).
02-12-2024 02:50 PM
Hi Sean,
@SeanRobert wrote:
I have been reading the forums and watching youtube videos and I continuously see 2D arrays.
Why don't you open the context help window, move the mouse pointer on a XYgraph and just read how to create a XY plot?
The simplest is to use a Bundle function. (Christian might say you should use the "Re/Im to complex" function… :D)
02-12-2024 05:06 PM
Hi Sean
To plot a XY data, you need to combine the two 1D array using a function called bundle , then you will be able to plot the XY.
In your case, each channel is coming from Serial through Arduino. Convert each channel into 1D array then use Bundle into XY.
02-12-2024 05:48 PM
@LVNinja wrote:
To plot a XY data, you need to combine the two 1D array using a function called bundle , then you will be able to plot the XY.
XY graphs accept a variety of datatypes. I actually prefer to create a 1D complex array. LabVIEW knows how to graph IM vs RE. (See here) "Complex" if often the least complex. 😄