Formatting and I/O Library Error Codes
The Formatting and I/O Library functions return negative error codes when they detect errors. However, you must keep in mind an important fact. When you enable debugging, the LabWindows/CVI environment keeps track of the sizes of strings and arrays. If LabWindows/CVI detects any attempt to access a string or array beyond its boundary, the environment halts the program and informs you. It is important to remember that this feature works only when you execute source code in the LabWindows/CVI development environment. The string functions can write beyond the end of a string or array without detection, resulting in corruption of memory. Therefore, you must use the Formatting and I/O functions on strings and arrays with caution. The following table lists the error codes, defined constants, and error messages associated with functions in the LabWindows/CVI Formatting and I/O Library.
In addition to the return codes, the GetFmtErrNdx and NumFmtdBytes functions return information about how the last scanning and formatting function executed. The GetFmtIOError function returns a code that contains specific error information about the last Formatting and I/O Library function that performed file I/O. The GetFmtIOErrorString function converts this code into an error string.
Error codes are defined in the cvi\include\formatio.h file.
Code | Defined Constant | Error Message |
---|---|---|
0 | FmtIONoErr | No error |
1 | FmtIONoFileErr | File not found |
2 | FmtIOGenErr | General I/O failure |
3 | FmtIOBadHandleErr | Bad file handle |
4 | FmtIOInsuffMemErr | Insufficient memory |
5 | FmtIOFileExistsErr | File exists |
6 | FmtIOAccessErr | Access denied |
7 | FmtIOInvalArgErr | Invalid argument |
8 | FmtIOMaxFilesErr | Too many files open |
9 | FmtIODiskFullErr | Disk is full |
10 | FmtIONameTooLongErr | File name too long |
11 | FmtIOStrTooLongErr | String too long for representation |
12 | FmtIOConversionErr | Encoding conversion error |