Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
4 ratings:
 3.75 out of 5     Rate this Document

How do I Access the Properties and Variables of a Higher Level Sequence?

Primary Software: TestStand
Primary Software Version: 4.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I have a main sequence with set properties and variables, but they are not recognized by a subsequence I am calling.  How can I access local variables or step properties of a top level sequence (a caller sequence) from a subsequence (a called sequence)?

Solution:
There are two methods of accessing these variables and properties in a subsequence:
  • (Recommended) Create parameters in your subsequence, then pass by reference the local variable or property that you want to access. You can accomplish this by following these steps:

    1. Create the parameter in your subsequence
    2. Right-click the parameter, and verify that the Pass by Reference option is checked.
    3. In the main sequence, click the Sequence Call step and select the Modules tab
    4. A red exclamation mark icon should appear, indicating that the new parameter is not addressed in the module.  Clicking the icon will generate an entry for the new parameter.
    5. In the Value cell of the new parameter entry, insert the variable or property to be passed.
    6. When the subsequence is called by the main sequence, the parameter value will now reflect the value of the specified property or local.

  • Access the local variable or step properties directly by using a statement step. In this case, you should use the property path RunState.Caller.Locals.[targetlocal] (for local variables in the step that called the subsequence) or RunState.Caller.Step.[targetproperty] (for properties of the step that called the subsequence).


Related Links:
KnowledgeBase 2LGAJ26E: Getting the Name of Any TestStand Property Programmatically in
TestStand

Developer Zone Example: Storing Step Names of a Sequence in a Local Variable


Attachments:





Report Date: 08/29/2001
Last Updated: 01/05/2009
Document ID: 2CSE1DVW

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit