# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Combining 1D Arrays from two sensors into a 2D array for XY graphing purposes

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.

Message 1 of 5
(340 Views)

## Re: Combining 1D Arrays from two sensors into a 2D array for XY graphing purposes

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).

Message 2 of 5
(336 Views)

## Re: Combining 1D Arrays from two sensors into a 2D array for XY graphing purposes

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)

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 5
(317 Views)

## Re: Combining 1D Arrays from two sensors into a 2D array for XY graphing purposes

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.

Message 4 of 5
(289 Views)
Solution
Accepted by topic author SeanRobert

## Re: Combining 1D Arrays from two sensors into a 2D array for XY graphing purposes

@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. 😄

Message 5 of 5
(279 Views)