NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic deletion of TestStand Breakpoints and Watch Expressions

I’m looking for a way to dynamically delete all Breakpoints and Watch Expressions in TestStand.  Can you suggest a method to do.  We are using ver 3.1 but will soon upgrade to 4.0.

0 Kudos
Message 1 of 6
(4,496 Views)
Hi John,
 
I am not sure there is anything, even in TestStand 4.0, other than invoking the Display Breakpoints Dialog.
 
Regards
Ray
Regards
Ray Farmer
0 Kudos
Message 2 of 6
(4,478 Views)

John -
For watch expressions, you can use Engine.GetWatchExpressions and then clear the list. There is no easy programatic way to delete beakpoints. You would have to open each file that you think has breakpoints and iterate through each sequence and step and use Sequence.SetBreakOnEndSettings and Step.SetBreakSettings.

Another option that I think will work is if you are using a workspace, you can unload the workspace, clear Engine.PersistBreakpoints and Engine.PersistWatchExpressions properties, reload the workspace, and reset the properties.

I have made a suggestion to add better breakpoint access to the API for the future.

Scott Richardson
https://testeract.com
0 Kudos
Message 3 of 6
(4,464 Views)

John,

Try this in TestStand 4.0 using the TS API Watch Expressions Class method: WatchExpressions.Clear or WatchExpressions.Remove.

Don't know the best/right way to call them, as I've not used them.

For breakpoints, I didn't see a potential way to delete breakpoints, but there is a way to disable them. Try StationOptions Class Set: StationOptions.BreakpointsEnabled  set to False.

You could also try playing with the Engine Class Engine.PersistWatchExpressions and Engine.PersistBreakpoints to see if you can get them to go away when you want them too (i.e.; when shutting down they won't be saved, so they shouldn't be there when you start up the next time...).

Hope this helps.

-Jack

0 Kudos
Message 4 of 6
(4,463 Views)

Hi Jack,

Interesting, the ApiPoster seems to be missing those methods from the WatchExpression class.

(Unfortunately I dont have TS4.0 to hand at the moment)

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 5 of 6
(4,455 Views)

Hi,

The WatchExpressions wont clear your breakpoints.

To do this you have to get a reference to each step and use Step.SetBreakSettings(false,false,0, "") to clear the breakpoint. You can use Step.GetBreakSettings(Locals.IsSet,.....) and then use return value in IsSet to reset the breakpoint of the step.

Hope this helps

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 6
(4,433 Views)