LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read LVM End of File Error

I get an end of file error (Error 4) when I try to read from an LVM using the Read LVM Express VI. I don't know how to stop this error. I welcome any advice anyone can offer.
0 Kudos
Message 1 of 9
(5,519 Views)
Is there actually any data in the .lvm file? It's just a text file that you can open up with Notepad. If there is data, can you post the file and an example VI that demonstrates the error?
0 Kudos
Message 2 of 9
(5,508 Views)

I'm also having a problem with the Read LVM express VI.  It will either read segments in the original size or read a specified number of samples as a segment.  My problem is I wrote data to a LVM as 20 sample segments and if I read in the original size the Read LVM only reads the first 20 samples (ie. the first segment).  If I change the Read LVM to read n samples it can only it if I've already found out how many samples my LVM file contains.


Why can't the Read LVM express VI work out where the end of the LVM file is and display all the data?

Cheers,

Bob

0 Kudos
Message 3 of 9
(5,495 Views)

Bob,

This is simply the way that LVM file reading/writing has been chosen to be implemented. It is actually a huge feature that an LVM file parses the data into the segments in which they are written. If you simply want to read an entire file all at once, you should just use the EOF (end of file) output and keep reading the file one segment at a time until you've reached the end. I've included an image below of this concept:

I added the Append Signals VI into the mix to make one contiguous signal in the end, but you could handle the data however you wanted. Hope this helps you out!

Message Edited by AESulzer on 09-28-2005 06:44 PM

E. Sulzer
Applications Engineer
National Instruments
Message 4 of 9
(5,488 Views)

Thanks E. Sulzer!

That has helped me out a lot!  I did think that some kind of loop must be the answer...

Bob

0 Kudos
Message 5 of 9
(5,481 Views)

The LVM I'm using is just a tab-delimited file with 16 8-digit numbers, like:

0     12312412      12312441      12455623      12414124     12312443     12345433

The file was created using the Write LVM Express VI that came with LabVIEW. I'm trying to read it back with the Read LVM Express VI that also comes with LabVIEW. I think it's looking for a termination character or something like that, but I'm not exactly sure. I know that I have to click the "Read generic text file" checkbox to receive the "Error 4 End of file encountered" message or else I receive the "Error 100 File contains erroneous data. Normally for user data files" message. I can see the data split up into columns in the Sample File Data table in the dialog box of the VI, so I know it can at least read the file that much. I've tried to create a VI where the only thing in it is the Read LVM Express VI wired to a numeric indicator and it gives me the same errors. I would really appreciate anyone who has any insight on this problem.

0 Kudos
Message 6 of 9
(5,472 Views)
The posting with different colors is pretty but you really need to post the lvm file. Do you see the little area under the message body area that says Attachment? Click on the browse button and find your file. And, what do you mean that you've got a numeric indicator wired to the output. You've got data in a single row if I understand you correctly so you only want a single value read or is it your goal to read the entire row?
Message 7 of 9
(5,466 Views)
Here is the LVM file. This file only has 8 8-digit numbers. I had another such file that had only 1 8-digit number and I tried to wire that to the numeric indicator. My goal is to be able to read the file in and take 16 8-digit numbers and place them in separate numeric controls.
 
NOTE: I couldn't attach the file here as an LVM because it wasn't of a valid extension. I changed the extension to a .txt file just so I could post it here.  
0 Kudos
Message 8 of 9
(5,464 Views)

I was able to read the LVM file just fine without any errors. Below I've posted the way that I configured the LVM Read.vi. Make sure that you have the proper settings!

Message Edited by AESulzer on 10-03-2005 06:33 PM

E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(5,448 Views)