Debugging
- Updated2023-02-17
- 5 minute(s) read
Debugging
Refer to the following information to learn about debugging your test programs.
Debugging TestStand Test Programs
Consider the following common approaches to debug the following components of a TestStand test program.
Sequence Execution
Sequences can be in a running or suspended testing state. Testing is running when continuously testing DUTs. When testing is running, each test socket is executing tests for one DUT. Testing is suspended when one or more TestStand test socket executions are suspended at a breakpoint. One test socket can be suspended while other test sockets are running. The background of the Execution window changes to yellow to indicate that the execution is suspended. You can examine sequence variables only in executions that are suspended.
Use the following techniques to debug sequence execution:
- Set Sequence Breakpoints—To suspend testing at a specific step, set a breakpoint on the step by clicking in the column to the left of the step name in the Steps Pane of the Sequence File window or in the Execution window. You can right-click the breakpoint stop sign icon and select to launch the Breakpoint Settings dialog box, in which you can specify an expression to set a conditional breakpoint. Testing suspends when the execution reaches the step breakpoint. A yellow arrow icon, called the execution pointer, to the left of the step indicates the next step to execute when testing resumes. Click the breakpoint icon to remove the breakpoint.
- Set Data Breakpoints—To suspend testing when the value of a variable changes or when it
has a specific value, use the Watch View pane to enter an expression
for the variable and edit the watch expression to specify a break condition. TestStand
evaluates these break conditions when each step executes and suspends the testing if the
break conditions are met. Note Delete watch expressions when you no longer need them because they can negatively affect execution performance.
- Control Test Program and Step Execution—When testing is suspended, use the following
options in the Debug menu or toolbar or in the
Steps pane context menu of the Execution
window to control test program and step execution:
- Debug Menu/Toolbar
- Step Into—Enters and suspends inside the code module associated with the step to which the execution pointer points.
- Step Over —Executes the step to which the execution pointer points and suspends execution on the next step in the sequence.
- Step Out—Resumes execution through the end of the current sequence and suspends execution on the next step in the calling sequence.
- Steps Pane Context Menu
- (temporarily skips step)—Select Skip to prevent the step from executing in the current execution. Changing the step run mode in an execution does not persist the setting to the step in the sequence file. As a result, once execution ends, the setting reverts to the original run mode before you made the change. Change the run mode on the step in the Sequence File window to persist the setting in the sequence file.
- Set Next Step to Cursor —Moves the execution pointer to point to a different step to change which step executes next.
- Run Selected Steps—Select one or more arbitrary steps in the sequence that you want to execute before resuming normal execution. TestStand executes the selected steps in the order they appear in the sequence. If a breakpoint suspends execution of the selected steps, the Steps pane displays the interactive execution pointer, which differs from the normal execution pointer.
- Debug Menu/Toolbar
- View and Modify Variable and Expression Values —Use the following techniques to view or
modify variable values and to monitor expression values:
- When testing is suspended, use the Variables pane to view and modify the values of any of the variables and properties accessible in the current execution.
- To monitor the value of an expression while testing, enter the expression in the Watch View pane when testing is suspended. You can also use the Edit Breakpoints/Watch Expressions dialog box to enter expressions when testing is not in progress. When you enable tracing, the sequence editor updates the values after each step executes.
- Display Debug Messages—To display messages to the Output pane while testing, use the OutputMessage expression function in a Statement step.
Debugging ECU Software Toolkit Test Programs
In addition to following common approaches to debug components of a TestStand test program, consider the following additional approaches to debug components of an ECU Software Toolkit test program:
Sequence Execution
Sequences can be in a running or suspended testing state. Testing is running when continuously testing DUTs. When testing is running, each test socket is executing tests for one DUT. Testing is suspended when one or more TestStand test socket executions are suspended at a breakpoint. One test socket can be suspended while other test sockets are running. The background of the Execution window changes to yellow to indicate that the execution is suspended. You can examine sequence variables only in executions that are suspended.
Pausing a lot does not suspend executions the way using the default TestStand Sequence Editor or Break All menu items do. When you pause a lot with the Pause button, testing continues until each site completes testing its current DUT. The executions then wait for operator input before proceeding with testing the next batch of DUTs. To suspend test socket executions to examine variables or to step into code modules, set a breakpoint on the step where you want to suspend. You cannot examine variables in the sequence editor for executions that are not suspended, even if they are paused between DUTs.
- Set a breakpoint on a step.
- Click the Launch InstrumentStudio
button in the toolbar. You must configure the InstrumentStudio
project in before doing this. - The current TestStand sequence pin map will be active in the InstrumentStudio project. If you
already have the soft front panel for the pin map created, double-click the soft front
panel to open it. If a soft front panel is not created for the pin map:
- Right-click on the InstrumentStudio project.
- Select , which creates a soft front panel for the current pin map.
- You will see instrument configurations in the soft front panel. You can check these configurations to see if their behavior is expected.
Related Information
- Debugging Executions in TestStand
- Watch View Pane
- Watch Expression Settings Dialog Box
- TestStand Sequence Editor Debug Menu
- TestStand Toolbar Buttons and Shortcuts
- Steps Pane Context Menu - Execution Window
- Variables Pane - Execution Window
- Edit Breakpoints/Watch Expressions Dialog Box
- Output Pane
- Output Message Function
- Statement Step