LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extract data from text file to plot graph

Hello,

 

In the attached VI I am trying to get an easy way to seperate the Prg_Temp data into the three blocks: RM, +100 and -30 so that I can have 3 plots (i.e. plots of RM, +100 and -30) for each of the index that I select to show up on the same graph.

 

Any help will be appreciated!

 

Thanks,

hiNi.

Download All
0 Kudos
Message 1 of 10
(3,908 Views)

Can you explain what you want to do with the data once you have sorted it into three different groups?  

 

Here is my thought on sorting your 2D array.  I use the match pattern you had to find whether it is RM, +100, or -30 (I also included a case for no match).  Then I just used a conditional index tunnel to add each row to the appropriate output.

 

Don't worry about the watermark,I haven't activated LabVIEW on this PC yet.

 

Sort.png

 

 

 

Matt J | National Instruments | CLA
Message 2 of 10
(3,861 Views)

Hello,

 

I wanted to then take the data and make 3 plots...one for the +100, -30 and RM data.

 

Thanks,

hiNi.

0 Kudos
Message 3 of 10
(3,827 Views)

Splintered threads:

http://forums.ni.com/t5/LabVIEW/different-plots-on-same-graph/m-p/3103204#M888848

http://forums.ni.com/t5/LabVIEW/dynamically-plot-data/m-p/3103796

 

Answering http://forums.ni.com/t5/LabVIEW/dynamically-plot-data/m-p/3103796 :

 

 

If you need to have your data grouped for "Current" was well as for "Temp", then I would think to do the same thing that was done for "Temp".  In the end, have a 4-dimension array with each volume being a "Current", each page being a "Temp", and then the rows and columns being the remaining data, which you want to plot.

 

Right now in the Plot Graph case you are throwing away the first column (Current data, makes sense), then throwing away the first page (?), then building a 4-dim array with number of volumes being equal to original number of pages and each volume being an identical copy of each of the remaining pages (?).

 

 

Also, as it was when I opened it, there were two "Get vs Info" cases.

 

 

By the way, what graphical type is that cluster?  I can't figure it out.



Message 4 of 10
(3,770 Views)

Hello,

 

I attempted what you suggested (as indicated in the the updated VI attached here), however, I still am a little confused.  In the final state of Plotting the graphs, I am still not getting the correct response that I need.  Can you give me some more guidence.  I am getting confused with the page, volume info.

 

The answer to your question as to what interface is the "List", it is from the Metallic Interface.

 

Thanks,

hiNi.

Download All
0 Kudos
Message 5 of 10
(3,740 Views)

The reason noone is replying here is that you have marked the Question as "Solved".  If it is Solved, then people will stop looking at it unless they "find it" while trying to solve the same problem, themselves.

 

I haven't looked at your VI, but judging by the previous comments, you seem to have embedded a 2D plot inside a 4D array.  There are common names for the dimensions in 2D arrays (row, column).  The third dimension, when present, is sometimes called "page" (think of a book), and the fourth dimension would be "volume" (think of a set of books).

 

Really, the problem of making a single plot that shows three traces is fairly simple -- look at the LabVIEW Help for Graphs or Charts, and/or search the NI site (or the Web) for tutorials on LabVIEW plotting.

 

Bob Schor

0 Kudos
Message 6 of 10
(3,666 Views)

Hello,

 

With the 4D array, I thought that I can get the plots to change dynamically.  That is, if I select 1, 2 or 3 of the "Temp" data selection, I can also select any of the "Curr selection"  and go ahead and get the correct plot.

 

Right now, I can only select 1"Temp" selection and also I have no effect from the "Curr" selection.  I am closer to my final desired outcome compared to the start of this thread, but I am still stuck right  now to get the other sets of data to make the chart update dynamically.

 

In the final result, I want to select either "RM", "+100", or "-30" ( 1, 2 or 3 slections) from the "Temp" data selection.  Then have the same effect for the "Curr" selections (i.e. select either 136, 174, 470 or 519...all, 1, 2, 3 or 4 selections).  

 

The current state of the program  does not allow me this freedom.  I can only at this point select "RM" from the Temp slection, no effect for the "Curr" selections.  I can however change the "Test" selections dynamically.

 

I carried out the same procedure like I did for the "Temp" grouping on the "Curr" grouping, but in the "Plot Graph" case, I am stuck as to how the data should be manulipated to get my desired output.  Should I get rid of the double for loops in the "Plot Graph" case???

 

Thanks,

hiNi.

0 Kudos
Message 7 of 10
(3,647 Views)

Actually, thinking over it again, a better approach for data organization in this case (and it would be required if you have different lengths of data collected for some tests) may be to make a 2D array of plots - each "plot" being a cluster of an array.

 

Your two dimensions would be Current and Temp.  You specify a current and a temp (e.g. "+100" and "136") and it returns a plot for you to display.  What this means is you want to parse your data a bit differently to form this.  I would think:

 - Find out how many Temps you will have

 - Find out how many Currents you will have

 - For each combination (so numTemps x numCurrents times, 12 times in your case),

   - Go through your original 2D array and gather all of the data that match both the current Temp and the current Current.  Build this into an array, bundle that into a cluster, and place that cluster at the current location in your Temp x Current array.



Message 8 of 10
(3,628 Views)

OK, I have the "Temp" Selection working good with the "Test" selections.  In the attached VI, I am still stuck on the "Curr" selection.  The "Curr" selction is still not doing anything.

 

Your help and guidance is sincerely appreciated.

 

Thanks,

hiNi.

Download All
0 Kudos
Message 9 of 10
(3,611 Views)

I've split the data up in the "Current Array" and "Temp Array", how can I combine the arrays then to make them selectable from the list?  (see attached Dynamic Plot.llb)

 

Alternatively, can I in some way then make the "Curr" array a Volume that I can then select just like the "Temp" array?

 

 

Thanks,

hiNi.

Download All
0 Kudos
Message 10 of 10
(3,569 Views)