Creating Custom Rules

TestStand 2017 Help

Edition Date: November 2017

Part Number: 370052W-01

»View Product Info

Download Help (Windows Only)
NI TestStand 2014 Help
NI TestStand 2014 SP1 Help
TestStand 2016 Help
TestStand 2016 SP1 Help
TestStand 2017 Help

You can customize the TestStand Sequence Analyzer by creating custom rules and analysis modules.

A rule defines a single task to perform during analysis, such as ensuring that the prototype of each code module is up to date or ensuring that each expression specified evaluates to the correct type and does not include any syntax errors.

An analysis module is a VI, a class method in a .NET assembly, or a function in a DLL the sequence analyzer invokes to implement analyzer rules. Analysis modules perform the checks the rules specify and generate messages which the sequence analyzer stores in the analyzer project.

Analysis module specifications specify the analysis modules to call. Analysis module specifications also specify when the sequence analyzer calls the analysis module, the types of objects to which the analysis modules apply, and whether to call the analysis module when transitioning from one type of object to another.

The sequence analyzer stores custom rules and analysis module specifications in <TestStand Application Data>\Cfg\CustomRules.tsarules. Refer to the Analyzer Examples for more information about custom rules and analysis modules.

Complete the following steps to create a custom analyzer rule and a corresponding analysis module.

  1. If you are using the sequence analyzer in the TestStand Sequence Editor, click the Sequence Analyzer Options button on the Sequence Analyzer toolbar or select Debug»Sequence Analyzer»Sequence Analyzer Options to launch the Sequence Analyzer Options dialog box.

    Note Note  The sequence editor requires an enabled ConfigApp user privilege to launch the Configure Available Rules dialog box. The built-in TestStand Developer and Administrator user groups grant this privilege by default.

    If you are using the stand-alone sequence analyzer application, click the Available Rules button in the Sequence Analyzer Options dialog box or select Edit»Available Rules to launch the Configure Sequence Analyzer Available Rules dialog box.

  2. Complete the following steps to create or edit a custom rule in the Configure Sequence Analyzer Available Rules dialog box.

    Note Note  The set of rules available on a computer is the same for all analyzer projects you open on that computer. When you use the Configure Sequence Analyzer Available Rules dialog box to add a new rule to the computer and then open an older project, the sequence analyzer automatically adds the new rule to the project. Similarly, the sequence analyzer removes from projects any rules that you removed using the Configure Sequence Analyzer Available Rules dialog box.
    1. Select the Rules tab and expand the CustomRules.tsarules section.
    2. Click New Rule button to the right of the <Insert New Rule> Rule ID to launch the Edit Rule dialog box.
    3. On the General tab of the Edit Rule dialog box, enter or select values for the Rule ID, Category, Severity, Name, and Description controls. You can also use the Rules tab of the Configure Sequence Analyzer Available Rules dialog box to edit the general settings of custom rules.
      Note Note  Select a Rule ID that is unique to the rules on your computer and the rules on any other computers to which you might deploy the rule. National Instruments recommends that you add your company name as a prefix to the Rule ID to prevent potential conflicts with other custom Rule IDs.
    4. (Optional) On the Advanced tab of the Edit Rule dialog box, enter or select values for the Resource String Category and Configuration Option controls to specify options for localization and configuration. You can add custom rule settings by using the Edit Rule dialog box to launch a standard sequence analyzer dialog box in which users configure custom rules or by creating a custom rule configuration module to launch a dialog box you create in which users configure custom rules.
    5. Click OK to save the changes and close the Edit Rule dialog box.
  3. Use LabVIEW, LabWindows/CVI, Microsoft Visual C#, or Microsoft Visual C++ to create an analysis module that implements one or more rules.

  4. Complete the following steps to add a custom analysis module to the CustomRules.tsarules section on the Analysis Modules tab of the Configure Sequence Analyzer Available Rules dialog box.

    1. Select the Analysis Modules tab and expand the CustomRules.tsarules section.
    2. Click the New Analysis Module button to the right of the <Insert New Analysis Module> analysis module to launch the Edit Analysis Module dialog box.
    3. In the Edit Analysis Module dialog box, enter the path to the module, a VI, .NET assembly, or DLL and select the kinds of objects, object types, and transition settings for the custom analysis module.
    4. If you specify a VI as the analysis module and you want to debug the VI, disable the Run VI in LabVIEW Run-Time Engine option. You must also enable the Development System option in the Select or Type Which LabVIEW Server to Use section of the LabVIEW Adapter Configuration dialog box.
    5. Click OK to save the changes and close the Edit Analysis Module dialog box.

You can deploy custom rules and analysis modules for use in analysis projects or to analyze individual files on other computers on which TestStand is installed.


See Also

Adding Custom Rule Settings

Advanced tab

Analysis Modules tab

Configure Sequence Analyzer Available Rules dialog box

Creating Analysis Modules

Creating Custom Rule Configuration Modules

Debugging Analysis Modules and Rule Configuration Modules

Deploying Custom Rules and Analysis Modules

Edit Analysis Module dialog box

Edit Rule dialog box

General tab

LabVIEW Adapter Configuration dialog box

Rules tab

Sequence Analyzer Options dialog box

Sequence Analyzer toolbar

TestStand Sequence Analyzer Application

WAS THIS ARTICLE HELPFUL?

Not Helpful