NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to check when the step group reaches Cleanup?

Hello All,
             I have a problem wherein I have to know when the TestStand test execution control reaches the Cleanup step group. During execution of sequential process model, is there any event available in .NET to let the user know when the execution control reaches the Cleanup part.

Eg: The execution starts at Setup --> Main --> Cleanup (when the control reaches the cleanup stepgroup), I need to know the control has reached cleanup from .NET programmatically.

Thanks
Arun
0 Kudos
Message 1 of 4
(3,460 Views)
Hi Arun,

Solution 1: Use "Locals.ResultList[StepIndex].TS.StepGroup" to find out, which StepGroup the running Step has;
Solution 2: Use "RunState.NextStep.StepGroup" to to find out, which StepGroup the next Step has.

The StepGroup has the following constants:
  • StepGroup_Cleanup–(Value: 2)
  • StepGroup_Main–(Value: 1)
  • StepGroup_Setup–(Value: 0)

Regards
MY
0 Kudos
Message 2 of 4
(3,436 Views)
As far as I know there is no notification you can get automatically from teststand when the first cleanup step is executed. Also, I'm not sure that would make sense in cases in which you have subsequences because subsequences go to cleanup when their main is done running even though the main for the calling sequence might not be done yet. Therefore there isn't really a system level state change of Setup->Main->Cleanup, rather it is entirely per sequence. If you only have one sequence then what you want to do is trivial, just put a .NET step as the first step in your cleanup that does whatever you want to do, or post a UIMessage from the first step in your cleanup if you are wanting to custimize a UI that way.

Here's an illustration of why there is no system wide (per execution) state change of Setup->Main->Cleanup:

Say we have sequence1 which calls sequence2

Say sequence1 looks like this:

Setup (empty)

Main
Step1 (Sequence call to sequence 2)
Step2

Cleanup
Step3
Step4

Say sequence2 looks like this:

Setup(empty)

Main
StepA
StepB

Cleanup
StepC

The order of execution of steps would then be:

Step1 (main)
StepA (main)
StepB (main)
StepC (cleanup)
Step2 (main)
Step3 (cleanup)
Step4 (cleanup)

Hope this helps,

-Doug
0 Kudos
Message 3 of 4
(3,430 Views)
MY-

This method will only work when result collecting is enabled.  Instead, you should just use the Step property to get information about the currently executing step.  You should use Step.StepGroup instead.

0 Kudos
Message 4 of 4
(3,426 Views)