06-21-2017 01:40 PM
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.
Solved! Go to Solution.
06-21-2017 08:07 PM
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).
06-22-2017 11:07 AM
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.
06-22-2017 01:28 PM
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.
06-22-2017 02:30 PM
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.
06-22-2017 02:37 PM - edited 06-22-2017 02:39 PM
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:
06-22-2017 02:42 PM
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.
06-22-2017 02:45 PM
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
06-22-2017 03:34 PM
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.
06-22-2017 03:57 PM
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.
06-22-2017 06:56 PM
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).
06-23-2017 01:29 AM
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!
06-23-2017 07:34 AM
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.
06-23-2017 08:09 AM
Oh wait, nevermind. You already added the removal of graphs via 'active file' box already.
06-23-2017 08:46 AM
06-23-2017 08:53 AM
06-23-2017 09:25 AM
06-23-2017 10:10 AM
Hi GerdW,
I am sorry for that. It won't happen again.
07-13-2018 01:07 AM
can u plz tell me which function is that after read function
07-13-2018 01:33 AM - edited 07-13-2018 01:33 AM
Hi Om,
did you use the context help? It will tell you the name of the function…
07-13-2018 01:46 AM
@Om2404 wrote:
can u plz tell me which function is that after read function