NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using TestStand API Engine to programatically set watch expressions?

I would like to auto populate the Watch Expression window when I start a sequence. This would allow the test developer to set up a list of variables once and have them available all the time, for troubleshooting. I see references in Test Stand help to insert, remove, clear, etc, but I haven't been able to figure out how to access them. Getwatchexpressions is all I can find, so far. I have looked in TS 3.5 and 4.
0 Kudos
Message 1 of 3
(3,622 Views)
Hi Mark,

you can use "Engine.GetWatchExpressions" method to get a watch expression list first. The "WatchExpressions.Insert" method adds a new watch expression to the collection and returns the new object, specify the expression for the new watch expression using "WatchExpression.Expression" property.

Hope that  may help.
Regards
MY
0 Kudos
Message 2 of 3
(3,598 Views)
That was the hint that I needed. I am attaching a simple sequence that populates a watch expression. May be useful for others.
0 Kudos
Message 3 of 3
(3,585 Views)