Solution
When you pass data to a subsequence in TestStand, each parameter can be configured to pass by reference or by value. Understanding the difference is important for controlling data flow, preventing unintended side effects, and designing reusable sequences.
This article explains how both methods work and when to choose one over the other.
Pass‑by‑Reference (Default Behavior)
By default, TestStand passes parameters by reference. This means the parameter in the subsequence points directly to the variable in the calling sequence.
How it works:
- No copy of the data is created.
- The subsequence reads and **writes directly** to the caller’s variable.
- Any change made inside the subsequence is reflected immediately in the calling sequence.
This behavior is similar to passing a pointer in C or wiring a control/indicator reference in LabVIEW.
Example:
In the Computer Mortherboard Test Example . The MainSequence passes Locals.CPUFail to the CPUFail parameter of the CPUTest subsequence:
- The CPUFail parameter is a reference to Locals.CPUFail.
- If the subsequence sets Parameters.CPUFail = True, the caller’s local variable becomes True as well.

When to use pass‑by‑reference:
- The subsequence must update the caller’s variable (e.g., status flags, measurement results).
- You want to avoid copying large data (e.g., arrays, container types).
- You are intentionally modifying shared state.
Pass‑by‑Value
You can configure a parameter to be passed by value by right‑clicking the parameter and disabling Pass By Reference.

How it works:
- The caller’s value is copied into the parameter.
- The subsequence operates on its own local copy.
- Changes made in the subsequence do not affect the original variable.
Pass‑by‑value preserves data isolation and reduces unintended interactions.
When to use pass‑by‑value:
- The subsequence should not modify the caller’s variables.
- You want predictable, isolated behavior.
- You want to enforce a “read‑only” data flow pattern.
- You’re calling utility‑style sequences that should be independent of global or shared state.