f



get data every 2 columns at a time in excel #2

i would like to read the following excel file
and plot every 2 columns at one time given an interval. for example at
7 am i ll plot corresponding I and V and at 8 am so on.. but even
though i programmed my VI to read by increasing index 0,2,4 so on it
stops when it iterates half way i.e i=12..this only plots half the
data..im reading from delimited text file..how can i read from a true
xls file and plot all the data as desired?


table1.xls:
http://forums.ni.com/attachments/ni/170/318690/1/table1.xls


table mode1.vi:
http://forums.ni.com/attachments/ni/170/318690/2/table mode1.vi
0
x9561 (148438)
4/24/2008 1:40:09 PM
comp.lang.labview 35210 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

1 Replies
571 Views

Similar Articles

[PageSpeed] 28

You have a few problems in your code that need to be resolved first.
1.  You posted and Excel .xls file.  A true spreadsheet file.  The read from spreadsheet file VI doesn't work with Excel files, it only works with text files.
2.  Your run the loop 25 times.  It asks for the file 25 times because the file control is inside the loop.  Also, any loop should only run 13 times, because you have 13 pairs of columns.
3.  You only have 10 rows of data.  The first couple are headers you want to ignore.
4.  After the last iteration, you will only have the results from the last pair of columns because the array indicator and XY graph are inside the loop. (Though I see you have a 2000 msec wait, so you will see the results of each column pair with a 2 second pause between them.)
Overall you have to figure out how you want to  go through the data.  Do you want to look through it as rows or columns?  Do you want to look at the results of all columns?  If so, you will need to look at shift registers and build array functions, or autoindexing.  Move the Read File ahead of the loop so it is only read once.  And move the resulting indicators outside of the column.
Edit:  One more thing.  Having the while loop with a stop button outside the For loop will just cause the program to repeat over and over and over again causing 25 file prompts to become 50, 75, 100, ....  :smileywink:Message Edited by Ravens Fan on 04-24-2008  09:39 AM
0
x9561 (148438)
4/24/2008 1:40:13 PM
Reply: