Hi everyone, I have a question dealing with Custom Error Handling.
I always use the Error In and Error Out clusters within my VIs. I have a VI that calls a .dll library using the Call Library Function Node and if the "Status" output parameter of the library function does not equal 0 this means the library function failed. The Error In and Error Out clusters will not interpret this an an error. I am trying to figure out how I can force the Status byte output into my error cluster so that no other code is run if the output parameter byte is anything other 0.
What is the most efficient way to do this?
Solved! Go to Solution.
Just use the Error Cluster From Error Code VI.
When using the "Error Cluster from Error Code.vi" how do you include a "Title" in the error message? Right now I get the following:
Error 5000 Occured
Also, since anything other that zero for error code will set the error cluster status to TRUE, can we use any error code fed in other than 0? I know the LabVIEW predefined error codes limit custom error codes to be in the range of:
The following ranges of error codes are reserved for you to define custom error messages:
Is it good coding practice to adhere to these error codes using the "Error Cluster From Error Code.vi"?
There is the Error Message input. Did you try doing anything with that?
Yes, you should use those ranges that NI has allocated for cutom error codes. The last thing you want is to use an error code an then LabVIEW finds the same error code and gives you a message that makes no sense for your error case. I dare you to look at error code 7 and see what happens when you have two peices of code that use the same error code.