Page 746 - ExtendSim User Guide
P. 746

Debugging Tools
The Source Code Debugger
close the selected block's dialog or switch its contents tracking mode. Block Label column 2 will display the block's label (or the block's name if the block does not have a label) as well as the block's global number. On/Off column 3 has a popup in its header allowing you to either "turn all selected on" or "turn all selected off". Choosing the former will turn content tracking on for all blocks that have been checked in this column of the navigator table. Choosing the later will turn content tracking off for all selected blocks. Mode column 4 allows you to specify whether a given block will do current contents tracking or historical logging. This column's head has a popup which allows you to "Set all selected to Current Contents" or "Set all selected to Historical Log". If either option is selected, it will be applied to any blocks that have been selected in the column 1.
• Apply properties to selected blocks: Clicking this button will add the properties specified in the properties table to the blocks that have been selected in the navigator table.
The Source Code Debugger
The ExtendSim Source Code Debugger is the ultimate model debugging tool. With the debug- ger you can step through every statement, inspect the value of every variable, and view the sequences of messages sent from one block to another. Using the debugger requires that you understand the ModL language and how blocks interact with each other. For more information, see the Developer Reference.
Debugging equations
The equation-based blocks allow you to enter equations that are simple logic statements (if x, then y) or complex calculations that control the model using ModL functions. While in many cases you won’t need to debug the equation, ExtendSim provides an equation debugger so you can determine if equations are performing as expected. This works like the Source Code Debugger ExtendSim developers use, but it is specific to the equation-based blocks used by many modelers.
The equation debugger allows you to:
• Setbreakpointsforequations.Abreakpointiswherethedebuggerinitiallystopsexecution of the equation so you can step through the code.
• Setbreakpointconditionsforequations.Settingabreakpointconditioncausesthebreakpoint to stop execution only under certain circumstances.
• Stepthroughlinesofcodeandexaminethevariables.Stepcommandsallowyoutotracethe execution of the equation and examine the effects on the variables defined in the code.
Starting the tutorial
Open the Reservoir 3 model located at \Examples\Tutorials\Continuous
So that you don’t overwrite the original model, save the model as Equation Debugging In the model, open the dialog of the Equation block; it is labeled Calculate Overflow
☞ Although the following tutorial uses a continuous model, the equation debugger can be used with any of the equation-based blocks. For a list of equation-based blocks, see “Equation- based blocks” on page 695.
How To

   744   745   746   747   748