Modbus Communication wp231 en
Modbus Communication wp231 en
Modbus Communication wp231 en
FAQs
SIWAREX WP231
“How does the Modbus-Communication of the WP231 work?”
Siemens.com/weighing
Answer: The SIWAREX WP231 weighing modules offer a Modbus-TCP/IP and
Modbus-RTU (RS485) communication. Please follow this FAQ in order to understand
the mechanisms of the Modbus communication.
This FAQ is based on the manual of the WP231, which is available online on:
http://support.automation.siemens.com/WW/view/en/65621196
Before using this document, please check the manual of the WP231 for the right wiring
of the 24V DC power supply, the loadcells, I/O’s and communication interfaces.
If you run the WP231 without a SIMATIC S7-1200 CPU, please check the position of
the “Stand-Alone-Mode” switch of the module:
2
The factory default settings of the Ethernet and Modbus-RTU interface of the WP231
are the following:
All parameters of the WP231 weighing module are integrated in data records. It‘s
possible to read or write a complete data record only! It‘s not possible to read or write
one single parameter within a data record.
Except the data records 30, 31, 32 and 34 (automatically refreshed) all data records
need to be read/written into the Modbus-Registers by using special command codes.
Please use the following syntax, in order to generate the right command code for
reading a data record from the WP231 into the Modbus-Register or for writing data
records from the Modbus-Registers into the WP231:
For all other commands like “Zero”, “Tare”, “Service Mode On”, “Service Mode off” and
so on, please check the command list in the WP231 manual in order to find the right
command codes!
3
Modbus-Registers SIWAREX WP231 data
(detailed information about the data records can be
found in the WP231 manual)
data record 4 – Auto. Calibration Digits data record 4 – Auto. Calibration Digits
data record 8 – Date and Time data record 8 – Date and Time
data record 17 – Control Analogue Out data record 17 – Control Analogue Out
data record 18 – Control Digital Outs data record 18 – Control Digital Outs
data record 31 – Process Status ext.* data record 31 – Process Status ext.*
data record 34 – ASCII Weight Display* data record 34 – ASCII Weight Display*
4
Example:
You want to change the parameter “Adjustment Weight 1” which is included in the data
record 3:
1.) As data record 3 is accessible with active “Service Mode” only, you have to activate
the “Service Mode”. You can find the right command code for this operation in the
command list in the manual. “Service Mode On” Command Code “1”
“Command_2_Code”
“Command_2_Trigger”
“Command_2_Finished”
“Command_2_FinishedError”
In order to switch on the Service Mode” you have to write “1” into the “command code 2”
(=Modbus Register 920) and to set the “command trigger 2” “TRUE” (=Modbus Register
921).
After that, the Service Mode should be active (DIAG led is flashing).
2.) If you don’t know, whether the data of data record 3 in the Modbus Registers are up-
to-date, you should read the record 3 from the WP231 into the Modbus-Registers first:
As you want to read data record 3, you have to use the command code 2003
(see page 3).
Therefore you have to write “2003” into the “command code 2” (=Modbus Register 920)
and to set the “command trigger 2” “TRUE” (Modbus Register 921=“1”).
3.) Now you can edit the “Adjustment Weight 1” (=Modbus Register 1024).
After that, you have to send the modified data record 3 from Modbus-Registers into the
WP231 you have to use the command code 4003 now (see page 3)!
Therefore you have to write “4003” into the “command code 2” (=Modbus Register 920)
and to set the “command trigger 2” “TRUE” (Modbus Register 921=“1”).
The modified data record 3 with your new Adjustment weight 1 is written into the WP231
now!
5
4.) At the end we have to switch off the Service Mode again.
“Service Mode Off” Command Code “2” (see command list in the manual)
Therefore you have to write “2” into the “Command Code 2” (=Modbus Register 920)
and to set the “Command Trigger 2” “TRUE” (Modbus Register 921=“1”).
The Service Mode should be off now (DIAG led shouldn’t be flashing anymore)!
Modbus-Command-Code Structures
* = read only
6