Creating Process Model Plug-ins

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

Process model plug-in sequence files must meet the following conditions:

  • You must save the model plug-in sequence files in one of the following directories:
    • <TestStand>\Components\Models\ModelPlugins (built-in plug-ins)
    • <TestStand Public>\Components\Models\ModelPlugins (custom plug-ins)
    • <TestStand>\Components\Models\ModelPlugins\Addons (built-in add-ons)
    • <TestStand Public>\Components\Models\ModelPlugins\Addons (custom add-ons)
  • You must include a file global variable named ModelPluginComponentDescription of type NI_ModelPluginComponentDescription
  • You must select Model from the Type ring control on the Advanced tab of the Sequence File Properties dialog box for the model plug-in sequence file
  • You must include one or more plug-in entry point sequences in the model plug-in sequence file

TestStand uses the location of the sequence file and the existence of the ModelPluginComponentDescription file global variable to identify plug-ins. Because TestStand loads and inspects all the sequence files within the top level of the ModelPlugins directories and of the ModelPlugins\Addons directories, you must place any supporting sequence files that a model plug-in calls in a different directory.

National Instruments recommends that you use a unique prefix that includes your company name, such as Acme_ReportGenerator.seq, for custom plug-ins you create. TestStand uses the root filename as a <plug-in name> prefix for plug-in data types it creates, such as Acme_ReportGeneratorOptions. National Instruments also recommends that you store any support files the plug-in requires in a subdirectory with the same name as the plug-in file, such as ModelPlugins\Acme_ReportGenerator\Acme_ReportGenerator_Support.seq.

Complete the following steps to generate a new plug-in that you can modify.

  1. Select Configure»Result Processing to launch the Result Processing dialog box.
  2. Enable the Show More Options option and click the Advanced button to launch the Advanced Result Processing Settings dialog box.
  3. Click the Create New Process Model Plug-in button.
  4. Use a unique filename that includes your company name as a prefix for the plug-in, such as Acme_ReportGenerator.seq.
  5. Click Save to create and load the new plug-in sequence file.

    TestStand creates and adds the following new data types to the file. The data types are empty containers in which you can add plug-in-specific properties.
    • <plug-in name>Options
    • <plug-in name>AdditionalOptions
    • <plug-in name>RuntimeVariables
    • <plug-in name>PerSocketRuntimeVariables
  6. Close the open dialog boxes to view and edit the plug-in you just created.
  7. Use an expression in the FileGlobals.ModelPluginComponentDescription.Default.Base.DisplayNameExpression subproperty to display a string that describes the plug-in or its output in the Output column of the Result Processing dialog box. Use an expression in the FileGlobals.ModelPluginComponentDescription.DisplayNameExpression subproperty to display a string that identifies the plug-in in the plug-in insertion menu of the Result Processing dialog box.
  8. If you do not want plug-in end users to configure any plug-in-specific options, delete the Configure Standard Options and the Configure Additional Options sequences from the plug-in sequence file.
  9. Complete the following steps if you want plug-in end users to configure plug-in-specific options.
    • Add each option you want plug-in end users to configure as a subproperty of the <plug-in name>Options data type.
    • Create a modal dialog box, in which plug-in end users can view and edit the plug-in options. Refer to the <TestStand Public>\Examples\Fundamentals\Launching a Modal Dialog directory for examples of creating modal dialog boxes.
      • Export a function, method, or VI to launch the dialog box and call the function, method, or VI in the Configure Standard Options sequence.
      • You can pass each <plug-in name>Options subproperty into and out of the dialog box entry point. You can also pass the plug-in or the <plug-in name>Options subproperty as a property object and use the TestStand PropertyObject class methods to access the <plug-in name>Options subproperties within the dialog box code.
      • Pass the value of the RunState.Engine property to the dialog box code so you can call the Engine.NotifyStartOfModalDialogEx and Engine.NotifyEndOfModalDialog methods to enforce the modality of the dialog box.
      • If you are using the LabWindows/CVI Adapter or the LabVIEW Adapter to create the dialog box, ensure that you configure the step that launches the dialog box to always run in the run-time engine to avoid creating out-of-process modal windows, which can result in hangs.

        Note Note  When you call a LabVIEW VI that creates ActiveX references, such as calling the ApplicationMgr.GetEngine method directly, you configure the VI to use the same as caller execution system, and you call the VI from a sequence running in a single-threaded apartment thread, LabVIEW might seem to hang with 100% processor use. Change the Preferred Execution System option in LabVIEW to a value other than same as caller to work around this issue.
    • Optionally, you can use an expression in the FileGlobals.ModelPluginComponentDescription.Default.Base.OptionsDescriptionExpression subproperty to display information in the Options column of the Result Processing dialog box. For example, the NI_ReportGenerator plug-in uses this expression to display the report format in the Options column of the Result Processing dialog box.
  10. Consider whether you want the plug-in to always process information in a new thread other than the model execution thread, never process information in a new thread, or allow end users to specify whether to process information in a new thread. Typically, you allow processing in a new thread if the plug-in requires a significant amount of processing time and the plug-in can process the information while processing information from other instances of the plug-in and testing subsequent UUTs.

    According to your decision, set the following subproperties of FileGlobals.ModelPluginComponentDescription.Default:
  11. Save and close the plug-in when you have completed the customizations.
  12. Complete the following steps to add an instance of the new plug-in to a result processing configuration. TestStand stores the configuration in <TestStand Application Data>\Cfg\ModelPlugins\ResultProcessing.cfg. The process model loads this configuration file at run time to determine the plug-ins to invoke.
    1. Select Configure»Result Processing to launch the Result Processing dialog box.
    2. Click the Add button and select the plug-in name from the drop-down list.
  13. When you have completed customizing and testing the plug-in, you can delete the entry point sequences the plug-in does not require. If you later determine that you need an entry point sequence you deleted, complete the following steps to add the entry point to the plug-in:
    1. Unload the plug-in.
    2. Restart the user interface or other TestStand-based application.
    3. Generate a new plug-in with the same filename to a different location.
    4. Copy the entry point sequences you need from the new plug-in to the original plug-in.
    5. Delete the new plug-in.

      Alternatively, instead of deleting unused entry points, you can rename them so the model does not call them. For example, you can add a [Reserved] prefix the name of each unused entry point.

When you insert a plug-in instance, the modal dialog box inserts a copy of the FileGlobals.ModelPluginComponentDescription.Default property values to use for that instance of the plug-in. Any changes you make to these values in the plug-in sequence file apply only to subsequent instances of the plug-in you create.

See Also

Dynamically Set the Client Sequence File (Example)

Model Plug-in Data and Data Types


Not Helpful