LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read *.lvm file

Hello

I wante to read Data from an .lvm file with “ Read LabVIEW Measurement File “, this file was created with “Write LabVIEW Measurement File“. But I get an Error message : [ Error 4 occured at Read LVM File -> Possible reason(s) : LabVIEW : End of file encountred] ??!!

Thinks for any Help
0 Kudos
Message 1 of 6
(3,666 Views)
This error ususally indicates that you are trying to read past the end of the file. Are you reading in the file with the same settings that you used to write it out? When you open the file in another application (like excel or notepad) is your data correct?
0 Kudos
Message 2 of 6
(3,653 Views)
Hello.

I am having the exact same problem as this person has, however I can elaborate on my problem:

First, my program uses a shift register to with "Write LabView Measurement File" to save to file1, file2, file3 etc. The shift register is activated with a counter which is linked to the enable part of the express vi to save.This part works great, I open up the files with a notebook or use "Read LabView Measurement File" OUTSIDE the while loop, I get the numbers I want.

However, my program is to be made for users in one VI. First they choose their desired values with the "Write..." express VI, which works great. Then they are supposed to pick the one value they want to by using "Read..." express VI. Now, the problem lies with the "EOF file encountered" issue. As an example, let's say I save the numbers 14, 17 and 19. I read the numbers with the read express VI, but it reaches the EOF quite fast. What I want is that number so I can use it later in my program.

Before I tried these express VI's, I tried to make a table/array. This was problematic as I only have one signal which varies continously. I have searched so many examples and pages and I am yet to figure out how to solve my problem. The read & write express VI's looks like an easy way to solve my problem, but it still remains as the read express VI reaches EOF quite fast.

If I put the read express VI outside the while loop, it will run once, immediately, at the start of the program...IF it is enabled. This is not how I can run my program, it has to run continously. I hope that someone could help me on this subject.
0 Kudos
Message 3 of 6
(3,601 Views)

The same problem occurs on my VI too. There is no error writing the data into .lvm, when I try to read it, it turns out NaN value or zeros.

 

I got only one value written to the .lvm file. When I try to read it, it gives out an array of zeros, or NaN values.

 

Here is a simple vi illustration;

 

asd.png

 

There are several topics on this issue, there must be anyone to solve this problem, I guess and hope.

 

Ozgur

0 Kudos
Message 4 of 6
(3,054 Views)

Interesting thing, when I recorded data with Headers, reading gave correct results. Try writing data with headers if you didn't.

0 Kudos
Message 5 of 6
(3,051 Views)
Highlighted

This problem occurs when you attempt to read from the same file multiple times. The Express VI will not let you do this, unless you reset it in-between calls.

 

If you want to view different pieces of data from the same file, you should either perform the task manually with the File I/O pallette, or store the read data in a shift register and then use this whenever you want to re-read the data.

0 Kudos
Message 6 of 6
(2,415 Views)