Model Callbacks in the Batch Process Model

The Batch process model includes the following Model callbacks, which you can override with client sequence files:

  • MainSequence—The Test UUTs - Test Socket Entry Point and Single Pass - Test Socket Entry Point sequences call the MainSequence callback, which is empty in the process model file. The client sequence file must contain a MainSequence callback that performs the tests on a UUT.
  • PreMainSequence—The Test UUTs and Single Pass sequences call the PreMainSequence callback before the MainSequence executes. The PreMainSequence callback in the process model file is empty. Override this in the client file to perform an action before any code in the MainSequence executes.
  • PostMainSequence—The Test UUTs and Single Pass sequences call the PostMainSequence callback after the MainSequence executes. The PostMainSequence callback in the process model file is empty. Override this in the client file to perform an action after all code in the MainSequence executes but before any Model Plug-ins execute.
  • PreUUT—The test socket executions call the PreUUT callback, which calls the DoPreUUT sequence, which is empty in the process model file. When you override the PreUUT callback with a client sequence file to obtain the serial number for the UUT, override the PreBatch callback also. The PreBatch callback launches a dialog box to obtain the serial numbers for all the UUTs in the batch.
  • PostUUT—The test socket executions call the Post UUT callback, which calls the DoPostUUT sequence, which is empty in the process model file. When you override the PostUUT callback with a client sequence file to display the result status for a UUT, override the PostBatch callback also. The PostBatch callback launches a dialog box to show the result status for all the UUTs in the batch.
  • PreUUTLoop—Before the UUT loop begins, the Test UUTs — Test Socket Entry Point sequence calls the PreUUTLoop callback, which is empty in the process model file.
  • PostUUTLoop—After the UUT loop terminates, the Test UUTs — Test Socket Entry Point sequence calls the PostUUTLoop callback, which is empty in the process model file.
  • ReportOptions—The process model Execution entry point sequence calls the Model Plugins – Begin sequence in ModelSupport.seq. Model Plugins – Begin calls the Model Plugin – Initialize sequence in each plug-in instance. Model Plugin – Initialize in the NI_ReportGenerator.seq plug-in calls the ReportOptions callback so the client sequence file can modify the report options. The ReportOptions callback in the process model file is empty. This callback serves the same purpose as the more general ModelPluginOptions callback, but the report generator plug-in calls ReportOptions only for report generator plug-in instances and passes to it only reporting options.
  • DatabaseOptions—The process model Execution entry point sequence calls the Model Plugins – Begin sequence in ModelSupport.seq. Model Plugins – Begin calls the Model Plugin – Initialize sequence in each plug-in instance. Model Plugin – Initialize in the NI_DatabaseLogger.seq plug-in calls the DatabaseOptions callback so the client sequence file can modify the database options. The DatabaseOptions callback in the process model file is empty. This callback serves the same purpose as the more general ModelPluginOptions callback, but the database logging plug-in calls DatabaseOptions only for database logging plug-in instances and passes to it only database options.
  • ModelOptions—The process model Execution entry point sequence calls the Initialize Execution entry point sequence in ModelSupport.seq. After reading the test station model options from disk, the sequence calls the ModelOptions callback so the client sequence file can modify the model options. The ModelOptions callback in the process model file is empty. The client sequence file can change the value of the ModelPluginConfigurationToLoad parameter to specify the name of the model plug-in configuration to load from each model plug-in configuration file. The default value for the ModelPluginConfigurationToLoad parameter is an empty string, which directs the process model to load the active configuration from each model plug-in configuration file.
  • TestReport—The Test UUTs and Single Pass Execution entry points call the Model Plugins – UUT Done sequence in ModelSupport.seq. ModelSupport.seq calls the Model Plugin – UUT Done entry point for each configured result processor. The NI_ReportGenerator.seq plug-in calls the TestReport callback from the UUT Done entry point to generate the contents of the report for one UUT. The report generator does not call the TestReport callback when you enable the On-The-Fly Reporting option in the Report Options dialog box. The report plug-in defines a report for a single UUT as a header, an entry for each step result, and a footer. When you do not want to override the entire TestReport callback, you can override the ModifyReportHeader, ModifyReportEntry, and ModifyReportFooter callbacks instead to customize the report. You can override ModifyReportEntry only when you select the Sequence option in the Report Options dialog box and the report format is HTML or ASCII text.

    The TestReport callback returns the report using the Report string parameter or the ReportSection object reference parameter. TestStand 2010 SP1 or earlier process models use the Report parameter. TestStand 2012 or later process models use the ReportSection parameter. If you override the TestReport callback, you must support the parameter that corresponds to the version of the process models you use. To support both methods of returning a report, use the ReportSection parameter to determine which parameter the invoking process model requires. If the ReportSection reference uses Nothing as the value, you must return the report as a string in the Report parameter. If the ReportSection reference uses a value other than Nothing, you must return the report by updating the ReportSection parameter.

    For HTML and ASCII text report formats, depending on the settings in the Report Options dialog box, the TestReport callback determines whether TestStand uses sequences or a DLL to build the report body. Select the Sequence option to more easily modify the reports TestStand generates. Select the DLL option to generate reports more efficiently.

    When you select the Sequence option in the Report Options dialog box, the TestReport callback calls the AddReportBody sequence in reportgen_html.seq or reportgen_txt.seq to build the report body. The report generator plug-in uses a series of sequences with steps that recursively process the result list for the execution. When you select the DLL option in the Report Options dialog box, the TestReport callback calls a function in modelsupport2.dll to build the report body. You can access the project and source code for the DLL built in LabWindows/CVI from the <TestStand>\Components\Models\TestStandModels directory.

    For XML reports, TestReport callback calls the AddReportBody sequence in reportgen_xml.seq. The report generator plug-in calls the PropertyObject.GetXML method. For ATML 2 reports, the TestReport callback calls the GetATMLReport sequence in reportgen_atml.seq. The report generator plug-in in calls the Get_Atml_Report function in ATMLSupport.dll in the LabWindows/CVI project. For ATML 5 reports, the TestReport callback calls the AddReportBody sequence in reportgen_atml.seq. The report generator plug-in calls the Get_Atml_ReportSection_For_Body function in ATMLSupport.dll. You can access the project and source code for the DLL built in LabWindows/CVI from the <TestStand>\Components\Models\TestStandModels\ATML directory.

  • ModifyReportHeader—The TestReport callback calls the ModifyReportHeader callback so the client sequence file can modify the report header. The ModifyReportHeader callback receives parameters for the UUT information, the tentative report header text, and the report options. The ModifyReportHeader callback in the process model file is empty.
  • ModifyReportEntry—The TestReport callback uses subsequences to call the ModifyReportEntry callback for each result in the result list for the UUT so the client sequence file can modify the entry point for each step result. The ModifyReportEntry callback receives parameters for an entry from the result list, the UUT information, the tentative report entry text, the report options, and a number that indicates the call stack depth at the time the step executed. TestStand does not call ModifyReportEntry callbacks when you enabled the DLL option in the Report Options dialog box. Instead, you must modify modelsupport2.dll, located in the <TestStand>\Components\Models\TestStandModels directory, to modify how step results appear in the report. The ModifyReportEntry callback in the process model file is empty.
  • ModifyReportFooter—The TestReport callback calls the ModifyReportFooter callback so the client sequence file can modify the report footer. The ModifyReportFooter callback receives parameters for the UUT information, the tentative report footer text, and the report options. The ModifyReportFooter callback in the process model file is empty.
  • GetReportFilePath—The report generator process model plug-in calls the GetReportFilePath callback so the client sequence file can inspect the report file path.
  • LogToDatabase—Execution entry points call the LogToDatabase callback to populate a database with the results for one UUT. Execution entry points do not call the LogToDatabase callback when you enabled the Use On-The-Fly Logging option on the Logging Options tab of the Database Options dialog box. The LogToDatabase callback receives parameters for the UUT information, the result list for the UUT, and the database options.
  • ProcessSetup—The Test UUTs and Single Pass Execution entry points call the ProcessSetup callback before creating the test socket executions so the client sequence file can execute any setup steps that must run only once during the execution of the process model. Only the controlling execution calls ProcessSetup. The test socket executions do not call the ProcessSetup callback.
  • ProcessCleanup—The Test UUTs and Single Pass Execution entry points call the ProcessCleanup callback from the Cleanup step group so the client sequence file can execute any cleanup steps that must run only once during the execution of the process model. Only the controlling execution calls ProcessCleanup. The test socket executions do not call the ProcessCleanup callback.
  • ModelPluginOptions—Execution entry points call the Model Plugins – Begin sequence in ModelSupport.seq, which calls the Initialize Model Plugins sequence. Initialize Model Plugins calls the ModelPluginOptions callback for each model plug-in instance so the client file can modify the model plug-in settings.
  • ModelPluginConfiguration—Execution entry points call the Model Plugins – Begin sequence in ModelSupport.seq, which calls the Initialize Model Plugins sequence. Initialize Model Plugins calls the ModelPluginConfiguration callback so the client file can inspect or modify the set of model plug-ins the process model calls at run time.

The following callback sequences are unique to the Batch process model:

  • PreBatch—Launches a dialog box to obtain the batch and UUT serial numbers.
  • PostBatch—Displays a pass, fail, error, or terminated banner and batch and UUT reports for each test socket.
  • PreBatchLoop—Before looping on a batch of UUTs, the process model calls the PreBatchLoop callback, which is empty in the process model file. Use the PreBatchLoop callback to perform an action before testing the batch.
  • BatchReport—After looping on a batch of UUTs, the process model calls the PostBatchLoop callback, which is empty in the process model file. Use the PostBatchLoop callback to perform an action after testing all batches of UUTs.
  • ModifyBatchReportHeader—The Test UUTs and Single Pass Execution entry points call the report generator process model plug-in, which calls the BatchReport callback to generate the contents of the batch report for the UUTs that ran in the last batch. The Batch process model defines a batch report for a single group of UUTs as a header, an entry for each UUT result, and a footer. When you do not want to override the entire BatchReport callback, you can override the ModifyBatchReportHeader, ModifyBatchReportEntry, and ModifyBatchReportFooter callbacks instead to customize the batch report.
  • ModifyBatchReportHeader—The BatchReport callback calls the ModifyBatchReportHeader callback so the client sequence file can modify the batch report header. The ModifyBatchReportHeader callback receives parameters for the batch serial number, the tentative report header text, and the report options. The ModifyBatchReportHeader callback in the process model file is empty.
  • ModifyBatchReportEntry—The BatchReport callback uses subsequences to call the ModifyBatchReportEntry callback for each test socket so the client sequence file can modify the entry for each UUT result for each test socket. The ModifyBatchReportEntry callback receives parameters for the test socket data, the batch serial number, the tentative report entry text, and the report options. The ModifyBatchReportEntry callback in the process model file is empty.
  • ModifyBatchReportFooter—The BatchReport callback calls the ModifyBatchReportFooter callback so the client sequence file can modify the batch report footer. The ModifyBatchReportFooter callback receives parameters for the tentative report footer text and the report options. The ModifyBatchReportFooter callback in the process model file is empty.