09-30-2014 07:34 PM - edited 09-30-2014 07:37 PM
Hello,
I have a problem when trying to read a .lvm file through "Read from Measurements file" with the following block diagram
Problem: it reads only the first line of data from what I can see in the probe window,.
A part of the lvm file for reference.
I haven't used Labview in a long long time, I'm trying to figure out what I am doing wrong.
Thanks
09-30-2014 07:47 PM
Pictures are useless to troubleshoot, because we cannot see how the express VI is configured.
You also have a serious race condition. For every iteration, the EOF? local variable gets read before the indicator is written, meaning that the result of an indicator change will only take place one iteration later. Use proper dataflow and use the wire going to the indicator to make a termination decision.
Your loop spins as fast as the computer allows and all you get in the end is the result of the last read operation. Is this really what you want?
09-30-2014 07:57 PM - edited 09-30-2014 07:58 PM
Well, all I want is to read the data from the lvm so I can plot them in the chart.
My VI was based on the example in labview "Read TDMS files" (I figured it would be the idea wit ha lvm) except I've put the local variable for EOF? (Understood my error on this) and I didn't put a wait because I figured I'd let the while loop run as fast as the computer can to load the data.
Attached is the VI I'm using.
09-30-2014 07:59 PM
How was the file originally written? Can you also attach the lvm file?
09-30-2014 08:18 PM
Sorry meant to attach the lvm. Here it is. (Actually I had to put it in .txt because the forum wont let me upload a lvm file)
I unfortunately cannot share the full vi that record the data as I am not its owner/creator. I'll try to give as much info as I can with the relevant pictures attached, I hope it allows us to at least have an hint of where the problem might be.
(this is in a while loop)
In the stacked sequence, the other pannels are similar to the one shown here: value read fron a variable, converted to dynamic and a signal attribute is set. The "start recording" control operation is "switch when pressed".
Here are the properties of the set signal attributes
And here are the properties of the "write to measurement file"
09-30-2014 08:47 PM
I don't use express VIs, so I don't know how they work, but here's how you could read all rhows, for example. I am sure there is a better way. 😄
09-30-2014 09:09 PM
Thanks, that'll work for now. I think it might be the way it is recorded that is at fault, I'll spend some times trying out stuff.
10-01-2014 01:00 PM - edited 10-01-2014 01:01 PM
Also make sure to remove that array indicator (or move it out of the loop), there is no need to update it after each line read. I just placed it for debugging, of course.