LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading multiple csv file to Waveform graph

Solved!
Go to solution
Solution
Accepted by topic author Huqs

I'm guessing this is what you want. If you don't want to use the first column as X and the second as Y, make some minor changes to the Files: Double Click case.

 

The code uses the Read From Delimited Spreadsheet with a comma set as the delimiter and reads only the first two columns, since it doesn't look like you're using any others (again, you can change this).

 

Then it uses Index Array, with the row input unwired and the column wired with 0 and 1 to get 1D arrays of the columns. It bundles those together to form what the XY-Graph considers a "plot" (copied from detailed help):

The XY graph accepts three data types for displaying multiple plots. The XY graph accepts an array of plots, where a plot is a cluster that contains an x array and a y array.

This is then passed to a Build Array node, which adds it to existing data. To remove the plot in the Active Files: Double Click case, just use delete from array in the same way you already did.

 

The other cases have the wire passed through. I deleted Timeout since you weren't ever going to see it (no timeout constant).

 


GCentral
Message 11 of 21
(2,103 Views)

Hi Huqs,

 

It's finally working! But it's not showing all the plots from the active files box.

No, it's not working as intended!

 

THINK DATAFLOW!

In your snippet you are loading ONE (1) file and display just ONE (1) plot from its data.

THINK DATAFLOW!

 

In my snippet I told you to load an array of files and to create an array of plots, using a loop.

It seems you missed this completely!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 21
(2,089 Views)

Hello cbutcher, 

Yes, this is exactly what I was looking for! Thank you very much for the file and all the explanation. I attached two different csv files earlier and I tried to open both of them at the same time. But it only opened the 2nd one. So, I will look into why it's not opening both at the same time. Maybe make some minor changes. You obviously saw that we can double click and remove files from the 'Active file' box. My next goal is to remove the plot of a dataset by just double clicking it's csv file in the 'Active file' box and removing it. 

0 Kudos
Message 13 of 21
(2,090 Views)

Oh wait, nevermind. You already added the removal of graphs via 'active file' box already. 

0 Kudos
Message 14 of 21
(2,085 Views)

Great. So it does what you want, right? I tried to get the idea of what your goals were from the VI you provided - any changes should hopefully be fairly simple for you to make for minor changes.


GCentral
Message 15 of 21
(2,080 Views)

Hi Huqs,

 

it would be nice of you when you would not ask the same question in several threads the next time (aka no double posting please)!

 

I merged your threads…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 16 of 21
(2,082 Views)

Ah - that's why I was so confused reading through this thread that I thought I'd replied to but didn't recognise half of!


GCentral
0 Kudos
Message 17 of 21
(2,079 Views)

Hi GerdW, 

I am sorry for that. It won't happen again. 

0 Kudos
Message 18 of 21
(2,071 Views)

can u plz tell me which function is that after read function

0 Kudos
Message 19 of 21
(1,696 Views)

Hi Om,

 

did you use the context help? It will tell you the name of the function…

 

Spoiler
(IndexArray, atleast in the VI marked as solution.)

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 20 of 21
(1,693 Views)