NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to know the execution terminated Interactive from Execution object

Solved!
Go to solution

Hi,

Does any one know how to get whether execution is terminated Interactive from the Execution object.

 

Coding is doing in c#.net

 

Regards

Ceaser

0 Kudos
Message 1 of 7
(4,352 Views)

Ceaser,

 

you should use the UI message EndExecution in order to determine if an execution is finished.

 

hope this helps,

Norbert

 

 [Edit] Please note that this UI message is also sent for the frontend sequences (login/logout) so maybe you have to filter this in your UI

Message Edited by Norbert B on 11-25-2009 08:46 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 7
(4,350 Views)

Thanks for the reply,

I have handled EndExecution but it is always give the state as ExecTermState_Terminating even if the execution ended as ExecTermState_TerminatingInteractive 

Is there anything i am missing in this logic?

 

Regards

Ceaser

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

Ceaser,

 

i currently have no UI capable to capture arbitrary UI messages and to create interactive executions, so i cannot check if this is a desired behavior.

I just want to ask:

Are you really creating an interactive execution (execution without process model, possibly created by selecting several steps and select "Run Selected Steps" in the context menu)?

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 7
(4,323 Views)

Thanks for the reply,

 

I am creating interactive execution as you explained.

 

step 1 putt a break on a step

step 2 from context menu select Run selected step.

step 3 Execution start and halt, due to break, now terminate execution.

 

Also if the execution ended normally, checks the error if any using

 

if (ExtnViewMgr.Execution.ResultObject.GetValBoolean("Error.Occurred", 0x00) == true)
{
            status = "Error - " + ExtnViewMgr.Execution.ResultObject.GetValString("Error.Msg", 0x00);
}
else
{
            status = ExtnViewMgr.Execution.ResultStatus;
}

 

Can we find like this if the exxecution is terminated?

 

Regards,

Ceaser

0 Kudos
Message 5 of 7
(4,320 Views)

Ah, ok, now we are getting closer.....

So you want to know if an interactive execution has been terminated.

Now here is the trick:

All information you'll need is sent automatically by TestStand using UI messages. Here the list of messages you need:

1.) UIMsg_TerminatingInteractiveExecution–(Value: 15) TestStand sends this message just before terminating an interactive execution. The interactive execution does not actually terminate until the UIMessage is released.

This message will inform you about two things in parallel: a) it is an interactive execution (otherwise it would be the UIMsg_TerminatingExecution–(Value: 5)) and b) the termination process is currently taking place.

2.) UIMsg_EndExecution–(Value: 😎 TestStand sends this message after an execution completes. The user interface must update its display accordingly.

This message is used in order to know that the execution is really finished regardless of its result. 

 

Only if you receive both messages in the stated order (1=>2) you know that the interactive execution has been terminated and is not running anymore.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 7
(4,314 Views)
Solution
Accepted by topic author ceaser

Thanks for the reply Norbert

 

I have found a property 

ExtnViewMgr.Execution.InInteractiveMode

which is true if terminated interactively else false.

 

Regards,

Ceaser

0 Kudos
Message 7 of 7
(4,235 Views)