User`s manual

98
FX3U Series Programmable Controllers
User’s Manual - MODBUS Serial Communication Edition
10 Creating Programs
10.3 Creating Programs for the Slave Station
For more details on Master Station instructions, refer to Chapter 8.
For cautions on program creation, refer to Section 10.4.
10.3 Creating Programs for the Slave Station
Create a program for the slave station with user defined MODBUS Device Address Assignment similar to the
example program in Section 9.4 of this manual.
Restart Communication with Slave 0x0A
M10
M8029
RST M10
Slave Address: 0x0A
Command Code: 0x08
Subcommand Code: 0x01
Subcommand Parameter: 0xFF00
(Reset Event Log)
Destination Device Head: R0
Communication is restarted between the
Master and Slave 0x0A, and the Slave
Communication Event Log and Event and
Error Counter is reset.
MOVP
K90 D10
MOVP
K150 D11
MOVP
K27 D12
MOVP
K31 D13
M20
M8029
Command Complete Flag
RST M20
Slave Address: 0x05
Command Code: 0x17
Write Address: 90 (D10)
Read Address: 150 (D11)
Write Count: 27 (D12)
Read Count: 31 (D13)
Source/Destination Device Head: D100
27 register device value starting at D100 of
the Master are written to MODBUS Address
90 and onward for Slave 5, and 31 register
device values starting at MODBUS Address
150 of Slave 5 are read to D127 and onward
for the Master.
Command Parameters:
D10 = 90
D11 = 150
D12 = 27
D13 = 31
Program for Reading/Writing Multiple Regtisters
Read/Write Multiple Registers from/to Slave 0x05
ADPRW H0A H8 H1 H0FF00 R0
ADPRW H5 H17 D10 D12 D100
Command Complete Flag
Program for Restarting Communication