11-20-2017 09:58 AM
Hello,
i am executing a parallel sequence as described by ~jiggawax~ 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
11-21-2017 05:53 AM
Hello OnlyOne,
an idea is to check the display name of the thread to make an algorithm, who sent the message.
11-21-2017 05:57 AM
Thx.
What is the content of Displayname?
11-21-2017 06:00 AM
11-21-2017 06:14 AM
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?
11-22-2017 04:19 AM
11-27-2017 12:39 PM - edited 11-27-2017 12:40 PM
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