Solution
Error 5 is generated when a LabVIEW File I/O VI is unable to open a reference to an existing file because another process already has an open reference to the file. This can occur if LabVIEW, another application, or your operating system has already opened the file for writing. Follow the steps below to resolve the issue:
- If you have another application that is reserving your file (like backup applications, NI DataFinder, or desktop search applications):
- Add error handling to retry the file operation when Error 5 occurs.
- Disable the offending application.
- If you are trying to perform multiple, simultaneous file writes on the same file within your LabVIEW VI either:
- Serialize the operation.
- Use an asynchronous File I/O API (like the TDMS Advanced API)
- If using the Application Builder:
- Try cleaning the build directory and then rebuilding your application. In the project, right-click on Build Specification»Clean.
- Try changing the location of the build directory.