LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to bring data from arrays into xy-graph?

Hello,

i have some data which is currently stored in two arrays. One array with values and another array with timestamps.

Now my questions is how can i bring/convert these into the format of XY-graph?

Thanks for help.

 

 

xy.jpg

0 Kudos
Message 1 of 15
(3,594 Views)

As shown in your picutre, the XY graph accepts a cluster.  Use the Bundle tool to place the X and Y arrays into a cluster

Message 2 of 15
(3,592 Views)
Your image shows an array of strings - not timestamps. You would need to convert that array before bundling. However, if you a regular time interval between samples, a normal graph makes more sense.
Message 3 of 15
(3,585 Views)

Is this the way how to convert the two arrays in xy-format?

Somehow i have to use the string-timestamp as i will have later 10 traces on the graph with little different timestamps.

 

con2.jpg

0 Kudos
Message 4 of 15
(3,577 Views)
That code makes no sense at all. You simple bundle the x and y arrays as you have already been told. Please turn on context help. When you move your mouse over the indicator on the block diagram, you will be shown exactly what is required. No for loop. No array to cluster. The bundle by itself creates a cluster.
Message 5 of 15
(3,567 Views)

Thanks for your help. Seems to work now.

I am looking now for a property for dynamically add new plots to the graph. My idea was that there is a property for the graph under "Plot + Add"? But seems to be to easy 🙂

 

 

con3.jpg

0 Kudos
Message 6 of 15
(3,551 Views)
Multiple plots mean an array of clusters. This would often mean a simple build array function.
Message 7 of 15
(3,549 Views)

Hi,

thank you for the help.

Currently i have a cluster-array in a global-variable

The cluster contains:

-Timestamp

-channel(1..30)

-y-value

 

I can have up to 30 plots in one diagramm.

Now i have to create something that depending on the number of different-channels in the cluster-array i have the same number of plots.

How can i do this?

Thanks

 

 

plot1.jpg

 

 

0 Kudos
Message 8 of 15
(3,521 Views)

Hello,

currently i am trying to use a loop that executes 3 times a Bundle and inserts it in a cluster-array.

The problem is that the "start-array" that goes into the shift-register is wrong at the end.

What can i change to not have this "dummy"-entry later in the array?

The loop inserts the correct values at index 0, 1, and 2 but at index 3 is then this dummy-array?

How to change this?

Thx

 

Bundle.jpg

0 Kudos
Message 9 of 15
(3,477 Views)

Hi One,

 

- Why do you use a InsertIntoArray when you want to append new plots to an array of plots? Use BuildArray!

- Why do you initialize your shift register to already contain (atleast) one plot?

- Why do you use a shift register at all? Why not rely on the autoindexing output tunnel? 3 iterations will yield 3 plots easily…

- Why don't you clean up your VI before uploading?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 15
(3,473 Views)