NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Flow control question

Hi!

 

One of my sequences in TS has about 20 steps that all give out a cluster containing potential errors. I'd like another VI to run after each step to check what type of error it is and give a warning/abort.

 

How can I do this without adding 20 copies of the same VI, but using some flow control instead?

 

Thanks

0 Kudos
Message 1 of 7
(3,075 Views)

Just add the SequenceFilePostStepRuntimeError callback and you can capture any error and run whatever code you'd like.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 7
(3,074 Views)

Take a look at the example for what jigg is referring to in the Examples\Callbacks\PostStepRuntimeErrorCallback folder.

CTA, CLA, MTFBWY
0 Kudos
Message 3 of 7
(3,065 Views)

Thanks! This is exactly what I've been looking for.

 

I'm having some trouble understanding it though. The example uses pre-expression, but I'd like to use the step.result.numeric.

 

I have several different types of errors that I would like to check for, and then run the SequenceFilePostStepRunTimeError if any are found. How would you do this by checking the output of VIs that have been executed?

0 Kudos
Message 4 of 7
(3,044 Views)

I found another example that I could just copy from into my own sequence. It now runs the error handler every time a sequence fails.

 

I would like it to run if there are other errors than just the numeric limit test. My VI contains GPIB and file open VIs that I also would like to run the error sequence if fail. Is it possible to do this if you use the error cluster from say, the VISA function, as an output? How can you check many errors of this type, a numeric result and a string result when a step finishes and then pass/fail the step?

 

Thanks!

0 Kudos
Message 5 of 7
(3,041 Views)

If an error occurs the step's status is set to Error rather than Passed or Failed and then the SequenceFilePostStepRuntimeError callback will execute. You can access the step's information by looking at Parameters.Step inside of that callback and then execute whatever code you would like based on the step and error information inside that step variable.

CTA, CLA, MTFBWY
0 Kudos
Message 6 of 7
(3,031 Views)
If you want to look at each step after it executes then use the SequenceFilePostStep callback. In there you can do any analysis of special properties.
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 7
(3,024 Views)