To download NI software, including the products shown below, visit ni.com/downloads.
This VI shows how to define a specific error in your code and when this error appears while running the code, you can clear it from the error cluster.
While the best error practice is to handle all errors, there may be times (such as user defined errors) where the user may want to simply clear an error. LabVIEW has a built in function called "Clear Errors" that will clear any error in an error cluster. In order to selectively clear an error with this VI, you need to check the error cluster first for your specific error, and then use the "Clear Errors" function.
The attached example creates a new SubVI that allows a user to input a specific error (or array of errors) and then clear the error cluster when the appropriate error code is seen in the error cluster. The SubVI is implemented as a polymorphic VI and is a good example of dynamically adapting to terminal inputs as well. The input can either be a single numeric error code or an array of numeric error codes to check and clear. This example performs the following:
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
Additional Information or References
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.