Update Client Sequence File Global Variables from TestStand Process Model

Updated Jun 2, 2023

Environment

Software

  • TestStand

In my process model, I collect and store information in a client sequence file global variable, which I want to update at every UUT loop. When I access the variable using RunState.SequenceFile.Data.FileGlobalDefaults.myVariable property, it returns the variable's default value.

How can I access and update the value of a client sequence file global variable?
 

The RunState.SequenceFile.Data.FileGlobalDefaults.myVariable property contains the default value of the sequence file global variable myVariable, rather than the run-time value. To access the run-time version of your sequence file global variables, you must call the TestStand API using two ActiveX Action Steps:
  1. Call the GetFileGlobals  method of the Execution object class with the client sequence file as a parameter. The output will be a property object containing a reference to the run-time client sequence file global variables. Configure the step as outlined in the chart and image below:
     
    Automation Server: NI TestStand API (your current version #)
    Object Reference: RunState.Execution
    Object Class: Execution
    Action: Call Method
    Method: GetFileGlobals
    Return Value: FileGlobals
    sequencefileParam: RunState.SequenceFile
​​
 
  1. Use the new property object reference to set the value of the client sequence file global variable, myVariable. Call the SetVal<datatype> method, where <datatype> is the data type of the variable, and use the lookupString parameter to specify which client sequence file global variable to update. Configure the step as outlined in the chart and image below, where updatedValue is the new value of of myVariable.
     
    Automation Server: TestStand API (your current version #)
    Object Reference: FileGlobals
    Object Class: PropertyObject
    Action: Call Method
    Method: SetVal<datatype>
    lookupString: "myVariable"
    options: 0
    newValue: updatedValue