Modbus Rtu Master Communication (Recv); Reading Data From External Device - Panasonic FP-XH Series User Manual

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

Advertisement

6.2 MODBUS RTU Master Communication (RECV)

6.2.1 Reading Data from 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 read by specifying unit numbers and memory addresses and
executing F146 (RECV) 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 the COM1 port of the unit, read data from the data areas 1000 to
1001 (H03E8 to H03E9) of an external device (unit No. 1), and write the data into the data
registers DT100 to DT101 of PLC.
● Confirm that transmission is not in progress (SEND / RECV instruction execution flag
R913C: ON) for the same port, and start up RECV instruction.
● F146 (RECV) instruction is executed by specifying the port No., MODBUS command to be
used, unit number of a destination unit, the number of receive data, and the starting address
of PLC memory area that stores 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
WUME-FPXHCOMG-02

6.2 MODBUS RTU Master Communication (RECV)

Command messages
(Hex)01 03 03 E8 00 02 (CRC)
(Hex)01 03 04 00 64 00 00 (CRC)
Response messages
Perform reading by specifying Unit number and
address using the RECV instruction
F146 RECV
H1301
H1301
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.
K1000
K2
DT100
External devices that
support MODBUS-RTU
1000
100
1001
0
・・・・・・
・・・・・・・・
・・・・・・
・・・・・・・・
Execution of RECV
instruction
6-3

Advertisement

Table of Contents
loading

Table of Contents