ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I enable breakpoints in a C# application

Solved!
Go to solution

We have a C# application that works as a wrapper around TestStand.

 

Is there a way to enable breakpoints for the current run via a method call?

0 Kudos
Message 1 of 5
(4,069 Views)

Hi,

 

Maybe this link will help

 

 

Regards
Ray Farmer
0 Kudos
Message 2 of 5
(4,054 Views)

Hello Ray & Thanks for your reply.

 

I fear my initial statement wasn't detailed enough, sorry. I am not looking to debug my DLL/application.

 

I am looking for a TestStand C# function call that will perform the same operation as choosing the Configure->Station Options... menu selection and then clicking on the Enable Breakpoints check box.  Right now when I set a breakpoint in my sequence file and have my C# application run TestStand, it just ignores the breakpoint.

 

On a related note: When I'm running the sequence file, I can detect if a step is skipped (TraceEvent.ctxt.PreviousStep.ResultStatus), or forced to pass/fail (TraceEvent.ctxt.PreviousStep.GetRunModeEx()), is there a way to detect if a step has a breakpoint set?

0 Kudos
Message 3 of 5
(4,046 Views)

Hi,

 

I think you would use Engine.StationOptions and then StationOptions.BreakpointsEnabled setting this TRUE.

 

As for the Breakpoint status, I haven't use the WatchExpressions / WatchExpression but I am guessing you would need to get a reference to the WatchExpressions using Engine.GetWatchExpressions and then use the WatchExpressions.Item to get a specific WatchExpression.

 

From there you can probably check were if there is a breakpoint by maybe using WatchExpression.BreakpointTriggered.

 

There maybe an example of this in the TestStand Examples. (Just checked the on-line help and there doesn't appear to be an example)

 

 

Regards
Ray Farmer
Message 4 of 5
(4,041 Views)
Solution
Accepted by topic author tlaford

Ah ha!  That pointed me in the right direction!

 

I can access the Breakpoints Enabled flag using
    ApplicationMgr.GetEngine().StationOptions.BreakpointsEnabled

 

I can determine if a step has a breakpoint using
    TraceEvent.ctxt.NextStep.BreakOnStep

 

Thanks!

Message 5 of 5
(4,036 Views)