Example Code

Using the General Error Handler to Create User-Defined Error Codes using LabVIEW

Code and Documents

Attachment

Overview
This example VI demonstrates how to create custom error messages in LabVIEW.


Description
In LabVIEW you are able to create custom error codes using native APIs such as the General Error Handler.vi. In this example five custom error codes and relative messages are used to warn the user about possible failures that can happen in different sections of the program.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attached files to your computer
  2. Open the VI "User-Defined Error Codes LV2012 NI Verified.vi"
  3. Run the VI
  4. Select the error code from the enum control and press Display Error Code

 

Additional Information or References

VI Block Diagram

User-Defined Error Codes LV2012 NI Verified.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

John Passiak

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
carlos_camargo
Member
Member
on

Good example, thanks, I'll probably implement something using this information.  The loop though, has no delays, thus it will very quickly do nothing if "Display Error Code" is set to false.