6.4.8.9
FC 16 - Preset Multiple Registers
This function enables the Modbus master to write several data words in a data block of
the CPU.
Please consider as soon as you want to access an area by writing, you
have to write enable the corresponding area by the protocol parameters
with the dialog "Limits".
Request message
ADDR
FUNC
start_register
quantity
byte_count n
n-Data
(High, Low)
CRC
Reply message
ADDR
FUNC
start_addr
quantity
CRC
The Modbus register address
start_register
is interpreted by the driver as follows:
start_register
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
start_register-offset_DB_no.
start_register-word_no.
n
The DB and the 1. data word of the CPU to be accessed, is defined by
start_register
.
n
The corresponding address allocation of the CPU memory area are established by
the properties of "FC 03, 06, 16" in the parameterization of the CP.
–
Here the fixed "Modbus address in transmission message" 0 may be assigned to
a Base-DB-Number in the "SIMATIC memory area".
n
Data block DB =
Base-DB-Number
+
start_register-offset_DB_no.
n
Data word DBW =
start_register-word_no.
x 2
Providing the resulting DB and the corresponding DBW to be read from is known
start_register
may be calculated with the following formula:
n
start_register
= (DB - Base-DB-Number) x 512) + (DBW / 2)
Please regard for DBW it is only allowed to use even numbered data
word numbers.
n
Any value between 1 and 127 is permitted as
quantity
(number of register).
–
It is valid: Maximum
quantity
= 512 -
start_register
byte_count n
(byte counter) is formed automatically due to the bit number.
start_register
Calculation
quantity
byte_count n
VIPA System 300S
Communication protocols
Modbus > Modbus Slave - Function codes
HB130 | CP | 341-1CH01 | en | 18-40
90