26. FIRST SCAN FLAG
The first scan flag is a flag (T D64), which is set to 1 automatically during the first program cycle and
otherwise is 0. The first scan flag is used for program initialization. Register R 0899 also provides the
first scan functions:
T D64
R 0899
Example
INIT
LDAA
BEQ
:
:
:
INIR
RTS
In the ladder diagram the first scan flag can be connected to the enable input of function blocks which
are supposed to be executed only once during the program's first cycle.
NOTE:
The B&R PROgramming SYStem command "XFER" allows programs to be
downloaded to the CPU without interrupting the application program running in the
RAM of the CPU.
The user must switch to the new program manually with a command from the program-
ming device. In this case neither the first scan flag or the first scan register are set
during the first program cycle of the new program!
Since the First Scan flag and register are not set, caution is bid when using interrupt
routines or B&R MININET.
The address of the interrupt routine is not updated after a program change, if the
definition is made in the initialization routine.
First Scan Flag (1 = first program cycle)
First Scan Register (1 = first program cycle)
Z D64
First Scan
INIR
Branch, if already initialized
Initialization
B&R COMPACT PLC
- 229 -