LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error text is not shown for Custom Errors

Hi,

I created custom error with Error Code Editor

Choose_Another_one_0-1659510360537.png

 

I used Error ring to inject that error ir my code.

Now, if leave error cluster not connected to any error indicator, then when i run the code, i get standard Labview Error pop-up, and text "My custom error occured" is visible under "Possible reasons"

Choose_Another_one_1-1659510492756.png

But if wire error indicator to error ring and run the code, then text "My custom error occured" is not visible at all

Choose_Another_one_2-1659510622720.png

Is this expected behavior? 

My actual target here is to create custom error file to the labview modul that will be used in TestStand, so i would like to return custom error description (text with brief explanation of the error) back to the TestStand. with given example, text "My custom error occured" is not returned to the TestStand.

Clearly, i am missing some information how to use error descriptions correctly.

0 Kudos
Message 1 of 7
(1,454 Views)

In the first case the standard error handling from LabVIEW will call the General Error Handler.vi, because you have enabled in the calling VI the option VI Properties->Execution->Enable Automatic Error Handling.

 

In the second case you simply wire an error code value to the error cluster and that's it. Instead use the General Error Handler.vi or the wrapper around it called Simple Error Handler.vi and wire your error code 5000 to the error code input terminal. Add an error location string if you want to the according error source input terminal. Right click on the "type of dialog" input and select Create Constant. Set this to "no dialog" and now you get your custom error message in the error cluster.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 7
(1,423 Views)

Another fun little tidbit.  Involving the explain error from the error out wired to an error ring will return the appropriate description from the error.txt file.

 

There is a disconnect between the error ring and error files.  It is better to throw the existing custom error if you have defined it than to simply use the error ring.  Error Rings should be used sparingly and have a better use case when expanded to add format specifiers (unsupported by error.txt descriptions) e.g. error 7: "File %s not found"


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 7
(1,415 Views)

Thanks for your answer. This make sense. However, i have this code:

Choose_Another_one_0-1659532424227.png

 

When i set error ring to some native Labview error code and call this VI from TestStand, i get standard teststand error dialog with error text:

Choose_Another_one_1-1659532518743.png

However, when i set error ring to 5100 and run VI in teststand, i do  not get error text:

Choose_Another_one_2-1659532598114.png

 

It seems that TestStand treats the errors differently...

 

0 Kudos
Message 4 of 7
(1,409 Views)

As I recall, ( and do check the help file on creating custom error files) *_error.txt can exist in two locations.  It is possible that TestStand only knows about one of them.  Where is your custom error text file?


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 7
(1,403 Views)

its C:\Program Files (x86)\National Instruments\LabVIEW 2021\user.lib\errors. This is default location when you try to use Edit error codes utility. 

Also, file name ends with -errors.txt as recomended by Labview.

 

Actually, never realised that TestStand uses other source than information in error cluster to explain the errors. Always thought that all info that is shown by the error handler is received from the VI error out 

0 Kudos
Message 6 of 7
(1,398 Views)

Try moving it to the other location where LabVIEW hides the shipping errors and toolkit errors rather than user errors.  if that works, drop a quarter on the TS side and explain what user errors are and why TS should look there.

 

I never do remember if it's *-errors.txt or *_errors.txt. I do remember the * becomes part of the source string when explained and if the code is in multiple files that all explanations are added. As in...

 

"Error 5000

LabVIEW

User defined error

 

************(*****

MyErrors

My Custom error"


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 7
(1,386 Views)