NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Termination as precondition to a step

Hi,
 
I would like to perform some steps in the Cleanup section only when the the program is Terminated.
 
Is there a variable in the context that indicates this status?
 
Thanks
Rafi
0 Kudos
Message 1 of 7
(3,594 Views)
Hi,
 
You could try performing TS API call Execution.GetStates(run_state, term_state), this returns two parameters. The second will equal 2 if you are terminating.
 
Or you could look at the Status in the Locals.ResultList[x]. If its the first thing you do in the cleanup, then it will be that last recorded value in ResultList.
 
Hope this helps
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 7
(3,584 Views)
[Edit] Misread question and gave incorrect answer......

Message Edited by Norbert B on 06-17-2008 09:22 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 7
(3,572 Views)

Dear Ray,

Your knowledge has always been overwhelming to me...

1.  I was successful in the first option (active x with Execution.GetStates).   I was quite happy to succeed with that as I've never used an API function before.  Are there more examples of using API functions for various tasks?

2.  The second part gave me 'Done' for status and not Terminate.  I used as the first step in the cleanup a popup message and in the body of the message I wrote  'Locals.ResutlList[0].Status.

Was I supposed to see "Terminate" instead of Done?

What is the meaning of [0]?

In which cases there is more than [0] in the arry?

 

Thanks

Rafi

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

Hi again,

It seems that the Termination brings back the value 3 and not 2 as you indicated.

Is this correct or I'm not looking at the right place?

Thanks

Rafi

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

Hi Rafi,

The reason you are seeing the value 3 is because you must be running interactivily. In the Help for GetStates give the different values for termination states.

So you would need to look for either 2 or 3.

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 6 of 7
(3,544 Views)

Hi Rafi,

"Your knowledge has always been overwhelming to me..." it's nothing special, just been doing a long time Smiley Sad

[0] means the first element of an 1D array.

Was I supposed to see "Terminate" instead of Done? If you are seeing done then you have not got the correct element of the ResultList array.

If you have terminated a step in the Main, which was the 4th recorded step and you had not recorded steps in the Setup,  then if the first step in the Cleanup, you would have to check ResultsList[3] to see the Status of Terminated.

Hope this helps.

 

Regards
Ray Farmer
0 Kudos
Message 7 of 7
(3,541 Views)