Debugger Actions
In debug mode, you can take actions to progress the simulation and modify blocks during pauses.
Buttons
- START: The simulation runs until all pause conditions are satisfied. When a pause condition is triggered, the simulation pauses and the debugger dialog box is reactivated.
- STEP: The simulation runs and steps at every call. Pause conditions are ignored, except for whether to include try mode calls.
- FINISH: The simulation runs without pausing until the end, unless an error occurs.
When the simulation is paused, the START button is renamed CONTINUE, which performs the same action. The QUIT button becomes active and can be used to end the simulation and exit debug mode. If you quit debug mode, termination calls are made to the blocks to cleanly terminate the simulation and close any files opened by a block.
When the simulation ends, the RESTART button lets you restart the simulation under the same conditions.
OML commands
The results of OML commands are shown in the large text box on the right side of the dialog box.
You can use OML commands to redefine variables, in particular outputs, xd, z, and oz, to update the values of the associated block signals under actions and in phases where such an update is meaningful. An update is meaningful if it is consistent with timing and the flag value. For example, when flag = 1 (output update), it is not meaningful to change the state of the block. When entering a block, changing the output is not meaningful because the block does not read its outputs, so changing an output when entering the block is ignored. The output can be changed when leaving the block.
The OML commands can contain any of the variables in the table below. The variables that can be used are shown at the bottom of the dialog box.
Variable | Description |
---|---|
block_name | Block name (string) |
t | Current simulation time (double) |
inputs | Input values (cell | mat) |
outputs | Output values (cell | mat) |
nevprt | Block activation code (double) |
x | Continuous-time state (vector) |
xd | Derivative of the continuous-time state (vector) |
mode | Block modes (vector) |
zcross | Zero-crossing surfaces (vector) |
z | Discrete-time block state (vector) |
oz | Discrete-time object states (cell | mat) |
rpar | Block parameter (vector) |
opar | Object parameters (cell | mat | scalar | string) |
trymode | True if call is made in try mode, otherwise false |
block | OML object corresponding to the block structure |
flag | Indicates the action associated with the call |
prepost | 0 or 1 depending whether in pre- or post-call phase |
vssAreModesFixed(block)
- List of blocks: SuperBlock/Integral
- Included action: Derivative update (flag 0)
- Include try mode calls
- Included phases: Only post call
inputs
x
xd
Click START to enter the first pause and see the results to the right. The initial values are shown at t = 0. To skip other similar calls until a certain time, set the stopping condition to a later time:
t > 0.05
Click CONTINUE to see the values at that time.