National Instruments recommends that you use the General Error Handler VI to define custom error codes in the range of 5000 through 9999. However, you also can define custom error codes in the same range by creating an XML-based text file in the labview\user.lib\errors directory and adding the error codes and messages to the text file. Use this method if you want to use the same custom error codes with several VIs or if you want to distribute custom error codes with an application or shared library. If you want to distribute the custom error codes with an application or shared library, you must distribute the error code text files.
You must name the text file xxx-errors.txt, where xxx is a name that you supply. The xxx-errors.txt file must use the following syntax exactly, including capitalization, spacing, and so on. You supply the italic text:
<?XML Version="1.0">
<nidocument>
<nicomment>
This file describes custom errors for my VI.
</nicomment>
<nierror code="5000">
Memory full.
Add more memory.
</nierror>
<nierror code="5001">
Invalid name. Enter a new name.
</nierror>
</nidocument>
You can add your own comment between the <nicomment></nicomment> tags. In each <nierror> tag, you must define the error code number. Define the error code message between the <nierror></nierror> tags.
Select Tools»Advanced»Edit Error Codes to create or modify an error code text file.
Changes to error code text files take effect the next time you start LabVIEW.