NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I capture an exception ?

Hi

 

I have a sequence where I communicate with some hardware through an snmp adapter (ActiveX component).  If I perform an illegal snmp operation, then the adapter will throw an exception.

 

Is it possible to capture this exception from TestStand ?

 

As it is now my sequence file will just stop with a runtime error.

 

I use TestStand v.3.1

 

Regards

Claus

0 Kudos
Message 1 of 9
(4,954 Views)

Hi,

I think you need TS 3.5

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 9
(4,946 Views)

What feature of 3.5 are you thinking of?

Try setting Step Properties>>Run Options>>Ignore Run-Time Errors on the ActiveX step and then inspect the sub-properties of RunState.PreviousStep.Result.Error in the following step to determine if the exception occurred. This should work in 3.1.

 

 

0 Kudos
Message 3 of 9
(4,939 Views)
Hi James,
 
I thought 3.5 was able to trap for memory corruption etc
 
regards
Ray Farmer
 
Regards
Ray Farmer
0 Kudos
Message 4 of 9
(4,931 Views)
TestStand has alway caught exceptions in code modules. What 3.5 added was specific checks to determine if a code module has corrupted the memory for buffer parameters TestStand passes to it or if the code module has corrupted the stack.
 
While these are certainly not the only memory areas a code module can corrupt, checking these areas can provide an early diagnoses of certain common code module problems that would otherwise result in difficult to debug incorrect behaviour and/or crashes.
0 Kudos
Message 5 of 9
(4,926 Views)
Thanks for all your comments.
 
I'll go with the  "Ignore Run-Time Errors on the ActiveX step" way.. This seems to work quite fine..
 
Thanks for your help
 
Cheers
Claus
0 Kudos
Message 6 of 9
(4,903 Views)
Hi,
 
I am familiar with how to handle exception in JAVA/C++ languages ( catch...throw...finally ).
I use TestStand 3.5
 
The questions are:
 
1. Is it similiar to handling exception in OOP (Java/C++) or different???
2. How TestStand handles exceptions that can cause 'called DLL' (If i want for exampl catch all exceptions that were during
    execution of my 'called DLL')?
3. I can write code in a TestStand to specify in a custom way how to handle an exceptions or i have some other way?
4. What is the standard handeling of exceptions regards TestStand?
5. If you can show a small example of how TestStand it will be great.

Message Edited by Yuri_IL on 05-16-2006 03:03 AM

Thank you & Best Regards

*I use LabVIEW 2018 & TestStand 2021 versions
0 Kudos
Message 7 of 9
(4,781 Views)

I got the full answer from NI support, here it:

"

Exceptions thrown from external code modules will be stored in Step.Result.Error .  You can select in TestStand how you want it to handle the error by going to Configure>>Station Options>>Execution, and then setting the drop down for 'On Run-time Error' to the behavior you want.

You can program your own error handling by using the SequenceFilePostStepRuntimeError callback.  There is an example on how to use this callback in the example below.

C:\Program Files\National Instruments\TestStand 3.5\Examples\Callbacks\PostStepRuntimeErrorCallback

This sequence will allow the user to choose how to handle the error.  You can customize this sequence, or create your own, to handle exceptions how you desire.

"

Have a nice day!  🙂

 

Thank you & Best Regards

*I use LabVIEW 2018 & TestStand 2021 versions
Message 8 of 9
(4,751 Views)
Thanks Yuri, Your feedbck is appriciated and I will try it out.
 
Cheers
Claus
Message 9 of 9
(4,737 Views)