Modbus Rtu Master Communication (Send); Writing Data To External Device - Panasonic FP-XH Series User Manual

Hide thumbs Also See for FP-XH Series:
Table of Contents

Advertisement

6.3 MODBUS RTU Master Communication (SEND)

6.3 MODBUS RTU Master Communication (SEND)

6.3.1 Writing Data to External Device

Procedure
PLC has the transmission right in master communication, and master communication is
performed by sending commands to, and receiving responses from, devices that support
MODBUS-RTU. Data can be written by specifying unit numbers and memory addresses and
executing F145 (SEND) instruction in a user program, because PLC automatically creates
messages according to the protocol.
PLC
DT100
100
DT101
0
・・・・・・
・・・・・・・・
・・・・・・
・・・・・・・・
Sample program
● Send a command from COM1 port of the unit, and write the content of the data registers
DT100 to DT101 of PLC into the data areas 1000 to 1001 (H03E8 to H03E9) of an external
device (unit no. 1).
● Confirm that transmission is not in progress (SEND/RECV instruction execution flag R913C:
ON) for the same port, and start up SEND instruction.
● F145 (SEND) instruction is executed by specifying the port No., MODBUS command to be
used, the starting address of PLC memory area that stores data to be sent, unit number of a
destination unit, and the number of send data. Check addresses of destination devices in the
instruction manuals of devices.
R0
R913C
(Note 1)
The slave side may not be able to respond, when the scan time of PLC as a master unit is short and
interval between transmission sessions is short. In such cases, insert a timer instruction into the
execution conditions for instructions, and make the sending interval longer.
Code Description
SEND / RECV
(1)
instruction execution
flag
COM port No. of a
(2)
master unit
6-6
Command messages
(Hex) 01 10 03 E8 00 02 04 00 64 00 00(CRC)
(Hex) 01 10 00 00 00 02 (CRC)
Response messages
Perform writing by specifying Unit number and
address using the SEND instruction
F146 SEND
H1601
H1601
This is inserted to confirm that no SEND / RECV instruction is in progress for
the same port. Turns ON when an instruction is executable.
Specify a COM port No. for Bit 15 to Bit 12 of control data.
DT100
K1000
External devices that
support MODBUS-RTU
1000
100
1001
0
・・・・・・
・・・・・・・・
・・・・・・
・・・・・・・・
Execution of SEND
K2
instruction
WUME-FPXHCOMG-02

Advertisement

Table of Contents
loading

Table of Contents