The default result processing model plug-ins perform controller and test socket synchronization when you execute a sequence using the Batch process model.

For example, the default Report result processing model plug-in, located at <TestStand>\Components\Models\ModelPlugins\NI_ReportGenerator.seq, performs controller and test socket synchronization to force test sockets to serially write individual UUT reports to a file on disk after the controller writes the Batch report to a file on disk.

Use the following information to help you implement controller and test socket synchronization in a custom model plug-in.

Enabling Controller and Test Socket Synchronization for a Model Plug-in

The NI_ModelPlugin data type in a process model plug-in sequence file contains a Base.RequiresBatchControllerAndSocketSynchronization Boolean subproperty that enables or disables batch controller and test socket synchronization functionality for the plug-in. To use controller and test socket synchronization in a plug-in, ensure that this property is True.

Note This property is True by default when you use the Result Processing dialog box to create a plug-in. If you do not require controller and socket synchronization, setting this property to False can slightly improve performance when executing the Batch process model.

Implementing Batch Controller and Test Socket Synchronization in a Model Plug-in Entry Point

Model plug-ins use the Locals.ControllerAndSocketSynchronizationManager object reference to implement controller and test socket synchronization between the Model Plugin – Batch Start and Model Plugin – UUT Start entry points and between the Model Plugin – Batch Done and Model Plugin – UUT Done entry points. Model plug-ins must synchronize between these entry points because these entry points execute asynchronously to the corresponding UUT entry point counterparts. The Batch process model synchronizes all other Batch/UUT model plug-in entry point pairs.

Note
  • Implementing controller and test socket synchronization in any model plug-in entry point other than the Model Plugin – Batch Start, Model Plugin – UUT Start, Model Plugin – UUT Done, and Model Plugin – Batch Done entry points might cause TestStand to hang when you execute sequences using the Batch process model.
  • When you use the Result Processing dialog box to create a plug-in, the Locals.ControllerAndSocketSynchronizationManager object reference already exists. If you manually create a plug-in, you must correctly implement the Locals.ControllerAndSocketSynchronizationManager object reference. Refer to the Model Plugin – UUT Done and Model Plugin – Batch Done entry points of the default Report result processing model plug-in for an example of using the Locals.ControllerAndSocketSynchronizationManager object reference in an existing plug-in.

You must conditionally execute all calls to the SyncWithController method in the Model Plugin – UUT Start and Model Plugin – UUT Done entry points only when you execute sequences in the Batch process model. When a Model Plugin – UUT Start or Model Plugin – UUT Done entry point contains a call to the SyncWithController method, you can use the following precondition on the calling step to specify that the entry point executes the call only when the Batch process model calls the entry point:

Parameters.ModelData.ModelType == "Batch"

Refer to the Model Plugin – UUT Start and Model Plugin – UUT Done entry points of the default Report result processing model plug-in for an example of specifying this precondition in an existing plug-in entry point.