NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to interrupt current serial number execution and go for next serial number in parallel model

Solved!
Go to solution

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?

--
Ajay MV


0 Kudos
Message 1 of 13
(608 Views)
  • You should pass the sequence context to your monitoring thread VI. 
  • Start your sequence with Run Continuous entry point
  • Then when the monitor sees the flag, use API to terminate the sequence (sequenceContext.Execution.Terminate)
  • The sequence will perform Clean up group
  • The process model will loop and prompt if you want to run the next UUT

 

0 Kudos
Message 2 of 13
(575 Views)

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.

 

Ajay_MV_0-1708081290476.png

 

--
Ajay MV


Download All
0 Kudos
Message 3 of 13
(561 Views)

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

Message 4 of 13
(547 Views)

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

0 Kudos
Message 5 of 13
(540 Views)

@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?

--
Ajay MV


0 Kudos
Message 6 of 13
(532 Views)

@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. 

0 Kudos
Message 7 of 13
(519 Views)

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.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 8 of 13
(459 Views)

@~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.

Ajay_MV_0-1708237783724.png

 

--
Ajay MV


0 Kudos
Message 9 of 13
(453 Views)

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,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 10 of 13
(437 Views)