ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Chart/Graph from 2D Array

Solved!
Go to solution

I have a VI which creates .CSV files when taking measurements so that I can analyse the data in other software. I have recently added a camera to my system which also creates an .AVI file which I would like to analyse in conjunction with the .CSV file data.

 

I would like to write a VI which opens the .CSV file and then displays this data as a chart, so that eventually I can use a slider to display the correct frame of the .AVI file. However, I cannot figure out how to do this. When the .CSV file is opened it creates a 2D array, the first column is time in seconds; I would like this to form the X axis. The other 4 columns of the array are voltage readings from various transducers which range from -5v to 5v, these values would be indicated as amplitude on the Y axis.

 

As I understand, I can use an XY Chart to do this; however I haven't had much luck figuring out how to do this and the included examples aren't exactly great at explaining how to do this sort of thing. 

0 Kudos
Message 1 of 13
(27,916 Views)
...
Message Edited by CtheR on 03-04-2010 11:47 AM
0 Kudos
Message 2 of 13
(27,905 Views)

Hi.

 

FORGET THE VI I POSTED ABOVE THIS! IGNORE IT!

This is the solution:

nonsense.png

 If you have questions feel free to ask.

 

Greets

  CR

Message Edited by CtheR on 03-04-2010 11:49 AM
Message 3 of 13
(27,904 Views)

Thanks for the help, I was wondering if I needed to use a For loop. 

 

What low level VI is that you are using before you insert the array into the For loop? It looks like Array Subset to me, but when I use it on my VI it doesn't work.

 

I'm on Labview 8.5.1 if that makes any difference. 

0 Kudos
Message 4 of 13
(27,877 Views)
Solution
Accepted by edcs

Hi!

I used the "delete from array" node.

I delete the first column (with the time) and send the deleted time column into the loop (not indexed).

It contains the x-values of our data set.

The rest of the array gets transposed (I forgot about it before, I was too hasty).

Every column is now a line, gets indexed by the loop and is clustered with the time values to a pair of x-values and y-values.

And done.

arrayXY.png

I've saved it as 8.5 VI.

Greets CR

 

Message 5 of 13
(27,867 Views)
Thanks for your help, I'm all sorted now! 
0 Kudos
Message 6 of 13
(27,856 Views)

I have a similar problem.. I have a 1000x2 data from a CSV Excel file for which the graph is to be plot.. I converted the string into number format.. I am currently checking for 2x2 so that if it works I can run in a FOR loop and finish it. I need to plot the graph for the 2D array.

 

Thanks

KB

Download All
0 Kudos
Message 7 of 13
(27,201 Views)

HI!! i am new to labview.. and i saw this interesting and i start working as it on the screen.. but how to connect XY graph? 

 

"clustered with the time values to a pair of x-values and y-values." what does tat mean

 

pls help me out.. 

 

thanq

Every Expert was once a Beginner!!
0 Kudos
Message 8 of 13
(25,110 Views)

Hello PROing,

 

This is quite an old post so I would recommend that you start a new thread and fully describe your problem so that the community can help out.

 

Thanks,

Mahdieh G
Applications Engineer
National Instruments UK&Ireland
0 Kudos
Message 9 of 13
(25,088 Views)

hi,

 

u manage to get the solution for your question. i have the similar problem as yours.

0 Kudos
Message 10 of 13
(22,895 Views)