Professional Documents
Culture Documents
16
USER MANUAL
1 Introduction 3
2 Operating Instructions 5
4 Error Handling 37
The following section describes the minimum requirements for using the
VAP signal control module, how to start the program, and the operating
instructions.
Execution of VAP
During a VISSIM simulation run the VAP logic is usually called once at the
end of each simulation second after the vehicles have been moved. If the
simulation resolution is more than one time step per simulation second, the
controller frequency for VAP can be increased to a value up to 10 times per
simulation second through the VAP declaration VAP_Frequency in the VAP
file. The controller frequency needs to be an integer factor of the simulation
resolution, i.e. the length of the controller time step needs to be a multiple of
the length of a simulation time step.
Usually the entire program is executed, even when an interstage is running.
This allows detector values to be collected and evaluated during an active
interstage. As an exception, program execution waits at a WAIT_AT-UNTIL
command until the until-expression is found to be TRUE.
Data format
The programming language VAP can process integer and real numbers. The
type conversion is handled internally and therefore invisible to the user. In
the program both data types are converted to double floating point numbers.
The integer number range is limited to the values -2,147,483,639 to
2,147,483,639. Larger integer numbers can only be processed as real
numbers by adding .0 at the end. Real numbers are stored in the usual 64
bit floating point format. If a variable is passed to a function and the function
expects an integer number, VISSIM will check whether the variables
decimal value is zero and if the variable is within the valid range for integer
numbers. If one of these requirements is not met, VISSIM will send a run
time error message and cancel the simulation.
Expressions
When computing arithmetic or logical operators, the usual priority rules
apply:
Operator precedence: please refer to chapter 3.2.
Combinations of operators with the same priority are computed starting
from the left.
In case a special computing sequence is desired, it must be enforced by
the appropriate parenthesis setting.
If an expression resulting from the combination of a logical operator or a
comparison operator is true, the value of the expression is returned as 1,
otherwise as 0.
Every expression will be completely evaluated even if the entire
expression is already determined after evaluating parts of the entire
expression (i.e. logical combinations using AND and OR).
Operands in expressions can be variables, constants and numerical
constants as well as all functions provided by the programming
language.
Function arguments need to be numbers, constants or variables but not
composite expressions.
Example variable: Set_des_speed( 1 , 1, desSpeed ) ok
Example expression: Set_des_speed( 1 , 1, desSpeed+1 ) error
Negative expressions must always be enclosed in parentheses.
Comments
Comments must be enclosed by a pair of /* */ signs and can be placed
anywhere within the program text.
Identifiers
There is no distinction between capital and lower case letters. Therefore OK,
Ok, oK, and ok characterize the same variable and IF, If, iF, and if are
recognized as the key word if. It is recommended to keep the spelling
convention for variables and key words consistent once it is introduced in the
program text.
Program Header
The first command of a VAP program (in a *.vap file) must consist of the
keyword PROGRAM, the name of the program (as a valid identifier) and a
semicolon.
Controller Frequency
The controller frequency of a VAP program can be defined as first
declaration below the program header. This declaration consists of the
keyword VAP_Frequency, the number of passes through the VAP logic per
simulation second and a semicolon. The controller frequency must be in the
range from 1 to 10 and it needs to be a factor of the simulation resolution
(time steps per simulation second). If this declaration is missing in a VAP
program, the default frequency 1 is used.
Constants
There are two different kinds of constants:
System constants use the phase or signal group numbers of the phase
interstage description as identifiers and the corresponding phase or
internal VISSIM signal group numbers as their value.
User defined constants which are defined in the CONST section (to be
placed after VAP_Frequency).
Variables
Variables are automatically defined by their use or the context of their use in
the program text. A program start after compilation resets all variables to
zero. Timer variables are handled differently: Their value cannot be
changed by a regular assignment but by one of the three timer commands
START, STOP, and RESET. Once a timer variable is started, its value is
increased by the length of the controller time step (reciprocal of the controller
frequency) at the start of each pass through the logic.
Jump labels
Every instruction can be marked with a jump label. Therefore the jump label
identifier must be directly followed (maximum of one blank space) by a
colon; otherwise, the jump label will be interpreted as a variable assignment.
A jump label is only valid within the sub-program or within the main program.
Therefore, all jump labels used in a GOTO or WAIT_AT statement have to
be defined in the range in which they are used.
For jump label identifiers the same rules apply as for variable identifiers.
The valid name range for variable identifiers is identical with the valid name
range of jump label identifiers. As a result, a variable test and a jump label
test can coexist in the same program.
Subroutines
The VAP programming language uses a SUBROUTINE concept. This is
useful for a hierarchical structuring of the control task (Top-Down-Design). It
also allows listing of multiple but identical program sequences only once
within the signal control program. In a VAP program any number of
subroutines may be defined (only limited by RAM space). Any predefined
subroutine can be called inside a program using the GOSUB command.
However, there is no form of recursion allowed. Therefore the currently
active subroutine cannot call itself. Local variables cannot be defined within
a subroutine. All variables are valid in every part of the entire program
(global variables). This feature should have no side-effect if a strict
programming discipline is maintained.
During execution a subroutine can only be ended when the end symbol . is
encountered. There is no explicit return command. For that reason, the
definition of a jump label for the program end symbol is allowed in order to
use the GOTO command to end subroutine execution.
The same principle applies for the main program. When the END command
of the program is reached program execution stops for the current controller
time step and will be restarted from its begin in the next controller time step.
Therefore all initializations at the beginning of the program which should be
executed only once have to be protected. A conditional command such as
IF NOT init THEN
/*initialization*/
init:=1
END
protects the initializations and will work because all variables are initialized to
zero automatically at the start of the simulation run.
Memory restrictions
There is no limitation on the number of program commands or for combined
IF-THEN-ELSE-END constructs and expressions in the programming
language. In practice, the limitation is determined by available RAM space of
the computer hardware. If too complex of an expression is to be compiled,
the compilation process is interrupted with an error message.
3.2 Operators
The following operators are available in VAP:
Operator Meaning
6 (, ) Parentheses
5 NOT logical NOT (unary)
4 AND logical AND (binary)
4 *, / Multiplication, Division
4 %, \ Modulo, integer division
3 OR logical OR (binary)
3 +, - Addition, Subtraction
(binary)
2 =, <>, <, <=, >, >= comparison
1 - sign (unary)
The operator precedence is shown in the first column starting with highest
precedence (6). Parentheses must be used for expressions with unary
operators.
Assignment
When using an assignment, the variable on the left side of the assignment
symbol := gets the value of the expression on the right side of the symbol
assigned to it.
Example:
switchSignal := 1;
The value 1 is assigned to the variable switchSignal.
GOSUB
The GOSUB command calls the specified SUBROUTINE. After executing
the subroutine, program execution continues with the next command
following the GOSUB command.
Example:
GOSUB CalcSignalState;
train := 2;
SUBROUTINE CalcSignalState;
maxGreen := 5;
END.
The program executes the subroutine CalcSignalState (assigning maxGreen
the value 5). Then it returns control to the next command following the
GOSUB command which is the assignment train := 2;.
GOTO
Using the command GOTO, program execution continues at the command
referenced by the jump label identifier following the jump command.
Example:
GOTO CalcSignalState;
CalcSignalState: maxGreen := 5;
Program execution continues at the line labeled CalcSignalState.
IF-THEN-ELSE-END
In the conditional statement IF-THEN-END or IF-THEN-ELSE-END, the
expression following the key word IF is evaluated first. If the result is other
than 0, the expression(s) following THEN will be executed. Otherwise, the
program execution will be continued either with the expressions following the
optional ELSE-clause or with the expressions following END if there is no
ELSE-clause.
Example:
IF switchSignal = 1 THEN
maxGreen := 5
ELSE
maxGreen := 10
END;
The variable maxGreen is set to 5 if the variable switchSignal has the value
1. For any other value of switchSignal the variable maxGreen is set to 10.
Timer commands
The timer commands Start, Start_at, Stop and Reset will only affect the timer
variables provided by the programming language. These timer variables are
counters which
are activated with the commands Start (<timer>) or Start_at (<timer>,
<value>) where the command Start_at can be used to start a timer with
an initial value
are increased by the length of the controller time step (reciprocal of the
controller frequency) before each pass through the VAP logic
can be stopped using the command Stop (<timer>) (the timer value is
not reset)
can be reset to zero using the command Reset (<timer>) (either in
running or stopped mode)
If a variable is used as an argument of a timer command (and therefore
implicitly becomes a timer variable), it cannot be used on the left side of an
assignment in the entire signal control program. Thus it is not allowed to
assign a value to a variable which is already used as a timer variable or to
use a variable which has been assigned a value before as an argument in a
timer command. In both cases the compilation process terminates with an
error message. The maximum number of timer variables is limited to 512.
Example:
IF noTimer = TRUE THEN
Start (gatesDown);
noTimer := FALSE
END;
IF gatesDown = 10 THEN
Stop (gatesDown);
Reset (gatesDown);
noTimer := TRUE
END.
If noTimer is true (or 1), the program starts the timer variable gatesDown. To
ensure that the timer is not being restarted during the next program
execution cycle, the variable noTimer is set to FALSE. Thus in the next
execution cycle the expression noTimer = TRUE evaluates to FALSE (or 0).
The timer variable is increased by 1 at the beginning of every controller time
step (assuming the default controller frequency of 1). After 10 controller time
steps (10 simulation seconds), the expression gatesDown = 10 becomes
TRUE and then the program stops the timer gatesDown and resets it to zero.
TRACE Command
VAP includes a TRACE command which enables the user to follow and
analyze the signal control program using several different parameters. If
used in the program code, the TRACE command can create a complete
documentation of every executed command and the current value of every
variable. In addition, it can be used to analyze the signal control logic, i.e. to
write the interstage changes to a log file.
The current signal group status and times will not be logged since VISSIM
already provides this data and can display it online (i.e. in a signal timing
window). The VAP signal control program writes all data generated by the
trace command to a file with the same name as the program file and using
the extension *.TRC. This file will be written to the same directory as the
program file. If there is already an existing trace file with the same name, the
new information will be added to the end of the existing file. In certain
conditions (see above) the contents of the trace file can be displayed at
runtime using a VAP system menu command.
During a simulation, the first call of the TRACE command creates a header
line with the current date and time, and the name of the current signal control
program. Every call of the TRACE command displays the current state of the
simulation and the signal control unless this was already done during the
current controller time step. This state contains the cycle second, the
simulation second, the active phase or interstage, and the current phase
second.
In addition, the call of the TRACE command activates the appropriate trace
mode (Exception: trace(variable(<ident>))). The trace logs the simulation
state and the trace information to the trace file in every controller time step
until a NOTRACE command deactivates the trace mode or another TRACE
command switches to another trace mode. If the trace mode is active, a
separation line of = signs will be added to the trace file at the end of every
controller time step.
The following parameters are possible for the TRACE command and create
the output described.
COMMAND Activates the trace command mode in which all executed
program commands are listed in the exact execution
sequence.
VARIABLE Activates the trace variable mode in which the value of every
variable used in the program is listed by name at the
beginning of every controller time step before the execution
of the program. Therefore, the listed values are the values at
the end of the previous controller time step. Several TRACE
(VARIABLE) commands can be place anywhere within the
program. Every single command results in a new list of the
current variable values at the time of command execution.
A variation of the VARIABLE parameter is:
variable (<var_ident_1> [, <var_ident_2>]).
This command writes the current value of one or two
WAIT_AT-UNTIL
The WAIT_AT-UNTIL command can be used to assemble a time loop. It has
been introduced by the previous version of the German RiLSA regulations
but has been deprecated in the latest version. For this reason and in order to
maintain a clear program structure we recommend not to use this command.
Firstly the expression following UNTIL is be evaluated. If its value is zero,
program execution is interrupted for the current controller time step and will
continue in the next controller time step, repeating the evaluation of the
expression following the WAIT_AT command. Otherwise, program execution
continues with the next command.
Example:
WAIT_AT Stage1 UNTIL t_actual = T1;
First the program evaluates the (boolean) expression t_actual = T1. If the
variable t_actual does not equal the variable T1, program execution will be
interrupted at this point and continued here in the next controller time step,
first checking the expression condition again. Otherwise, program execution
continues with the following command.
Detection (<no>)
Returns 1 if the impulse memory of detector <no> is 1 (i.e. a vehicle front
end has been detected) or a vehicle is on the detector. Otherwise it returns
0. This is in contrast to the function Presence which does not recognize a
waiting vehicle on the detector. Using the function Detection resets the
impulse memory of the detector to zero automatically after the current pass
through the VAP logic.
Front_ends (<no>)
Returns the total number of vehicle front ends detected by detector <no>
since the last call of Clear_front_ends. If a vehicle reaches the detector while
another one is still present on the detector, no new front end is detected.
To reset the contents of the internal detector memory the function
Clear_front_ends must be used.
Headway (<no>)
Returns the current time gap at the detector <no>. The returned value is 0 if
the detector is occupied at the end of the current simulation time step.
Otherwise, the returned value is the time gap in seconds since the last
occupancy of the detector.
Example:
gapOut3 := headway (DK3) >= minGap3;
The logical variable gapOut3 is set to TRUE if the headway of detector DK3
is at least as big as minGap3. Otherwise it is set to FALSE.
Headway10 (<no>)
Returns the current headway of detector <no> in tenths of a second (10
times the value of Headway (<no>))
Occup_rate (<no>)
Returns the smoothed occupancy rate of detector <no> (for more information
on smoothing see the detectors section in the main VISSIM manual).
Occup_rate results in a value within the range [0..1]. The smoothing factors
can be adjusted individually for each detector within the VISSIM detector edit
window.
Example:
IF Occup_rate (DK1) <= 0.5 THEN
increase1 := TRUE
END;
The logical variable increase1 is set to TRUE if the occupancy rate of
detector DK1 does not exceed 0.5 (50%).
Occupancy (<no>)
Returns 0 if no vehicle is detected by detector <no> at the end of the current
simulation time step. Otherwise, the function returns the time in seconds
since the arrival of this vehicle.
Example:
Call1 := Occupancy (DK1) >= 1;
In this example the logical variable Call1 is set to 1 if detector DK1 has been
occupied for at least 1 second.
Occupancy10 (<no>)
Returns the occupancy time of detector <no> in tenths of a second (10 times
the value of Occupancy (<no>)
Presence (<no>)
Returns 1 if the impulse memory of detector <no> is 1 (i.e. a vehicle front
end has been detected). Otherwise it returns 0. This is in contrast to the
command Detection which additionally recognizes a vehicle waiting on the
detector. Using the function Presence resets the impulse memory of the
detector to zero automatically after the the current pass through the VAP
logic.
Rear_ends (<no>)
Returns the total number of vehicle rear ends detected by detector <no>
since the last call of clear_rear_ends. If a vehicle leaves the detector while
another one is still present on the detector, no new rear end is detected.
To reset the contents of the internal detector memory the command
Clear_rear_ends can be used.
Veh_length (<no>)
Returns the length [m] of the last vehicle that was detected by detector <no>
since the last pass through the VAP logic. If no vehicle was detected in this
time span the function returns 0.
Velocity (<no>)
Returns the speed [m/s] of the last vehicle that was detected by detector
<no> since the last pass through the VAP logic. If no vehicle was detected in
this time span the function returns 0.
Clear_front_ends (<no>)
Clears the number of detected vehicle front ends on detector <no>. This
command resets the contents of the internal detector counter. It is useful e.g.
after using the command Front_ends.
Clear_rear_ends (<no>)
Clears the number of detected vehicle rear ends on detector <no>. This
command resets the contents of the internal detector counter. It is useful e.g.
after using the command Rear_ends.
Tele_calling_point (<no>)
Returns the calling point number from telegram <no>
Tele_count
Returns the number of telegrams received in the current simulation time
step.
Tele_course (<no>)
Returns the course number from telegram <no>
Tele_delay (<no>)
Returns the delay in seconds from telegram <no>
The value PT: Lateness shown in the vehicle information is only updated
as a vehicle leaves the current stop and shows the lateness (in seconds) at
the time of exiting from the current stop.
Tele_line (<no>)
Returns the line number from telegram <no>
Tele_man_direction (<no>)
Returns the code for manual direction from telegram <no>
Tele_passengers (<no>)
Returns the number of passengers from telegram <no>
Tele_prio (<no>)
Returns the priority value from telegram <no>
Tele_route (<no>)
Returns the route number from telegram <no>
Tele_tram_length (<no>)
Returns the tram length from telegram <no>
Remaining_intergreen (<no>)
Returns the time (in seconds) until signal group <no> can get green
according to the intergreen matrix. If a conflicting signal group is green, the
maximum intergreen time between such a signal group and signal group
<no> is returned, reduced by the red-amber time of signal group <no>.
(Minimum green times are not taken into account.) The red-amber time of
signal group <no> is not included in the return value, i.e. the signal group
cannot be set to green before the return value is zero (and will then change
to red-amber first if its red-amber time is more than zero). Signal state
changes during the current time step are taken into account. If no matrix is
defined, 0 is returned.
Sg_green (<no>)
Switches signal group <no> to green. If it is not green already, the red-amber
time as defined in VISSIM is automatically inserted before.
Sg_red (<no>)
Switches signal group <no> to red. If it is not red already, the amber time as
defined in VISSIM is automatically inserted before.
For a signal control based on signal groups (i.e. switching single signal
groups rather than stages) only the four functions shown above should be
used since any combination of signal group based commands together with
interstages may lead to malfunction of VAP. However, a PUA file still needs
to be compiled for definition of all the signal groups and at least one stage
(which defines the state of the signal groups to start with). There is no need
to define any interstages.
T_free (<no>)
Returns the time elapsed since the end of red of signal group <no> (i.e. the
current green time plus red-amber time). If the signal group is neither green
nor red-amber, the function returns 0.
T_green (<no>)
Returns the current green time of signal group <no>. The green time does
not include any red-amber time. If the current signal status of signal group
<no> is other than green, the function returns 0.
Example:
maxOut5 := T_green(5) >= maxGreen5;
The variable maxOut5 is set to TRUE if the current green time of signal
group 5 is at least as big as maxGreen5.
T_green_min (<no>)
Returns the minimum green time of signal group <no> as defined in the
signal group parameters in VISSIM (SIGNAL CONTROL - EDIT CONTROLLERS -
SIGNAL GROUPS).
Example:
minCheck3 := T_green(3) >= T_green_min(3);
This example calls two functions and compares their return values. First the
current green time of signal group 3 is evaluated using the function
command T_green(3). Then the minimum green time for signal group 3 is
checked using the function T_green_min(3). If the current green time of
signal group 3 is at least as long as its minimum green time, the variable
minCheck3 is set to TRUE.
T_red (<no>)
Returns the current red time of signal group <no>. The red time does not
include any amber time. If the current signal state of signal group <no> is
other than red, the function returns 0.
Example:
call4 := T_red(4) >= 10;
The variable call4 is set to TRUE if the current red time of signal group 4 is
at least 10 seconds.
T_red_min (<no>)
Returns the minimum red time of signal group <no> as defined in the signal
group parameters in VISSIM (SIGNAL CONTROL - EDIT CONTROLLERS - SIGNAL
GROUPS).
Example:
IF T_red(5) >= T_red_min(5) THEN
newCall5 := TRUE
END;
Using an IF-clause this example calls two signal group functions and
compares their return values. If the current red time of the signal group 5 is
at least as long as the minimum red time for signal group 5 the variable
NewCall5 is set to TRUE.
T_stop (<no>)
Returns the time elapsed since the end of green of signal group <no> (i.e.
the current red time plus amber time). If the signal group is neither red nor
amber, the function returns 0.
Test_intergreen (<no>)
Returns 1 if all intergreen times towards signal group <no> are completed in
order to change the signal group to green.
For the reasons shown above it is possible that more than one stage is
running simultaneously. This is even more likely to happen if the list of
green signal groups of one stage is contained in the definition list of
another stage. To avoid that more than one stage is then running at the
same time, the definition of all signal groups showing red is necessary for
each stage.
In the current version of VAP only stage numbers within the range of
[1..999] are permitted.
Stage_active (<no>)
Returns 1 if stage <no> is currently running. A stage is regarded as active
only if all its green signal groups are either red-amber or green and all its red
signal groups are either amber or red and if there is no active interstage
referring to this stage as from_stage or to_stage.
Example:
IF Stage_active(3) THEN
Interstage (3, 4)
END;
The example above checks whether stage 3 is currently running. If so, the
program starts the interstage from stage 3 to stage 4.
Stage_duration (<no>)
Returns the current duration of stage <no> at the end of the current
simulation time step. This is the time elapsed since the end of the previous
interstage process that triggered this stage. If the addressed stage is
currently not running, the function returns 0.
Example:
WAIT_AT gatesUp := TRUE;
UNTIL Stage_duration(4) >= 25;
In the example above, the program waits at the WAIT_AT command until
stage 4 is running for at least 25 seconds. As soon as this happens the
program continues with the first command after WAIT_AT.
Any_interstage_active
Returns 1 if any interstage (also a partial interstage) is active, otherwise 0.
Example:
IF gatesDown = 10 THEN
Interstage(2,3)
END;
If the evaluation of the expression gatesDown=10 is TRUE, the program will
start the interstage to switch from stage 2 to stage 3. Therefore stage 2
currently needs to be running.
P_interstage_active (<no>)
Returns 1 if interstage number <no> is active, otherwise 0
P_interstage_duration (<no>)
Returns the current second of the interstage number <no> according to its
definition in the *.PUA file. If the interstage was called with a starting second
other than 0, then the returned value is not the elapsed time since that call!.
If the interstage is not active, the function returns 0.
P_interstage_length (<no>)
Returns the length of the interstage number <no> as defined in the *.PUA
file. If this interstage is not defined the function returns 0.
Cycle_second / T
Returns the current second within the signal cycle which is a value within the
range [controller time step .. cycle time].
Example:
t_actual := T - offset;
IF t_actual < 0 THEN
t_actual := t_actual + Tc
END;
The example above demonstrates the use of the functions
T (=Cycle_second) and Tc (=Cycle_time) to calculate the local time taking
into account the offset to the master controller. The variable t_actual is
assigned the difference between the cycle second and the value of the
variable offset. After this assignment it is tested if the t_actual is negative. In
that case the cycle time is added to t_actual.
Cycle_time / Tc
Returns the cycle time of the currently addressed signal control. The cycle
time can be defined in the appropriate signal control edit window in VISSIM
(SIGNAL CONTROL - EDIT CONTROLLERS) .
Example:
See example for Cycle_second.
In_Frame (<no>)
Returns the elapsed time since the start of the frame of line <no> in the
current frame plan (according to the currently active program number). If this
frame is currently not active, the function returns -1.
Marker_get (<no>)
Returns the value from input channel number <no> (written by another
controller to the connected output channel in the previous controller time
step).
This function is used to send integer data between two signal controllers.
Therefore in VISSIM a connection between the two signal controls
(input/output channel) needs to be established using the menu command
SIGNAL CONTROL COMMUNICATION
Parameter (<no>)
Returns the value of parameter <no> as defined in the *.PUA file (for the
active signal program).
Prog_active
Returns the number of the signal program [1..16] currently active. The signal
program can either be selected in VISSIM or set in the VAP logic using the
command set_prog (<no>).
Set_cycle_second (<new_value>)
Sets the current second in the cycle to <new_value> [1 .. 999]. This value is
sent to VISSIM for display in the signal times table window and the
signal/detector record (LDP) after the pass through the control logic. This
function should be called in each controller time step by every signal control
which has a variable cycle time. Additionally a condition needs to be defined
when the variable cycle time is to be reset (for example at the start of a
certain stage or signal group).
Example:
cycle_timer : = cycle_timer + 1;
Set_cycle_second (cycle_timer);
Every controller time step VAP sends the value of cycle_timer to VISSIM as
the current cycle time.
Set_prog (<no>)
Sets the number of the active signal program to <no> [1..16]. This
information is also transmitted to VISSIM. To retrieve the currently running
signal program, use Prog_active.
English German
long name short long name short
name name
P_interstage_active Pisa Tp_luft Tpua
P_interstage_duration Pist Tp_laufzeit Tput
P_interstage_length Pisl Tp_dauer Tpud
Parameter Par Parameter Par
Presence Call Anforderung Anf
Prog_active PAct Prog_aktiv PAkt
Rear_ends R_e Hinterkanten Hka
Record_value Recval Protokolliere_wert Recw
Remaining_intergreen Rig Rest_zwischenzeit Rzz
Reset Rst Reset Rst
Set_cycle_second Sett Setze_umlaufsekunde Setze_t
Set_des_speed Sdsp Setze_vwunsch Svwu
Set_prog Sprg Setze_prog Sprg
Set_route Srou Setze_route Srou
Set_sg Ssg Schalte_sg Ssg
Set_sg_direct Ssgd Schalte_sg_direkt Ssgd
Set_stop_time_dist Sst Setze_Stop_Zeitvert Sst
Sg_green Setg Sg_freigeben Sgfrei
Sg_red Setr Sg_sperren Sgsperr
Sqrt - Sqrt -
Stage_active Stga Phase_luft Phea
Stage_duration Stgt Phasenlaufzeit Phet
Start - Start -
Start_at - Start_at -
Stop - Stop -
T_free Tf T_frei Tf
T_green Tg T_grn Tg
T_green_min Tgmin T_grn_min Tgmin
T_red Tr T_rot Tr
T_red_min Trmin T_rot_min Trmin
English German
long name short long name short
name name
T_stop Ts T_sperr Ts
Tele_calling_point TeCPt Tele_meldepunkt TeMP
Tele_count TeCnt Tele_anzahl TeAnz
Tele_course TeCrs Tele_kurs TeKur
Tele_delay TeDel Tele_fahrplanlage TeFpl
Tele_line TeLin Tele_linie TeLin
Tele_man_direction TeDir Tele_rvh TeRVH
Tele_passengers TePas Tele_personen TePer
Tele_prio TePri Tele_prio TePri
Tele_route TeRou Tele_route TeRou
Tele_tram_length TeLng Tele_zuglaenge TeLng
Test_intergreen Tig Zwischenzeit_pruefung Zzp
Trace - Trace -
Veh_length v_l Fz_laenge f_l
Velocity V Geschwindigkeit V
Compilation Termination
VAP terminates the compiling process when the first error is detected in the
source code, sending an appropriate error message. The parser always
compares the currently read symbol with all possible syntactically correct
symbols. If it cannot find any similarities it displays an error message which
points to the next sign. However, often the error occurs in context with the
last read symbol. Therefore the error message might not be accurate. Still it
points out the exact position where the error occurred even if the position of
the cause of the error has been passed already. A typical example is the
message: expected symbol: .. In most cases it indicates that the
semicolon at the end of the expression is missing.
Check of variables
The VAP programming language has no explicit variable agreement;
variables are defined implicitly by their definition. As a result, i.e. typing
errors in identifier names cannot be recognized in contrast to many other
programming languages. At the end of the program compilation process
VAP checks the usage of variables as follows:
It is checked whether all referenced variables of the source code have
been defined. Thus VAP ensures that all variables used in expressions
or as a function or command argument are assigned a value. If a
variable is used in the program without having a value assigned, the
compiler displays a warning message.
Furthermore VAP examines whether variables are defined in the
program but never referenced. In this case, another warning message is
displayed for all such variables. Timer variables are handled differently
since they only become timer variables when used as an argument of a
timer command. Therefore, they are considered defined but not
referenced.
The checks mentioned above can help to detect possible programming
errors.
(depending on the type of error). After an error occurred, the simulation can
only be continued after its correction and recompilation of the signal control
program.
Infinite Loops
As a measure to detect accidentally programmed infinite loops, the number
of instructions executed per simulation second is counted and compared
with the maximum number of instructions allowed. If this maximum is
exceeded, program execution stops and an error message are displayed. In
the current version the maximum is set to 200,000 program commands per
interpreter call.
The signal group timings for the definition of interstages are regarded as
red end and green end times (in contrast to green begin and red begin).
During the simulation VISSIM automatically includes the redamber time for
a signal group being switched from red to green (according to the red-
amber time defined for that signal group in VISSIM). Similarly, VISSIM
automatically includes the amber time for a signal group being switched
from green to red (according to the amber time defined for that signal group
in VISSIM).
$SIGNAL_GROUPS -------------------------------------------------------------------------
< This section represents a matching table for all signal group identifiers used in
VAP and VISSIM. A signal group (SG, often also called phase) is a group of signal
heads showing exactly the same color at all times.
In VAP, the label of a SG (e.g. K1) must start with a letter. The number in the
second column is the VISSIM number of that signal group. All signal groups must be
defined in VISSIM using that number. >
$- - - - - - - - - - - -
K1 1
K2 2
$IGM -----------------------------------------------------------------------------------
< Optional section to define an intergreen matrix.
The first line (containing column headers) is ignored by VAP. For every SG (same
sequence as defined in the $SIGNAL_GROUPS section) one line with its name and the
intergreen times needs to be defined. -127 is the code for compatible signal
groups.>
$- - - - - - - - - - - -
K1 K2
K1 -127 3
K2 5 -127
$FRAME_PLAN ----------------------------------------------------------------------------
program_number: 1
< Optional section to define a signal frame plan. There can be multiple sections of
this type for different signal programs. The format is:
- Keyword $FRAME_PLAN
- program_number: no. of the signal program (as defined in VISSIM-SC-Controller or
using VAP command Set_prog) to which this frame plan belongs. Only one frame plan
may be defined for each signal program.
- Data: After the second $-line there can be any number of frame plan lines, each one
containing first the unique line number (referred to by the function In_frame) and
then the start and the end of the frame. These times refer to the current cycle
second. If the time is equal to the frame end time, the frame is considered
inactive.>
$- - - - - - - - - - - -
9 44 4
27 33 3
$FRAME_PLAN ------------
program_number: 2
$- - - - - - - - - - - -
9 52 1
21 35 10
$PARAMETER -----------------------------------------------------------------------------
program_number: 1
< Optional section to define any user-defined parameters. There can be multiple
sections of this type for different signal programs. The format is:
- Keyword $PARAMETER
- program_number: no. of the signal program (as defined in VISSIM-SC-Controller or
using VAP command Set_prog) to which this frame plan belongs. Only one frame plan
may be defined for each signal program.
- Data: After the second $-line there can be any number of lines, each containing a
parameter name (consisting of the letter P and a number between 1 and 999) and the
(integer) value of that parameter. >
$- - - - - - - - - - - -
P1 777
P10 3
$PARAMETER -------------
program_number: 2
$- - - - - - - - - - - -
P3 333
P10 0
$STARTING_STAGE ------------------------------------------------------------------------
< The stage the logic will start with. When using independent stages wiithin the same
logic, more than one starting stage may be defined. >
$- - - - - - - - - - - -
stage_1
$INTERSTAGE ----------------------------------------------------------------------------
length [s] :3
from stage :1
to stage :2
< Definition of an interstage. There can be multiple sections of this type. Each
interstage that is called from VAP must be defined here. In turn, for every stage
transition not more than one interstage can be defined. The format is:
- Keyword $INTERSTAGE
- Data section 1 including the following keywords:
- interstage_number : <nr> (optional)
This option is useful for applications with partial interstages where such an
interstage is then called by its number. Then the from stage and to stage
values may be set to 0 (meaning not relevant) so that this interstage will
not be considered during the check for running stages.
- length : duration of interstage (in seconds)
- from stage : no. of the stage where the interstage starts from
- to stage : no. of the stage wwhere the interstage leads to
- any commentary (after the keyword to stage until the next $-sign)
- Data section 2: Signal group data. One row for each signal group that is switched
during that interstage. Signal groups that don't change do not have to be included.
The format of each line is: <signal group> <red end> <green end>. The red end and
green end times are relative to the start time of the interstage. The only exeptions
are the two numbers -127 and 127 which are used as symbol for minus infinity and
plus infinity:
-127 means that a signal group is already green before the interstage starts
127 means that a signal group stays green after the interstage ends. >
$- - - - - - - - - - - - - -
K1 -127 0
K2 3 127
$INTERSTAGE ----------------
Interstage_number : 12
length : 10
from stage :2
to stage :1
$- - - - - - - - - - - - - -
K1 5 127
K2 -127 0
$END -----------------------------------------------------------------------------------
< Keyword to tell VAP that the PUA file is finished. >