Jump to content

Error 5 occurred at write to binary file


Recommended Posts

Posted

Hi,

I encounter problem when writing an image file to binary.

***Error 5 occurred at Write to Binary File***

Possible Reason:

LabVIEW:File already open.

=====================================

NI-488: Command requires GPIB Controller to be System Controller.

Anyone know what issue will cause this problem?

Posted

According to the error message the file you are writing to is already Open.

So I would check to see if some other application is currently using the file. Maybe you have already opened the file in LabVIEW and are trying to open it again.

Upload a copy of your VI so we can see it, would help you get a better answer

Danny

  • 2 years later...
Posted

Well, I wouldn't have approached it this way but if you really need to, then just use this error message code as an indicator if the file is already open or not. i.e. check if you are receiving this error 5, and if so then you know the file is already open. 

 

Are you trying to write to this file or deleting it, or trying to open it again?

 

Kas

Posted

Do you have the file open in another program to look at it when you run your VI?  Do you close your file when you are done (you really need to)?  Those are the two most common reasons I have seen for that error.

Posted

Well, I have closed the file before I want to move it, but sometimes I got the error anyway.

I think it's a matter of timing or windows is doing something or maybe the antivirus etc.

I made a VI that check for error and allow to try n times before passing error out as Kas also suggested.


thank you

Bjarne

 

post-7489-0-18961500-1377002188_thumb.pn

Posted

I've seen something similar with TDMS and Copy.  I have a test running where we log to TDMS.  Then we close the file at the end, then copy it and the index file to a duplicate location.  Many times I would get an error 10 "Duplicate Path" "Asynchronous I/O Operation In Progress".  So I would put the copy function in a for to retry a couple times and we no longer have this problem.  I never determined the cause, and didn't have time to debug it because a solution was found.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.