Communication with External Devices
FP2 Serial Data Unit
4 − 19
4.4 Sample Program
Notes
• Contents of the response:
If K100 is stored in DT0 and K200 is stored in DT1 of the FP
series PLC on the other side, “%01$RD6400C800F1C
R
”is
returned from the FP series PLC on the other side as the
response when the program is executed. The received data is
stored in the data registers as shown below.
DT0
H25
(%)
H30
(0)
H31
(1)
H24
($)
H52
(R)
H44
(D)
DT1DT2DT3
H36
(6)
H34
(4)
H30
(0)
H30
(0)
H0D
(C
R
)
DT4
DT8
H31
DT7
H30
(0)
H30
(0)
DT6
H43
(C)
H38
(8)
DT5
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Value of DT0 in the PLC on the other side
H46
Value of DT1 in the PLC
on the other side
(F)(1)
BCC
• Extracting the data register values from the PLC on the other
side
In the program, the data segment of the response from the PLC
on the other side is converted to hexadecimal data using the
F72 (AHEX) (hexadecimal ASCII ∋ HEX conversion) instruction
and stored in DT50 and DT51, only if the character “$1” stored
in DT1 detected as a comparison instruction.
DT3
H36
(6)
H34
(4)
H30
(0)
H30
(0)
DT4
H30
(0)
H30
(0)
DT6
H43
(C)
H38
(8)
DT5
16 Hexadecimal ASCII ∋
DT50
H64
(K100)
H00HC8
(K200)
H00
DT51
Value of DT1 in the PLC
on the other side
Value of DT0 in the PLC
on the other side
Value of DT1 in the
PLC on the other side
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Upper
byte
Lower
byte
Value of DT0 in the
PLC on the other side
HEX conversion
If an error occurs, “%01! O O ϕϕ C
R
” is returned as the
response. (O O is the error code and ϕϕ is the BCC.)