NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

error handling with .NET adapter

Is there a way to handle excepetions or errors when using .NET assemblies in TestStand?  For example, I use .NET Serial Port Class to Open a Com port such as pictured below.  If there is an exception, or error when opening the com port, how can I capture that in Teststand such as with Step.Result.Error, or with some other strategy that I can capture the error and examine it in Teststand, rather than popping up a modal exception window?

 

SerialPort3.JPG

0 Kudos
Message 1 of 3
(3,938 Views)

Add the engine callback "ProcessModelPostStepRuntimeError" to your processmodel. It will be called after every runtime error and you can have your error handling there.

0 Kudos
Message 2 of 3
(3,926 Views)

Just check the "Ignore Run-Time Errors" checkbox on the Run Options of the step. Then have a following step look at the Step.Result.Status property and/or the properties under Step.Result.Error.

 

Hope this helps,

-Doug

0 Kudos
Message 3 of 3
(3,917 Views)