Admin Production ni-theme
Current Publication

Using File Paths in LabWindows/CVI

LabWindows/CVI

Using File Paths in LabWindows/CVI

The maximum length for paths supported by LabWindows/CVI is MAX_PATHNAME_LEN. Due to restrictions imposed by the operating system, this character limit may vary depending on the project and string encoding.

If you specify the encoding of your project as UTF-8, the CVI_UTF8 compiler define is added to the Predefined Macros. The CVI_UTF8 macro automatically resolves select constants affected by encoding to the UTF-8 version of the constant. The UTF-8 version of the constant is suffixed with UTF8 while the ANSI version is suffixed with ANSI. For example, MAX_PATHNAME_LEN resolves to MAX_PATHNAME_LEN_UTF8 or MAX_PATHNAME_LEN_ANSI.

ANSI Projects

When you declare string buffers for paths with MAX_PATHNAME_LEN_ANSI you will not exceed the operating system character limit.

UTF-8 Projects

When you declare string buffers for paths with MAX_PATHNAME_LEN_UTF8 you can exceed the operating system character limit and cause an error. Several LabWindows/CVI functions return error code -84 when input string paths are too long (e.g. LoadPanel, DisplayImageFile). Call the IsUTF8PathLengthValid function to confirm the file path is within the operating system character limit.

Note  MAX_DIRNAME_LEN and MAX_FILENAME_LEN have similar character limit considerations as MAX_PATHNAME_LEN.