Chin Posted August 4, 2011 Report Share Posted August 4, 2011 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? Quote Link to comment
dannyt Posted August 4, 2011 Report Share Posted August 4, 2011 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 Quote Link to comment
Bjarne Joergensen Posted August 20, 2013 Report Share Posted August 20, 2013 Hi Is there a way in LabVIEW to check if a file is open already? regards Bjarne Quote Link to comment
Kas Posted August 20, 2013 Report Share Posted August 20, 2013 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 Quote Link to comment
crossrulz Posted August 20, 2013 Report Share Posted August 20, 2013 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. Quote Link to comment
Bjarne Joergensen Posted August 20, 2013 Report Share Posted August 20, 2013 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 Quote Link to comment
hooovahh Posted August 20, 2013 Report Share Posted August 20, 2013 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.