LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting 2D array

Solved!
Go to solution

I'm trying to plot a 2D array being read from a csv file using the read spreadsheet vi. So far I've tried everything in other posts that I've found and nothing shows up on the graph. 

 

I'm currently trying to get it to work on an XY graph. 

I'll attach the csv file I'm trying to use its just two columns of data. It will always be two columns but unlimited on rows as data accumulates over time. 

It's extracted from a log and I'm trying to give a visual representation of the filtered data to the user. My other choice is using matplotlib with python but I'd like to keep it in LabVIEW as it is more aesthetically pleasing and easier to view the data.  

0 Kudos
Message 1 of 7
(2,951 Views)

@russ_comer wrote:

I'm trying to plot a 2D array being read from a csv file using the read spreadsheet vi. So far I've tried everything in other posts that I've found and nothing shows up on the graph. 

 


We cannot tell you what you are doing wrong, unless you attach your VI.

 

  • Can you read the CSV file correctly into a 2D array?
  • Can you get the two columns and create a complex 1D array or some other data structure the xy graph understands?
  • ...
0 Kudos
Message 2 of 7
(2,941 Views)

Hi russ,

 

it would help when you would attach your VI with your failed attempt…

 

It's quite easy to plot XY data:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 7
(2,938 Views)
Solution
Accepted by russ_comer

Works just fine here. (What is your localized decimal delimiter?) 

 

altenbach_0-1590772055943.png

 

Message 4 of 7
(2,934 Views)

Whatever you have after the index array must be what I'm missing, I don't really have anything in the case of the failed attempt because it's just the xy graph and the read spreadsheet function.

I've deleted and tried everything that I've found and the function that you both used after the index array is the first time I've seen that. 

 

Attached is a screenshot of one of the many things I've tried. 

0 Kudos
Message 5 of 7
(2,930 Views)

You did not define the delimiter as comma.

Your transpose is in the wrong place.

Why don't you place an array indicator after the read function to see what you actually get?

0 Kudos
Message 6 of 7
(2,912 Views)

Given an array with N columns (x, y1, y2, ...yn), here's one possibility:

 

altenbach_0-1590775103635.png

 

0 Kudos
Message 7 of 7
(2,894 Views)