NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable a test socket during execution (Batch Mode)

Solved!
Go to solution

     We are running a Batch Model with Batch Synchronization.   I am wondering if it is at all possible to totally disable one or more of the test socket during execution.  I know that the opening screen allows you to choose which sockets are active, but in the event that something goes astray like the RS-485 communication is non-responsive, I would like to disable one or more at anytime during the test.  Thank you in advance for any ideas you come up with.

 

Regards

 

Scott

 

Environment: TestStand 2010

0 Kudos
Message 1 of 4
(4,266 Views)

I am not aware of how to stop a socket which is already running and facing an error midway.

 

But this setting will ensure that the socket is disabled for the next runs.

 

1) Override the preBatch callback.

2) Call this statement in the current executing thread to stop the socket from next run. ( precondition = on error)

RunState.Caller.Parameters.ModelData.TestSockets[RunState.TestSockets.MyIndex].Disabled=True

 

Message 2 of 4
(4,252 Views)

You don't necessarily need to disable it, just have that testsocket goto cleanup (which is normal behavior for an execution that has a runtime error) and finish it's execution. The execution for that socket will then no longer be considered part of the batch and the remaining testsockets will continue executing. Disabling is more for when you don't plan on using that socket for awhile. Which, if that's the case, you might also want to disable it in PreBatch when PreBatch is next called.

 

Hope this helps,

-Doug

Message 3 of 4
(4,246 Views)
Solution
Accepted by topic author Scott754

Greetings SunRS and dug9000,

 

     Thank you for both of your replies.  I appreciate the information that you have given and I will create another post if I need more information.

 

Regards,

 

Scott

0 Kudos
Message 4 of 4
(4,228 Views)