Monitor a Variable at Run‑Time in TestStand

Updated Feb 12, 2026

Reported In

Software

  • TestStand

Issue Details

  • I want to monitor the value of a variable during my test execution. I know I can add breakpoints and see the value in the Variables pane, or create an expression in the Watch View pane, but I don’t want to break my execution.
  • What are less intrusive ways to monitor variables in TestStand without message pop-ups or code modules?

Solution

his article shows three TestStand‑native ways to monitor a variable live during execution without creating external code modules:

 

  1. Manually add Watch Expressions
  2. Programmatically add/remove Watch Expressions
  3. Show live values in the UI status bar using UIMsg_ProgressText

 

 

Option 1 — Manually Add Watch Expressions

 

This option is best for quick debugging. Use the built‑in Watch View to observe variables in real time.

 

Steps

 

  1. Open your sequence in the Sequence Editor.
  2. Select Debug >> Breakpoints/Watches… >> Watch Expressions tab.
  3. Click Add, enter an expression such as FileGlobals.MyVar. The other settings are optional. Review the reference documentation at the end of this section for detailed information on each setting.

    Watch Expression Settings
  4. Click OK, then Done.
  5. Run the sequence and observe live updates in the Watch View since the beginning of the execution. No breakpoint needed.

    Watch View 

Tips

 

  • Add multiple watches for complex debugging scenarios.
  • Because Watches evaluate standard TestStand expressions, you can monitor more than simple variables — you can also observe calculated values, conditional expressions, and other logic in real time. This provides a powerful way to validate how an expression behaves during execution before adding it directly to your sequence.

 

References

 

 

 

Option 2 - Programmatically Add / Remove a Watch Expression

 

This option provides greater flexibility when you want a sequence to automatically create and remove a watch expression. You can place the Statement steps in the Setup and Cleanup groups of MainSequence, or inside Process Model Callbacks that run before and after MainSequence—such as ProcessSetup, PreUUT, PreMainSequence, PostMainSequence, PostUUT, and ProcessCleanup. By choosing where these statements execute, you control exactly how long the watch expression remains active.

 

Create Watch Expression (Statement Step):

// Create a Teporary Global Variable that won't persist after you close TestStand.
RunState.Engine.TemporaryGlobals.NewSubProperty("WatchExp", PropValType_Reference, False, "", PropOption_DoNothingIfExists),
// Insert a new WhatExpression object in the WatchExpressions list and store it in the Temp Global.
RunState.Engine.TemporaryGlobals.WatchExp = RunState.Engine.GetWatchExpressions().Insert(Nothing, RunState.SequenceFile, True),
// Update the Expression
RunState.Engine.TemporaryGlobals.WatchExp.AsWatchExpression.Expression = "FileGlobals.MyVar"

 

Remove Watch Expression (Statement Step):

//Remove the Expression by Passing the reference created at Setup
RunState.Engine.GetWatchExpressions().Remove(Locals.WatchExp)

 

The screenshot below shows one example implementation where the steps are implemented in the MainSequence.

 

Statement steps implemented in the MainSequence

 

References

 

 

Notes & Caveats

 

  • This might be excessive. If you’re requirement is simple, consider adding/removing watch expressions manually.
  • If your sequence can abort early, consider removing the watch in the SequenceFileUnload engine callback.
  • Watches require a Watch View (present in the Sequence Editor and full-featured UIs).
  • Tracing needs to be enabled in the Station Options dialog.

 

 

Option 3 — Display Live Values in the Status Bar

 

If you want a simpler, unobtrusive display, that works even when tracing is disabled, you can post dynamic text to the status bar using a UI Message — all from an expression.

 

Steps

 

  1. Override SequenceFilePostStep Engine Callback, or add it to the PostExpression of a step if you only want to update it a certain moments of the execution.
  2. Add a Statement step with:

    RunState.Thread.PostUIMessageEx(UIMsg_ProgressText, 0, "FileGlobals.MyVar = " + Str(FileGlobals.MyVar), Nothing, False)

 

What this does?

 

  • Posts a UI Message of type UIMsg_ProgressText.
  • The Sequence Editor and full-featured UIs automatically display it in the status bar.

 

References

 

Additional Information

A modeless UI built in LabVIEW, CVI, .NET, or Python can display values smoothly — but that requires a code module, which is outside the scope of this “no-code-module” article. For that use case, please refer to the KB Continually Update a Pop-up Dialog With the Latest Value of a Variable in Teststand.