Instruction And Examples - LG MASTER-K 120S Series User Manual

Programmable logic controller
Table of Contents

Advertisement

Chapter 8 Communication Functions
8.3.4 Instruction and example
1) MODBUS communication instruction(MODCOM)
MODCOM
MODBUS communication
Instruction
M
P
Ch
S1
S2
S3
Flag
Error flag turns on when designating area is over
Error
and the instruction isn't executed
(F110)
■ MODCOM
Ch
S1
(1) Example program
• Designate slave station No. , function code,.address, No. of reading
• When input condition(M0020) turns on, MODBUS communication starts.
• Receiving data are stored D1000, and communication status is stored to M100
• When operates as slave, MASTER-K120S responses to master station without commands. And When operates as master,
MASTER-K120S sends data in S1 with MODBUS protocol at rising edges of execution condition.
Available device
K
L
F
T
C
S2
S3
S
D
D
i n teger
#
Designation
Ch
Designated communication channel
S1
Device which is registered communication parameter
S2
Device which stored communication data
S3
Device which stored communication status
8-62
Flag
No. of
Error
Zero
steps
(F110)
(F111)
7
Carry
(F112)

Advertisement

Table of Contents
loading

Table of Contents