6 Parameters There are two types of parameters:
10 Debugging a Signal Control Logic
VisVAP offers a comfortable way of displaying the current state of a VAP signal control logic (that has been created with VisVAP) during a VISSIM simulation run. This is accomplished by providing several commands to visualize the control flow and by displaying the current values of all parameters and expressions.
As the debug mode is an interaction between VISSIM and VisVAP there are occasions when either application does not respond immediately to mouse or keyboard input. This is a normal behavior and originates of the fact that only one of both applications can have control at the same time.
10 Debugging a Signal Control Logic
10.1
Starting the Debug Mode
The debug feature requires at least VISSIM version 4.10, VAP215.dll and VisVAP version 2.15.
1. In order to start a debug session, the VisVAP application needs to be running and all VisVAP files (*.VV) need to be included in the same directory as the VISSIM network file (*.INP).
2. If a simulation is currently running in VISSIM, choose Single Step Mode. 3. In VISSIM, choose SIGNAL CONTROL -EDIT CONTROLLERS and select the
SC that you would like to debug. 4. Select the [Controller (VAP)] tab.
5. Make sure that at least VAP215.dll is used as PROGRAM FILE. Then
activate the ; Debug Mode (VisVAP) option. 6. Close the window by pressing OK.
7. Choose SIMULATION - CONTINUOUS in order to start/continue the
simulation.
8. Activate the VisVAP application. The corresponding VisVAP file should now have been loaded and the debug cursor (amber) pointing to the first command after the program start.
Depending on the number of variables, initialization may take some time when neither VisVAP nor VISSIM reacts on user input.
9. Furthermore, an additional column has been created within the Parameters and Expressions panes containing the current values. Within
Starting the Debug Mode the Parameters pane only those values are contained that have not been defined within the General column as these remain constant. The current values of arrays are displayed directly at the corresponding position within the Arrays pane (temporarily replacing the initial values). After finishing the debug mode, the original tables are being restored.
The number of decimal places displayed of the current debug values of parameters, variables and expressions can be changed using the + and - keys of the numeric keypad. Possible values are 0 to 3. The settings are stored for each pane individually and are saved to the *.INI file.
10 Debugging a Signal Control Logic
10.2
VisVAP Debug Commands
The following commands are available during a VisVAP debug session. The behavior of these commands depends on the current state of the VISSIM simulation. Symb ol Command / Shortcut Description Continuous F5
Executes all commands of the logic without stopping. If VISSIM is in Single Step mode, VisVAP stops at the end of the logic. If VISSIM is in Continuous mode, VisVAP continues until another mode is selected.
Next Command
F4
Executes the command at the debug cursor position. If this is a subroutine, all commands within the subroutine will be executed at once without locating the debug cursor in the subroutine. The debug cursor will be located at the next command within the same level. STEP IN
F3
Executes the command at the debug cursor position. If this is a subroutine, the debug cursor follows into the subroutine and stops at the next command within the subroutine. While the debug cursor is located within a subroutine it will be displayed in orange (in contrast to yellow) color.
STEP OUT SHIFT+F3
available only while the debug cursor is located within a subroutine: Executes the rest of the subroutine commands at once and locates the cursor at the next command after that
subroutine has been called.
DEBUG -MARK COMMANDS: Marks all commands that have been executed so
far during one simulation second with in red color. This option is useful when VISSIM is in Single Step mode and VisVAP in Continuous debug mode as the debugger then stops after every complete run of the control and shows a trace of all executed commands.
The editor colors described in this chapter apply only to the main debug window. If any subroutines are opened while in debug mode the colors may be differently
When debug mode is active all VisVAP files related to that signal control logic are locked and cannot be modified except for toggling breakpoints.
VisVAP Debug Commands
If the VISSIM is in Single Step mode and the number of time steps is greater than 1, the SIMULATION –SINGLE STEP button needs to be pressed
as often as the simulation time in the status bar is increased. Because the VAP signal control logic is activated according to the controller frequency (not necessarily every simulation time step) all intermediate time steps will not affect the display of the signal logic.
10 Debugging a Signal Control Logic
10.3 Breakpoints
During continuous debug mode breakpoints stop the program execution as soon as a command is approached that is marked with a breakpoint.
Breakpoints may be defined or removed by selecting the desired cell and choosing DEBUG -TOGGLE BREAKPOINT. The symbol of a command where a
breakpoint is defined is filled with light red. If a breakpoint is reached during a debug run the corresponding symbol is filled with bright red color.
Breakpoints may be defined or removed also when debug mode is active. They are being stored in the VisVAP file.
Leaving the Debug Mode
10.4
Leaving the Debug Mode
If the VISSIM application has input focus (i.e. when it responds to user input) the debug mode may be stopped by choosing SIMULATION - STOP or by
switching off the Debugger (VisVAP) option in the Signal control (see 10.1). If the VisVAP application has input focus the debug mode may be stopped by first selecting the continuous debug mode in VisVAP and then switching over to VISSIM and stop the debug mode as outlined above.
When closing the VisVAP file or the VisVAP application while the debug mode is active a sequence of error messages will occur in VISSIM. In most cases these messages can be confirmed by Ok and VISSIM will stop the simulation run. However, it is not recommended to stop the debug mode in that manner as data loss may occur.