02-15-2024 07:26 AM
TestStand seqence runs in parallel model. There is a parallel monitoring thread VI that monitors a few digital signals and takes action on a TestStand sequence execution.
When the external digital signal flags, I need to stop or interrupt the current UUT (serial) execution, do cleanups and go back to PreUUT for the next serial number. Essentially, I have to jump back to PreUUT when this signal flags. How could this be achieved with TestStand APIs with this parallel monitoring thread?
Solved! Go to Solution.
02-15-2024 06:28 PM
02-16-2024 05:10 AM
I tried to put that in a simple test sequence and one parallel loop (attached here). On flag button push in parallel loop VI, it terminates the root sequence context in the parallel model. I see the serial number entry dialog gets disappeared on pushing flag button. Please note, that I instantiate the monitoring loop in the process setup callback, each socket will get its own SequenceContext after sockets are instantiated.
A workaround idea would be to maintain an FGV (global) of SequenceContext for each socket and terminate them, but I know it's a bad idea as the sequence context updates on each step execution in TestStand.
I thought of getting SequenceContexts using threads. So I tried getting the threads via executions as shown in API Containment document (pic below). But I couldn't find Executions(nr.2) object under Engine(nr.1). I can see ApplicationMgr.Executions but not under Engine.Executions.
02-16-2024 09:38 AM
Hi,
ApplicationMgr.Executions is the correct way to get the list of executions.
You can also have each execution register its reference in Engine.TemporaryGlobals and clear it when it is done. You can register for references using a model plugin or callbacks.
Regards,
Anand Jain
NI
02-16-2024 11:52 AM
Hi,
You async VI which detects an issue can set a flag in station global.
All your sub sequences precondition should be this flag.
So the moment this flag is on the current sub sequence will complete and no other sub sequence will run.It will go to cleanup and next UUT
Ensure this flag is reset at the start.
Ofcourse this will need changing your client sequence.
Ravi
02-16-2024 01:40 PM
@Anand_Jain wrote:
Hi,
ApplicationMgr.Executions is the correct way to get the list of executions.
Is it possible to get ApplicationMgr.Executions via SequenceContext reference?
02-16-2024 09:22 PM
@Ajay_MV wrote:
I tried to put that in a simple test sequence and one parallel loop (attached here). On flag button push in parallel loop VI, it terminates the root sequence context in the parallel model.
Ok, you must have passed the Root sequence context, which is what caused that. In the Process Setup callback, each socket will have its own sequence context. Try passing "ThisContext" to your monitor. I can test it out on Monday.
There is another way to share variables between 2 applications using TestStand API but you would have to change your VI; try suggestion above first.
02-17-2024 10:02 PM
The attached shows how to get the application manager in TestStand. From there you can get executions like Anand suggested and then kill them off. There are other API calls you can look at.
02-18-2024 12:29 AM
@~jiggawax~ wrote:
The attached shows how to get the application manager in TestStand. From there you can get executions like Anand suggested and then kill them off. There are other API calls you can look at.
Hi jigg,
Thanks for that, but I'm getting an error on running the sequence. I guess, still I don't get the idea of obtaining the ApplicationMgr object from the current executing sequence.
02-18-2024 04:08 PM
OK, Yeah I should've checked first. I forgot you have to get the App Mgr from the engine. This example should be better.
Once you get the executions you can then get the threads and contexts and do what you need.
Cheers,