8.4 MODBUS RTU Master Communication (SEND)
8-9
8.4 MODBUS RTU Master Communication (SEND)
8.4.1 Write Data into an External Device
Instructions
In master communication, PLC has the sending right, and executes communication by
sending commands to devices that support MODBUS-RTU, and receiving responses.
Messages in accordance with the protocol are automatically generated by PLC. In the user
program, reading and writing can be done simply by specifying the station no. and memory
address and executing SEND/RECV instructions.
External device
supporting Modbus-RTU
(Hex) 01 10 00 00 00 02 04 00 64 00 00 (CRC)
(Hex) 01 10 00 00 00 02 (CRC)
Command message
Response message
DT100
100
DT101
0
・・・・・・
・・・・・・・・
・・・・・・
・・・・・・・・
40001
100
40002
0
・・・・・・
・・・・・・・・
・・・・・・
・・・・・・・・
PLC
Specify and write station no. and address based on SEND instruction
Sample program
Send commands from the COM1 port of the CPU unit, and write the content of PLC's data
register DT100 - DT101 into the data area of an external device (station no. 1) 40001 - 40002.
Confirm that the unit is in the master mode (XC), and that the sending process is not in
progress for the same port (YC), and start up the SEND instruction.
In the UNITSEL instruction, specify the slot No. (U0) and the COM. port No. (U1).
In the SEND instruction, specify and execute the PLC initial address (DT100), No. of data
(U2), MODBUS function code to be used (16: H10), partner device station no. (H01), and
initial address (H0). For the address of the partner device, please check operating
instructions, etc. of the relevant device.
R0
R100
UNITSEL
U0
U1
SEND.US
DT0
H1001
H0
DT100
U2
R100
Execute
SEND
Settings for communication port
S1: Slot 0 (U0)
S2: COM1 (U1)
SEND execution conditions
Clear to send flag: ON
Sending active flag: OFF
SEND process
S: Data saving area (DT100)
n: No. of sent data (U2)
D1: MODBUS code (H10) and
partner device station no. (H01)
D2: "Transmit to" address (H0)
D3: Execution result code (DT0)
Master
communication
Clear to send flag
XC
YC
Master
communication
Sending active flag
(
)
DF
S1
S2
S
n
D1
D2
D3
(Note 1) Operand [S1] of SEND instruction is specified by combining two hexadecimal digits of MODBUS function
code with two hexadecimal digits of partner device station no. When the MODBUS function code is 16, specify
H10 for [D1].
(Note 2) When the partner device is FP series PLC, Operand [S2] of SEND instruction can be specified using the
Device No.
(Note 3) The unit number and COM port number in the above program is applied when the COM.1 port of the CPU
unit is used.
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]
Содержание AFP7CCM1
Страница 1: ...Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 10: ...Table of Contents viii Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 21: ...2 Names and Functions of Parts Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 24: ...Names and Functions of Parts 2 4 Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 25: ...3 Wiring the COM Port Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 45: ...3 I O Allocation Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 52: ...I O Allocation 4 8 Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 57: ...6 PLC Link Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 97: ...9 General Purpose Communication Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 114: ...General Purpose Communication 9 18 Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 115: ...4 Troubleshooting Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 124: ...Troubleshooting 10 10 Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Страница 125: ...11 Specifications Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...