LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 4 Message Comes when i save File

Hi,
 
Greetings! Everytime I ran my new application Error 4 always comes hence the data i inputted are not being saved.
 
Attached please find the VI which is generating Error 4. This is the original VI and this works fine.

But due to some requirement, I added two more controls in the while loop (not shown). When I added two controls, i changed the count from 86 to 88 in
the Read from Binary File function. Then I build the application. But when i ran the built application to the other PC, the Error 4 always comes out
everytime I push the Save Button inside the while loop. Its either "Error 4 File is finished" or Error 4 End of File".

I cant find any mistake since the original VI is working fine, i just added two more controls and then i am getting this error 4Smiley Sad.

Should I ignore error 4 by deleting Simple Error Handler ??
Should I make the relative path on the Build Path function a specific path; example,
C:\Documents and Settings\BONG\My Documents\LabVIEW Data\default.txt  ??

Is the three Strip Path enough when i make the execution file??
Can someone please advise me what is wrong with my VI. Thank you very much.
0 Kudos
Message 1 of 6
(3,117 Views)
Bong,
 
The path of a VI is different when it is run as a VI and when it's part of an executable.  For example, I get the following two paths -- using the Current VI's path function -- when I run the same VI by itself or as part of an exe, respectively: 
 
C:\devstuff\myProjs\vipath.vi
C:\devstuff\myProjs\test\vipath.exe\vipath.vi
 
That's very likely your problem:  your default.txt will not be found.  So, you will want to accomodate for the above. 
 
-Khalid
0 Kudos
Message 2 of 6
(3,109 Views)
Dear Mr Khalid,
 
Thank you for your reply.
 
I tried to remove the Simple Error Handler Function (ignore the error), and make an execution file and run in my own PC, and you know the Error 4 do not come anymore. All the new data i inputted are being saved without any error popping out.
 
Do you think this is my current problem?
0 Kudos
Message 3 of 6
(3,106 Views)

I don't think it's a good idea to remove error reporting.  You will just be suppressing any issues, not really solving them.

-Khalid

0 Kudos
Message 4 of 6
(3,095 Views)
Thank you for the reply.
 
I removed the Simple Error Handler Function but instead I placed an Error Indicator. I right clicked on the Error Out of the Close Function and created an Indicator. I just want to get rid of that Error 4, even though it is not a fatal error, since it disturbs my application when I try to save new data.
0 Kudos
Message 5 of 6
(3,078 Views)
Dear Mr Khalid,
 
I modified the VI again by using the General Error Handler, by placing it after the Read from Binary File. The Simple Error Handler will be as is. When I build and ran the application the Error 4 do not show up anymore.
0 Kudos
Message 6 of 6
(3,075 Views)