7.4.2. Data exchange between PLC program and
diagnostic slave
The system functions SFC14 (DPRD_DAT) and SFC15
(DPW R_DAT) can be used to exchange data with the
diagnostic slave.
Accessing the diagnostic slave via PLC program:
Example: Reading diagnostic data and saving in DB100
starting from DBB0.
The memory address of the diagnostic slave (see hardware
configuration) is 256 (100hex). The error code will be saved
in MW 0.
CALL "DPRD_DAT"
LADDR := w#16#100
RET_VAL:=MW0
RECORD :=P#DB100.DBX 0.0 BYTE 32
Example: Send data from DB101 starting from DBB0 to the
diagnostic slave.
The memory address of the diagnostic slave (see hardware
configuration) is 256 (100hex). The error code will be saved
in MW 2.
CALL "DPW R_DAT"
LADDR := w#16#100
RECORD :=P#DB101.DBX 0.0 BYTE 32
RET_VAL:=MW2
Controlling the diagnostic slave:
The byte 0 of the transmitting data (DB101.DBB0 in the
above example) can be used to select the diagnostic entries
of the radio (Display page 0 to 7).
Set DBB1 to
“1” to clear the counters of the corresponding
display page. If you like to clear all counters call page 255.
Chapter 7
– Diagnostic slave