To download NI software, including the products shown below, visit ni.com/downloads.
This example shows how you can expand the functionality to the TestStand report generation plugin which ships with TestStand. This particular example adds the ability to specify that report files should be marked as read-only after being generated. The plug-in has the following modifications:
If you are not familiar with the TestStand process model plug-in architecture, refer to this overview before using this example:
TestStand Help: Process Model Plug-in Architecture
This example shows how you can add functionality to the existing report generation plug-in with minimal changes to the existing code. This allows you to more easily migrate the changes to future versions of the plug-in.
Typically, new features you add to the report generation plug-in will require that you expose settings to the user to configure the additional functionality. This example needs to expose an option so the user can set whether reports should be marked as read only. You can use the Model Plugin - Configure Additional Options callback to expose a secondary options dialog for these additional settings. Using this approach decouples the additional settings from the default report options.
To create the Model Plugin - Configure Additional Options callback:
Parameters.ModelPlugin.PluginSpecific.AdditionalOptions. This example adds a new property "MakeReportReadOnly".:
Parameters.ModelPlugin.PluginSpecific.AdditionalOptions.SetValBoolean("MakeReportReadOnly", PropOption_SetOnlyIfDoesNotExist, 0)
Once you have provided a way for the user to configure the new options, you can access these settings in any plug-in sequence. In this example, a new sequence "SetReadOnly" is added which sets a specified file to be read-only. This sequence is called from the Model Plugin - UUT Done and Model Plugin - Batch Done callbacks after the report file is saved.
Adding to the NI Report Generator - TS2016.zip
TestStand 2016 or Compatible
Visual Studio 2015 or Compatible (Optional, for viewing source code of additional options dialog)
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.