LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to add errors to LabVIEW's error list?

I want to be able to define my own error codes so that my subVIs generate error clusters that can then be fed into the error handler and the user can get a message corresponding to an error description that I defined.

How can I add error codes and description to the list that the error handler uses? Is there an easier way than using the "[user-defined codes]" and "[user-defined descriptions]" of "General Error Handler CORE.vi"?

Also, can I get a list of the codes that are already used, so that I can use other codes?

Thanks,

Alejandro
0 Kudos
Message 1 of 3
(3,060 Views)
Alejandro,

In LabVIEW 7.0 and later, you should go to the Tools Menu and choose Advanced>>Edit Error Codes. This utility allows you to create an error file (filename should be *-errors.txt) that you define errors and descriptions in. The resultant file is XML based and should be placed in the LabVIEW\user.lib\errors folder.

The ranges 5000 - 9999 and -8000 to -8999 are reserved for users.

Regards,
Aaron
LabVIEW Champion, CLA, CPI
Message 2 of 3
(3,047 Views)
Yes, you can create an external xml text file with your own error codes and messages. To avoid codes that NI uses, use codes in the range of 5000 to 9999. In the on-line help, look up the topic called Defining Custom Error Codes in Text Files for an explanation of the format of the xml file. When you use this approach, all your VIs will share the same error codes and then you would also need to distribute the xml file along with the application.
Message 3 of 3
(3,043 Views)