11-29-2024 08:34 AM - edited 11-29-2024 09:04 AM
Hi,
I execute Teststand sequences from my LabVIEW application.
When an error occures in my sequence, I have the runtime error popup displayed asking to break, abort, terminate, etc...
I would like to catch this event and the associated error to log it with my LabVIEW application but I cannot find the callback associated with this event.
I thought it would be the "ReportError" callback from Application Manager but it seems this one is not generated in this case?
I have also find the "DisplayCustomRuntimeError" callback which is called :
But I don't know to extract the associated error because it is not in the input parameters of this callback :
Thank you for your help.
Solved! Go to Solution.
11-29-2024 09:10 AM
I've never tried this myself so.... and I can't really read the screenshots attached due to their size / resolution...
The UI exmaples which ship with TestStand use the report error callback, so you might want to check, how it works for them. Maybe you can find a difference.
There is also a UiMessage being sent when an error occurs
If it's only for logging purpose, this might also help.
11-29-2024 10:07 AM
Thank you for your quick answer. On my side, when I click on the screenshots, it maximizes the image and it is in high resolution.
I tried to use the simple example UI of Teststand and when I run my sequence with error, the ReportError callback is not generated either.
I tried the UIMsg callback and indeed I can detect the runtime error but I don't know how to extract the error info from there?
11-30-2024 01:47 PM
The callback is given a SequenceContext (ctxt) parameter, and you should be able to use that to find the error information. Look at: RunState.Step.Result.Error.Msg
So you should be able to use the following pseudo code:
ctxt.AsPropertyObject().GetPropertyObject("RunState.Step.Result.Error.Msg",0);
12-02-2024 04:00 AM
Ok, I didn't find exactly how to do like you said but it inspired me to find a solution !
This is how I solved it :
12-03-2024 09:47 AM
Nice, I had totally forgotten about the SequenceContext.GetRunTimeErrorMessageEx(). Thanks for posting your solution.