From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading multiple csv file to Waveform graph

Solved!
Go to solution

Hello There, I have been asking for help in Labview forum for a while since I am a new user. I am trying to build an application where you can filter our your desired csv file(2 variable or 3 variable data sheet) from a directory and open them in Waveform graph. I have figured out all part except the last one where I can display the data sheets into graph. I know that i have to use 'Read delimited Spreadsheet' element but I am still having hard time figuring out connecting elements with each other. If you run the attached snippet. you will see I can filter out my desired files (Which are also attached here) into 'selected file' box from 'file box' list. What I want to do is directly import the csv files from 'selected file' box to graph. If anyone have suggestions,please let me know. Thank you. Multicolumn list box v1.2.png

0 Kudos
Message 1 of 21
(5,746 Views)

Below is a snippet reworking your VI a little. Your loop had no wait, so it was running as fast as the computer could manage - I added an event structure to prevent this. Now, it does something only when you change something.

 

The handling of the files should be similar, except you should now press Done when you've selected all of the files you want - they will display each time you change your selection. The Done button should trigger the reading of the files in my snippet. I show it below with the Done case visible, which shows building the paths you need. I'm not sure what exactly you want to do with the multiple sets of data and so on (since both Files and Selected Files allow more than one selection).

 

Example_VI_BD.png


GCentral
0 Kudos
Message 2 of 21
(5,701 Views)

First of all, Thank you very much for enhancing my application. What i wanted to do is, the csv files that I have put in the 'selected files' box by selecting, i wanted them to open up in waveform graph. I wanted to have more than one csv files opening up in graphical format in the same plot. This is for comparison purpose. 

0 Kudos
Message 3 of 21
(5,684 Views)

Following the previous comment, here is the update of my application. If you run it, you will see basically I am trying to plot the csv file from the active file box into XY graph. If you can help me to get this , then that would be great. Thank you. Multicolumn List Box V1.4.png

0 Kudos
Message 4 of 21
(5,677 Views)

Hello Everyone,

this is the latest version of the my application. I have attached the block diagram snippet here. If you run it, you will see you can filter out you preferred csv files into 'Active file' box by double clicking on the files from the 1st box once it loads there from directory. What I am trying to do is, I want to read more than one csv files from the 'Active file' box and plot the data sets all in one XY graph. I want to have multiple csv data sets in one XY plot because I want to compare the plots. If anyone can help me out or make suggestion, that would be great. if anyone can show me an appropriate discussion link, that would be also appreciated. Thank you. Multicolumn List Box V1.4.png

0 Kudos
Message 5 of 21
(5,715 Views)

Hi Huqs,

 

read those "Active Files" in a loop. With each iteration you read one file and create your plots from it. At the loop border you create an array of plots, either with simple autoindexing (one plot per file) or by concatenation mode (several plots per file)…

 

What have you tried so far? I created this in 2mins:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 21
(5,709 Views)

See I did not try much yet. I am actually a relatively new use. So far I have tried to connect the active file value property to read delimited spreadsheet and from there I was planning to separate X and Y values and bundle them to connect in XY graph element. But it's not quite working out. However, what you suggested, I will try to do that. 

0 Kudos
Message 7 of 21
(5,701 Views)

GerdW,

i wasn't able to open and run the snippet you attached since I am running Labview 2015 and yours was made in 2016 version

0 Kudos
Message 8 of 21
(5,699 Views)

GerdW,

So I tried what you suggested, but I wasn't working. So I tried this. But it wasn't working either. I don't know where things are going wrong. Multicolumn List box V 1.5.png

0 Kudos
Message 9 of 21
(5,685 Views)

It's finally working! But it's not showing all the plots from the active files box. I have attached 2 specific csv file. it's just showing the 1st one and not the 2nd one. IDK why, although the 2nd one does load in. I have to see how can I modify graph display to show them altogether. Multicolumn List box V 1.5.png

0 Kudos
Message 10 of 21
(5,682 Views)