LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need help w/ speed up parsing of spreadsheet string

OK, you are doing all this way too complicated.
 
If data is appended to a file, you only need to parse it starting from the position where you finished reading in the last iteration. Basically, you need to open the file once and keep track on the file position in a shift register, then just read and parse the new data and append it to the existing three arrays you need. You are passing evergrowing strings out of a subVI where you need to parse the evergrowing string again for graphing (probably eqaully complicated!).
 
I reality, you never need to touch any data in the file more than once. Think about it! 🙂
 
I think you can do everything in the toplevel containing the graph with a few strokes of the mouse. 😄
  1. open file for reading and allow access by others
  2. start while loop. Initialize start position to zero in a shift register.
    1. read from start position and place end position into shift register.
    2. Use something similar to my code and built the three numeric data arrays in shift registers.
    3. graph the data as desired.
    4. wait one minute
    5. go to next iteration
    6. repeat
  3. close file and end program.
 
What is writing to the log file? Is it also a LabVIEW program?

Message Edited by altenbach on 09-14-2007 12:26 PM

Message 31 of 35
(626 Views)
The log file is being written by a Visual Basic program.  I currently compare the timestamp of when the file was last modified to itself using shift register so that I know when the file has been updated.  The file does not update once a minute reliably, it is a LOG file from a DAQ system that is user controlled so it updates randomly as far as the program is concerned but on average once a minute.
0 Kudos
Message 32 of 35
(617 Views)

So replace step 4 with "wait until file has been modified" 😉

There is just no excuse to read the entire file everytime it contains a few more lines and parse everyhing from scratch. :o.

Message 33 of 35
(612 Views)
Altenbach I like your style.  I also need to thank you for the help, and thank JoeLabView for the help too!  It does make since that the program doesnt need to touch the log file in the same place more than once, I will implement your suggestions.  Now I just need to find the time to implement your suggestions.  I do want to thank you all again for the help, aside from improving this program I have a better understanding of good programming practices!  I do reserve the right to post on the subject again when I rewrite the program incase future problems arise. 

Cheers!
0 Kudos
Message 34 of 35
(608 Views)

I was away for a while.  Wow... Lots of good progress. 

Altenbach is the wizzard when it comes to improving code 😉

Please do continue to post questions in this thread on the subject.  Hope you have fun learning..

😄

0 Kudos
Message 35 of 35
(592 Views)