NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional testing for runtime errors in Clean up

Hi all,

 

I have some code in CleanUp, which I don't want executed if a run time error has occurred in the Main sequence. It is possible to do this? I've noticed there's an option in the RTE window that pops up which allows the program to be terminated without running CleanUp, but I'd still like this to run if the test result is a pass/fail or if the sequence was terminated.

 

Appreciate any thoughts.

 

Thanks

Bruce

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

Hi,

 

You can do this by use of a pre-condition on the steps in you Clean-up. Have a Goto that will check, by use of AllOf, that an error has occurred in the main and if so jump the steps that you dont want to run.

 

Regards

Ray Farmer

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

Hi Ray

 

Thanks for your reply. I’m assuming this precondition in CleanUp would need to include a step error check for each statement in the main sequence? Is there any generic parameter I could test instead? I’m just wondering if it’s possible to avoid having to update this precondition, if the main sequence is modified.

 

Regards

Bruce
0 Kudos
Message 3 of 9
(4,636 Views)

Hi,

 

It probably depends if your Main Steps are set to run Clean-up if an error occurs. 

 

If it does, you could use RunState.PreviousStep and check whether this has an error condition.

 

or you could use RunState.SequenceError but I'm not sure when this is updated.

 

Regards

Ray Farmer

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

Hi Ray

 

I just tried on TS4.0 :RunState.SequenceError 

It is depending on your "Handle Error settings" 

It is updated on "Run Cleanup"

and nothing is  done on "Ignore"

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 9
(4,623 Views)

Hi Bruce

 

Try this Example,

 

It parse the Errors in Cleanup

Note: this is only working on steps with are recored to result

 

Juergen 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 6 of 9
(4,617 Views)

Thanks Ray.

 

Hi Juergen,

 

Any chance you could send that routine again in 3.5? Unfortunately, I'm haven't yet upgraded my TestStand.

 

Thanks & regards

Bruce

 

 

0 Kudos
Message 7 of 9
(4,584 Views)

Hi

 

Try this one

Note: I dont know if a for-loop is running in TS3.5 so just try it .

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 8 of 9
(4,578 Views)

Thanks Juergen, that's great.

 

Bruce

0 Kudos
Message 9 of 9
(4,547 Views)