NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid terminate-Uimessage in parallel sequence when terminating?

Hello,

i am executing a parallel sequence as described by in this thread:
https://forums.ni.com/t5/NI-TestStand/How-to-stop-a-thread-quot-New-execution-thread-quot-from-main/...

 

This is working great.

The only problem is that the statement "Locals.SpawnedExec.AsExecution.Terminate()" which terminates the parallel thread creates a terminate-UImessage.

This is catched by my OPUI and then sets the main-testplan to terminated. Also if the testplan run completly to the end and all steps are passed.

 

How can i find out from which thread the Uimsg is coming. There is a parameter "object" which contains 1000s of sub-parameters. I think somewhere in there it can be found...

 

Thanks

0 Kudos
Message 1 of 7
(2,630 Views)

Hello OnlyOne,

 

an idea is to check the display name of the thread to make an algorithm, who sent the message.

 

test.PNG

 

 

 

best regards
Alexander
Message 2 of 7
(2,602 Views)

Thx.

What is the content of Displayname?

 

0 Kudos
Message 3 of 7
(2,600 Views)

Hello OnlyOne,

 

that should be from interest

DisplayName of Execution

best regards
Alexander
0 Kudos
Message 4 of 7
(2,598 Views)

Ok, DisplayName would be a solution if the sequence name is always the same.

But i dont want to hardcode the sequencename of the parallelthread into my OPUI.

Perhaps there is a way to disable the sending of uiMessages?

0 Kudos
Message 5 of 7
(2,594 Views)

Hello OnlyOne,

i do not find a way to disable the uimessage sent.

best regards
Alexander
0 Kudos
Message 6 of 7
(2,581 Views)

When you get UI messages in your OI, if you only care about the ones for the main execution, you can look at the Execution property of the UIMessage and compare to see if it is the same as the main execution you launched from your OI, and ignore it if it is not. Your OI is probably already (or can add code to do this if needed) storing a reference to the execution it launched. You can compare the execution Id properties of the executions to see if they are the same execution.

 

Hope this helps,

-Doug

0 Kudos
Message 7 of 7
(2,558 Views)