Error Codes Editor

From LabVIEW Wiki
Jump to: navigation, search
Error Code Editor

The Error Code File Editor (Tools->Advanced->Edit Error Codes) provides a simple GUI for creating and editing a custom error XML files. These files are useful if the user requires custom error codes to apply to several applications, if the codes are used by several software engineers in a team, or if the codes are to be distributed with an application. Once custom error code files have been created and/or altered, LabVIEW must be restarted for the changes to take effect.

After creating the custom error XML file, place the file in the labview\user.lib\errors directory. This will make the custom error codes show Error Rings and when creating an instance of the error using the Error Cluster From Error Code function.

For example, the XML filename must be in the format *-errors.txt (where * is user definable), and the internal file structure must adhere to the following format:

<?XML Version="1.0">
This is a custom error code definition file for my application.
<nierror code="5000">
User Access Denied!
Contact the Security Department to gain clearance to perform this function.
<nierror code="5001">
User Unknown.
Contact the People Development Department.
<nierror code="5100">
Driver Unable to Contact Instrument Database.
Contact the Software Engineering Department Helpdesk.
<nierror code="5200">
Plug-In Module in R&D mode – not to be used in Production Environment.
Contact the New Product Development Group.

As can be seen, a file comment can be created within the <nicomment> tag space. Each custom error is defined as an <nierror> with it’s associated error code, and its error message is then placed inside the <nierror> tag space.