Writing Registers - Siemens SIWAREX WP251 Manual

Electronic weighing system
Table of Contents

Advertisement

Communication with SIMATIC S7-1200
11.2 Communication via Modbus
Example
A parameter from data record 3 (DR 3) is to be read.
● First, write register CMD3_CODE with 2003 (2000 plus the number of the data record =
read data record).
● Then write CMD3_TRIGGER with "1". The DR 3 is then updated in the Modbus buffer
memory.
● It is now possible to read one or more registers with the corresponding variable(s). The
data consistency of the registers read at this time is guaranteed.
You can find all further command numbers in chapter → Command lists (Page 179).
Example
A current measured value is to be read out from DR 30.
⇒ The register can be directly requested because its contents are automatically refreshed in
the SIWAREX module at the specified measuring rate of 100 Hz and are always available
up-to-date.
11.2.6

Writing registers

If you wish to write registers from the data records DR 3 to DR 29, you must first export the
corresponding data record to the internal output buffer using an appropriate command.
Individual registers can then be written. The complete data record must subsequently be
written internally using an appropriate command. A plausibility check of the complete data
record is carried out in the process.
Example
A parameter from DR 3 is to be written.
● First, write register CMD3_CODE with 2003 (2000 plus the number of the data record).
● Then write CMD3_TRIGGER with "1". The DR 3 is then updated in the Modbus memory.
● It is now possible to write or modify one or more registers with the corresponding variable.
If you wish to transfer the written/changed registers to the scale, it is necessary to write
the complete data record:
● First, write register CMD3_CODE with 4003 (4000 plus the number of the data record =
write data record).
● Then write CMD3_TRIGGER with "1".
● The data record is then transferred to the process memory in the SIWAREX module. All
registers of the data record are checked for plausibility in the process.
If the plausibility check fails, the complete data record is not written and a message is output
to the user (from the area of data/operator errors).
You can find all further command numbers in chapter → Command lists (Page 179).
In addition, an online document is available for working with SIWAREX WP251 and Modbus
→ Modbus communication of WP251 (http://support.automation.siemens.com).
196
SIWAREX WP251
Manual, 12/2015, A5E37203357A

Advertisement

Table of Contents
loading

Table of Contents