NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Terminate Using ProcessModelPostStepFailure within batch model

How can you terminate execution using the ProcessModelPostStepFailure callback.  It works in a sequential model, but the same API call to terminate using runstate.exection does not.
0 Kudos
Message 1 of 3
(2,827 Views)
Hey trussel,
 
I got it to work by doing the following-
 
1- Open a new blank sequence file
2- Open the SequentialModel.seq file by double clicking on the link at the bottom of the sequence editor
3- Click on Edit at the top of the sequence editor and go to <b>Sequence File Callbacks...</b>
4- Click on the ProcessModelPostStepFailure step and click Add
5- Click on the Edit button on the dialog box
6- Add an ActiveX action step
7- Right click on the new step and go to <b>Specify Module</b>
8- Set the settings as the following-
     Object Reference = Runstate.Execution
      Automation Server = NI TestStand API
     Object Class = Execution
     Action = Call Method
     Method = Terminate
9- Click OK
10- Go to the new sequence file in Step 1 and add a pass/fail test
11- Right click on the pass/fail test and select <b>Edit Limits</b>
12- Change the lower limit to 5 and select OK.  (this will make the test fail since it is comparing with 0)
13- Run the sequence by going to execute>>Single Pass (don't save the files)
 
You should see that the execution terminated correctly.
 
I hope this helps and is what you are looking for.  Let me know if there's any other info. regarding this issue.
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 3
(2,806 Views)
Thanks for your reply Sam,
 
I think your example is within the sequential model.  If you use the same callback in the batch model the program will not terminate.  What I'm doing is creating a custom process model that will loop a test on a DUT.  If the DUT fails, then I want to terminate the batch test.  If it passes, then I want the loop again.  We will be using this for HALT testing in a temp/vib chamber. 
 
I have a work around for it though.  In the sequential process model, the termination status is checked and will post a dialog prompt to terminate the test.  The batch model does not have this.  So what I did was evalute the terminate status in the batch model, and then I put a post action to exit out of the batch loop. Not sure if this is the preferred method, but it seems to do the job. 
0 Kudos
Message 3 of 3
(2,801 Views)