02-02-2022 12:11 AM
I am using parallel model with 2 socket and have EStop subsequence in a new thread. When the DIO I/P signal is high, EStop subsequence calls the Execution.Terminate() method and I need to displays the Dialog showing Estop enabled message.
1. How can I set this thread such that only one Dialog is displayed? Currently the dialog launches for every socket.
The dialog step I am refereeing to is named "EStop high" in Cleanup section of EStop subsequence.
I also tried Synchronization settings on EStop subsequence call to use "One thread only (first thread executes step, remaining threads skips)" but it had no impact, maybe it is only for batch process model and I am using parallel model?
2. I get an error when using RunState.Caller.Execution.TerminateAll() method. Is this not a valid method?
Thanks!
02-03-2022 04:49 AM
Hi,
For question 1 :
RunState.TestSockets.MyIndex==1 ( socket with value =1 will run this)
Use this in the precondition of the Estop sub sequence which is called in a seperate thread.Only one instance will run now.
For 2 - RunState.Engine.TerminateAll() should work to stop all the sockets.
Ravi
02-03-2022 11:22 AM
Thanks Ravi,
Both your suggestions provide answer to my original questions
Just a followup question....
On using RunState.Engine.TerminateAll(), it does not loop back to provide UUT Info dialog. And with using RunState.Caller.Execution.Terminate() only terminates the socket that launched EStop subsequence.
How can all sockets be terminated and loop back to UUT Info? I am using custom UUT Info dialog (one LV Vi for each socket).
In the end the requirement is Run EStop thread asynchronously -> On detecting DIO high signal send terminate to all sockets and display one EStop message dialog -> Once DIO signal is low then proceed to test next UUT.
Currently the way I am able to get this to work is by using StationGlobals so that only one EStop message dialog is displayed. Wondering if there is any other way to implement this and avoid use of StationGlobals?
Thanks!
02-03-2022 01:35 PM
Hi,
"On using RunState.Engine.TerminateAll(), it does not loop back to provide UUT Info dialog"
When the sequence is terminated then the execution jumps to the cleanup section.After executing cleanup it stops.
From your requirement i assume that you dont want to use terminate.
You just need that all the sockets skip the current testing and go to next UUT testing.
You can try the following approach :
Estop sequence :
Loop ( until some condition to exit)
if DIO== High then set fileglobal.skiptest = True and show a popup to end user.
else fileglobals.skiptest = false
delay x
end loop
Test Sequence :
All steps in the sequence will have pre condition as ( fileglobals.skiptest==False) i.e. it will execute only if this flag is false else skip.
Ravi