03-03-2010 11:26 PM
hi
could anyone tell me if its possible to read from a previously stored text file at some required rate?
( for example if i have 100 entries in my file i wish to read one value every 5 seconds)
thanks in advance
Solved! Go to Solution.
03-03-2010 11:41 PM
Hi divyakarthikey...,
yes it's possible in a loop. Where exactly do you need help?
Mike
03-03-2010 11:42 PM
03-03-2010 11:44 PM
hi
i ve attached my labview file.. i have a text file with 100 entries.
i want to read one value from the file every 2 seconds
divya
03-04-2010 12:00 AM - edited 03-04-2010 12:05 AM
First, you'll have to learn not to use Express VI's. (Look in example finder for examples on file I/O)
1. You have no good control over the way it accesses the data.
2. It puts out the annoying dynamic datatype which hides what the data is, and makes you jump through hoops to get the real data out of it.
Second, you need a loop. Right now your code is set up to just run as a single shot.
Here is how you would read one line at a time with a 2 second delay. (Note that the read text file was set in its right click menu to "read lines".)

Another alternative, (and probably better), would be to read the whole file at once, and then just index the values out of the resulting array in a loop with a 2 second delay.
The formula express VI's are doing some operations that could be handled easily with native LabVIEW code. I would get rid of those express VI's. The first formula node has some pretty basic operatons as well. The bigger formula node could also be done with basic LabVIEW operations, but the coding logic going on in there is complicated enough that I would probably leave that formula node as it is.
03-04-2010 12:21 AM