38
5756B
Call Description:
The initialization function (FC 20) is called during the PLC
startup (OB 100). Its task is to synchronize the PLC and the
controller board. In addition, it enters operating parameters
required by other functions (FC) in the INTERBUS data block
(e.g., transfer of base addresses). When the controller board
and the INTERBUS system have been started, the function
will be terminated. After parameterizing the controller board
and starting the INTERBUS system, the function resets the
activation bit (BUSY = 0). The RET bit indicates the result.
With RET = 0, the INTERBUS system has been started and
is ready for operation. If the RET bit is set (RET = 1), an error
occurred. The diagnostic display and IBS CMD show the
cause of error.
For further information please refer to the
IBS SYS DIAG DSC UM E Diagnostics Guide.
Program Sequence of FC 20
AN
M10.0
S
M10.0
CALL FC20
// Call initialization function
IBDB
:= DB20
// INTERBUS data block
COM_ADR
:= 256
// S7 base address of the controller
board
DIAG_STATE := 0
// Not used
DIAG_PARA
:= 0
// Not used
FKN_START
:= 0
// Not used
FKN_PARA
:= 0
// Not used
FKN_STATE
:= 0
// Not used
MEM_READ
:= 21
// Number of the "Read" driver
MEM_WRITE
:= 22
// Number of the "Write" driver
LOAD
:= 0
// Setting: Loading the configuration
BOOT
:= 0
// INTERBUS startup
MODE
:= 0
// Controller board operating mode
TIMER_NR
:= T1
// Occupied timer
SOURCE
:= 0
// Not used
CONFIGURA-
TION
:= DW#16
#80000
00F
// Basic settings
RET
:= M10.1 // Result bit
BUSY
:= M10.0 // Activate FC 20