Example Code

Disable the SequenceFileLoad Callback in a Sequence File

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Teststand

Code and Documents

Attachment

Overview

This example can be used to recover a sequence file which has an infinite loop in the SequenceFileLoad callback.  The example uses the TestStand API to load the sequence without running the callback and modifies the callback name to disable it. 

 

Description

In some cases, you may inadvertently introduce an infinite loop or other condition in a SequenceFileLoad callback.  Because this callback automatically executes when you open the sequence file, this can cause you to be unable to open the sequence file to edit the problematic code.

 

The attached sequence file allows you to browse to a sequence file, and uses the TestStand Engine API to open the file without running the SequenceFileLoad callback using the GetSeqFile_DoNotRunLoadCallback option:

 

 

Locals.SeqFileRef = RunState.Engine.getsequenceFileEx(Locals.SeqPath[0],GetSeqFile_DoNotRunLoadCallback,ConflictHandler_Prompt)

 

 

The example then renames the callback, so you can open the file in the sequence editor and fix the SequenceFileLoad sequence.

 

Hardware and Software Requirements

TestStand 2014 or Compatible 

 

 

Steps to Implement or Execute Code

  1. Open the attached sequence.
  2. Execute the sequence using Execute » Run Mainsequence
  3. Select a file to modify when prompted which has a SequenceFileLoad callback specified.
  4. Once the sequence completes, open the targeted sequence, and verify that the callback has been renamed to SequenceFileLoad _, and does not execute.

  

 
Regards,

Shawn S. | NIC
Instrument Driver/IVI PSE
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.