NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get terminate status and number of all steps executed in Teststand

Solved!
Go to solution

Hi ! Could someone teach me,pls?

 

1. Query:

    How can i get the sequence status of Terminated?

 

    Aim:

    I want to Terminate  sequence execution while something wrong happened, then i want to aquire the Terminated Staus.

 

    My action:

    i add a ActiveX API step into a callbacks file called SequenceFilePostStepFailure , but i can't get the value well 

 

2. Query:

    How can i get the number of all steps executed in Cleanup of one sequence?

 

    Aim:

    I  want  to get the number of all steps executed include Setup, Main and Cleanup, after i terminating the sequence

 

    My action:

    call a variable from RunState.NumStepsExecuted . but it only the number of steps executed from Setup or Main or Cleanup , not all.

 

 

Thank you in advance!

0 Kudos
Message 1 of 9
(6,199 Views)
Solution
Accepted by topic author AllanXu

Consider the attachment for termination information.

 

For the steps do you want to know how many are recording results or just the total number of steps for that execution? Also, do you need to know how many steps in subsequences were executed?

 

Hope this helps,

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 9
(6,187 Views)

@AllanXu wrote:

Hi ! Could someone teach me,pls?

 

1. Query:

    How can i get the sequence status of Terminated?

 

    Aim:

    I want to Terminate  sequence execution while something wrong happened, then i want to aquire the Terminated Staus.

 

    My action:

    i add a ActiveX API step into a callbacks file called SequenceFilePostStepFailure , but i can't get the value well 

 

2. Query:

    How can i get the number of all steps executed in Cleanup of one sequence?

 

    Aim:

    I  want  to get the number of all steps executed include Setup, Main and Cleanup, after i terminating the sequence

 

    My action:

    call a variable from RunState.NumStepsExecuted . but it only the number of steps executed from Setup or Main or Cleanup , not all.

 

 

Thank you in advance!


1. Execution.GetStates() - look at the termination status. Termination is an execution specific state, not a thread state.

 

2. You could use a PostStep callback and do the counting yourself (e.g. in a file global or station global variable), however there is a performance cost to poststep callbacks so it depends on whether or not it's worth the performance cost in your particular use case.

 

Hope this helps,

-Doug

0 Kudos
Message 3 of 9
(6,186 Views)

Dear Jigg,

         Thank you for your attachment, it is very help for me!

          

          For the steps, i want to know total step number executed in only mainsequence and in both mainsequence and subsequence.

 

          By the way, How many are recording results? How can i do it? 

 

          thank you in advance! 

0 Kudos
Message 4 of 9
(6,173 Views)

Dear Jigg,

         Thank you for your attachment, it is very help for me!

          

          For the steps, i want to know total step number executed in only mainsequence and in both mainsequence and subsequence.

 

          By the way, How many are recording results? How can i do it? 

 

          thank you in advance!

0 Kudos
Message 5 of 9
(6,172 Views)

I implemented Doug's idea into this sequence file.  But be careful-

 

This will take a performance hit as Doug mentions.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 9
(6,158 Views)

Dear Jigg and Doug,

         Thank you ! It is exciting!

         But how can i get the number of excuted steps only in main segment or setup segment or cleanup segment in a sequence?

 

         Thank you in advance!

0 Kudos
Message 7 of 9
(6,146 Views)

Same as in the example but use:

RunState.CallingStep.StepGroup == StepGroup_Main

RunState.CallingStep.StepGroup == StepGroup_Cleanup

RunState.CallingStep.StepGroup == StepGroup_Setup

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 8 of 9
(6,130 Views)

Thank you ! it works!

 

0 Kudos
Message 9 of 9
(6,112 Views)