, or Generic File I/O Error
, is a common error that is generated when a file operation in LabVIEW or the user's code fails to execute.
Try the following steps to troubleshoot this error:
- Confirm that all the files developed and used are locally saved and can be accessed by LabVIEW (i.e. VI's produced are not in the Program Files folder in the C drive)
- Check to make sure there is enough available space on the disk.
- Ensure that you aren't at the file limit for your system. File systems have limitations on the maximum number of files per folder (regardless of how much disk space is available).
- FAT16 - 512 files per folder.
- FAT32 - 65,534 files per folder.
- NTFS - 4,294,967,295 files per folder.
Periodically deleting, or moving files to a new folder will reduce the risk of exceeding the above limits.
- The number of files you can store in one folder also depends on the file name length:
- FAT32 allows 65,534 files, if the filename is smaller or equal eight characters (e.g. "12345678.txt").
- Filenames exceeding eight characters the long filename system applies. The filename "abcdefghijklm.txt" has 13 characters plus file extension and will use three entries. It will create one entry for a short version of the file name and two for the long file name, thus just 21,844 (65534/3 entries) files could be stored. For a fast estimation see this external calculator.
- Enable sharing on any folders accessed over the network.
- Make sure file paths or directories LabVIEW is accessing do not exceed the maximum length for system file paths.
- Remove or replace any control characters from string controls or constants that are used to designate a file path. See LabVIEW Error 1 or 6: Input Parameter is Invalid to learn more about this case.
- If you're trying to write to a TDMS file, trying to call TDMS Open with the Create operation using a file path for a file that already exists will produce Error 6. Instead, use the Open or Create operation if you may be calling TDMS Open on a file path for an existing file.
- When you are deleting a directory, either:
- Delete its contents and sub-folders, then the directory.
- Wire a True to the entire hierarchy input of the Delete function.
- In Linux, you need to open a pipe in Read Mode before trying to open it in Write Mode.
- On Linux Real Time targets (e.g. cRIO and sbRIO) ensure that the lvuser account has access permission to a drive, folder, or file. This especially important if you add external storage with a USB memory stick, or NI 9803. Use the chmod command to change permissions.
- You can run chmod 777 to give all permissions to all users; for Real Time targets it is suggested to use chmod 755 for security reasons. The below image gives more context for what the chmod permissions achieve.
- First Number - For the user, Second Number - For the group, Third Number - For others.
- Anti-Virus can sometimes lock files that have recently been created. Try adding a Wait (ms) block set at 100 ms before calling the close function. Also, you can try disabling Anti-Virus to see if that affects the issue.
- This error can also be caused by a corrupt executable file. Please try and open a backup or a different version of the file.