40 5756B
Functions Called in the OB 1
Functions FC 21 to read I/O data and FC 22 to write I/O data
are called in the OB 1.
Read Function FC 21 MEM_READ
Call Description:
Function FC 21 MEM_READ reads consistent data blocks
(data records) from the controller board buffer and copies
them to the selected address area of the PLC.
Program Sequence of FC 21:
Parameter Descriptions:
AN M10.0
S M10.0
CALL FC21 // Call read function
IBDB := DB20 // INTERBUS data block
MODE := 1 // Function operating mode
SOURCE := 0 // Not used
DEST_AREA := 0 // Not used
DEST_AREA_NR := 0 // Not used
DEST_OFFSET := 0 // Not used
DEST_LENGTH := 0 // Not used
RET := M10.1 // Result bit
BUSY := M10.0 // Activate FC 21
Parameter Value Meaning
IBDB DB 20 Global INTERBUS data block
MODE 1 Read data record 1 (set in
IBS CMD)
SOURCE 0 Not used
DEST_AREA 0 Not used
DEST_AREA_NR 0 Not used
DEST_OFFSET 0 Not used
DEST_LENGTH 0 Not used
RET M10.1 = 0: The function was
executed without errors.
= 1: An error occurred.
BUSY M10.0 Activate FC 21