RTC
®
4 PC Interface Board
Rev. 1.3 e
5 Advanced Programming
45
innovators for industry
5.6 Structured Programming
The command set of the RTC
®
4 includes a number of
list commands for controlling program flow:
•
•
•
•
•
•
Together with the control commands
, this
allows structured list programming and execution.
Input Pointer
To write a list of commands to a particular location
in the RTC
®
4 list memory, the command
(instead of the commands
_1 /_2
).
The command places the input pointer at any address
in the range [0 … 7999]. The next list command will
be written to this address.
The current position of the input pointer can be inter-
rogated by calling the command
List Jumps
The command
defines
a jump to the specified address. During execution,
the RTC
®
4 jumps to this address.
Similarly, the command
defines a jump
to a subroutine (sub-list). The sub-list has to be
terminated with the command
The main list must be terminated with the command
.
Conditional List Jumps
Conditional list jumps and subroutine calls can be
programmed via the commands
and
: The current value of the 16-bit digital
input port at the EXTENSION 1 connector is read and,
depending on its value, a subroutine is called or a
jump within a list is executed (also see
).
Output Pointer
To start execution at a particular address, the
command
be used. The RTC
®
4 starts execution immediately.
Execution stops when a
command is
encountered. If the end of the list buffer is reached,
the RTC
®
4 continues at the address zero.
If the external start signal (see the section
allows definition
of the start address for the external list start.
• These commands use the RTC
®
4 list memory as
a single list buffer with a total capacity of 8000
entries. Each command in the list buffer has a
unique
address
in the range [0 … 7999].
Caution!
• If the end of the list buffer is reached during
writing of a list, the input pointer is reset to
zero, i.e. the next list command is written to the
address zero.
• Make sure not to overwrite any commands
which are still needed by your application.
Caution!
• If the end of the list buffer is reached during
execution (and if the last command is not a
continues at the address zero.