LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 4 in Read Labview measurement file

I have tried to ask similar question yesterday but now I have created separate program to look at.
When I run it on second opening of a file it shows
"Error 4 occurred at Read LabVIEW Measurement File -> Vibrafilter.vi" Possible reason(s):
LabVIEW:  End of file encountered.
What is wrong in my  program?
I ahve included program and labview measurement file into archive.
Thanks in advance. Sergey.
0 Kudos
Message 1 of 15
(6,937 Views)

Hello Sergy,

The reason you are getting Error 4 is due to the way that the Read LabVIEW Measurement File works; when you read a lvm file more than once it continues to read the file from the point it finished reading the previous time. So as you are reading the entire file the first time, when you attempt to read the second time it is already at the end of the file.

I have attatched a forum link which you may find helpful:

http://forums.ni.com/ni/board/message?board.id=170&message.id=144498&requireLogin=False

Regards

Emma R,

NIUK &Ireland

 

0 Kudos
Message 2 of 15
(6,911 Views)
Thanks EmmaR for the link. It gives some ideas but not the final solution.
I have tried to connect EOF to the loop condition button of while loop. But now I need to be able to read the file on the button click.
If I place Read Labview measurement file into while loop (with EOF connected to stop button) than place this loop into case structure and case structure into while loop with some Wait until nex ms Multiple connected to loop condition.
Then I  have again Error 4. So do you have any suggestion comments?
Sergey.
0 Kudos
Message 3 of 15
(6,896 Views)
Hi Sergey,
 
Would it be possible for you to post your modified code for me to look at?
It would help me to make a better assessment and hopefully find a solution for you.
 
Emma R
 
NIUK & Ireland
 
0 Kudos
Message 4 of 15
(6,869 Views)

Of course I can post my code example. At the moment it works only once and then shows Error 4 again.

I would like to have it as a part of another more complex program where in one window I can see my current measurements and in another I can take a look at previous measurements. But for beginning let's make it work as a separate program.

Sergey.

0 Kudos
Message 5 of 15
(6,858 Views)

Hi Sergey,

When bulding a specific task you need to use low level VI's rather than adapt high level VI's.

I have written you this basic piece of code which opens the data file you posted and plots it iteratively until you press stop. It will preform the task each time you run it. This is a better way to read files.

Hope this is helpful.

Emma R

NIUK & Ireland

 

Message 6 of 15
(6,838 Views)
Thanks Emma R for example. It works fine the only thing is that it asks for file to open all the time(I press run button it asks for file I chose file it shows it and asks for another file). How may I change it that it asks for a file only when I press the button that asks to show file.
Sergey.
0 Kudos
Message 7 of 15
(6,823 Views)

Hi Sergey,

The sequence that I wrote for you only asks for a file to open if you have not populated the "path" field on the front panel. If you populate this box before you run your program then it should not ask for a file location when running.

Hope this helps

Emm R

NIUK & Ireland

0 Kudos
Message 8 of 15
(6,808 Views)

Thanks Emma R,

it really helped.

I do need to learn "good manners" in LabView programming but I do not know another way than starting to create something by myself and ask for the help if the problem appears.  Sorry if my questions were silly.

Thanks a lot.

Sergey.

0 Kudos
Message 9 of 15
(6,798 Views)

Emma R,

I have one more question about sample you have built for me: This 100 ms timer, does that mean that program will read the same file every 100 ms? I am asking about it because measurement file created by my program are quite big so it will take a lot of PC resources on each reading of the file.

If it does read the file every 100 ms is there a way to do it only once on a button pressed moment?

Thanks. Sergey.

0 Kudos
Message 10 of 15
(6,788 Views)