LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP PLEASE!!!PLOTTING OF GRAPH ONE AT A TIME

Hi,hopes somebody can help.Is there a way to take the first column of values from the text file first,plot it,and then take the second column of values and then plot it,repeating this process.The VI i wrote will automatically plots all the values straightaway,in which i do not want.I have attached the picture of it.Help please anyone Smiley Sad
 
The example of text file is as follows:
 
0 0
0.78 0.1097616
1.74 0.2448528

Message Edited by SG_SP_OLED on 12-31-2006 10:40 PM

0 Kudos
Message 1 of 10
(3,714 Views)
This should be very easy to do in LabVIEW. Currently, you graph the second column vs. the first column in an XY graph. Do you want to first graph the first column versus the row number and then the second column vs. the row number?
 
What should determine when the second column is graphed (OK button, elapsed time, immediately, etc.)?
 
Why don't you attach your real VI and a typical data file?
 
You code is hard to understand from the picture because you have overlapping wires, right-to-left wires, code hidden in other cases, and confusing compositions. It makes no sense at all to "open" the file (lower left of code) if you are not using the fileref anyway. It also makes no sense why you would read the path with a value property node since the actual terminal is right there (your code cannot guarantee that the path indicator receives valid data before the value property is read above. A race condition!). "Read from a spreadheet file" is a high-level file IO VI that includes opening the file.
0 Kudos
Message 2 of 10
(3,708 Views)
Hi,well actually i wanted it to plot the first row and column first,wait a while then proceed to plotting the second row of data.
For now,it just plots all the values in which i do not want.Meaning i will plot the 0 0 values first,wait maybe 2 sec, then proceed to plot the values 0.78 0.1097616.
I have attached the VI and example file.Hope it helps to clear the doubt.Thank you in advance! =D
 

Message Edited by SG_SP_OLED on 01-01-2007 08:20 AM

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

OK, now its a bit more clear. 🙂

I don't have access to LabVIEW 7.1 at the moment, so I just show you a code picture with some comments.

  1. Simply confugre the Build xy raph express node not to clear between updates.
  2. Now feed it one point at a time in a loop, e.g. using autoindexing.
  3. You can use "index array" to extract columns, no need to transpose first.
  4. Use the original 2D array for the table, no need to reform the array and transpose.
  5. Your boolean buttons, case structure, and outer loop serve no real purpose. You simply spin the loop, consuming 100% of your CPU doing nothing most of the time. If you really want to start updating with a FP control, use an event structure in a loop.
  6. As I already said, get rid of that silly path property node and file open.

Message Edited by altenbach on 01-01-2007 10:48 AM

Message 4 of 10
(3,685 Views)
Sorry last question.how can i get the icon that i have circled red in the picture?Couldnt find it in array.
I tried substituting it for a build array but it couldnt work.
So i can repeat the same method for the results table also isn't?Thanks anyway you have been of great help to me =D greatly appreciated it 

Message Edited by SG_SP_OLED on 01-01-2007 09:42 PM

0 Kudos
Message 5 of 10
(3,659 Views)
Programming --> File I/O -->  Read from Spreadsheet File
0 Kudos
Message 6 of 10
(3,652 Views)
It's the same tool (Read from spreadsheet file) you already have placed in your VI. 🙂
 
(Since I opened your VI in LabVIEW 8.20, things look a bit different. The functionality is the same).

Message Edited by altenbach on 01-01-2007 08:04 PM

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

Sorry,the program is workable now but then the results table only refresh the first row with the new data.Can i make it such that the new data is displayed on the subsequent rows? thanks=D

I have attached the new file and the text file.

Download All
0 Kudos
Message 8 of 10
(3,637 Views)
Well, don't break my code by making random modifications! 🙂
 
My code refeshes the entire table (all rows!) at once. If you want to update the table incrementally, you can use something like in the attached modification.
 
Note that you don't need a seperate FOR loop (especially not one with 1000 iterations!!!) because the graph update and table update are synchronous. If you autoindex at the loop boundary, you only get one row at a time, you need to incrementally rebuild the 2D array, e.g. in a shift register. You don't magically generate the full 3D array from each row by making the row into a 2D table as you tried.
 
Please get rid of all these unecessary transpositions. As you can see in my example, you can just process one row at a time, autoindexing a 2D array.
 
All clear? 🙂

Message Edited by altenbach on 01-01-2007 10:23 PM

0 Kudos
Message 9 of 10
(3,632 Views)
Hi,Thanks for the code!!sorry for the modifications just now.i've copied your code entirely and it worked perfectly.Thanks again=D
0 Kudos
Message 10 of 10
(3,620 Views)