SIWAREX WP321 Calibration Errors on CPU 1215C: Multi-Module Setup
When three SIWAREX WP321 weighing modules (Siemens order number 7MH4960-2AA01) are operated on a SIMATIC S7-1200 CPU 1215C through three independent instance data blocks, the automatic calibration path driven from an HMI such as the KTP1000 Basic frequently stalls: the module accepts the command number, but the calibration weight value is rejected or the command never reaches a terminal state. The failure is almost always a command/data-record routing issue, not a load-cell issue. This reference documents the underlying data record protocol, the role of DR 3 (calibration weight 0), the proper WRREC/RDREC parameterization for multiple HW_IDs, and the verification sequence that restores a working three-module installation.
7MH4960-2AA01 is the SIWAREX WP321 (ET 200SP), not the older WP231 (S7-1200 direct plug-in, 7MH4960-2AA01 shares the same MLP but the firmware/data record layout differs). The original Siemens example program at SIWAREX WP321 example program (entry ID 66825585) targets the WP321. Confirm the article number in the TIA Portal device view before applying any of the steps below.1. System Architecture Overview
The reference configuration is:
- 1 × SIMATIC S7-1200 CPU 1215C (firmware ≥ V4.2 for full WP321 support; V4.4 recommended).
- 3 × SIWAREX WP321 modules, order number
7MH4960-2AA01, mounted either in the CPU's signal board / left connector or in an ET 200SP station on PROFINET. - 3 × load cells per WP321 (full-bridge, 1–4 mV/V), terminated on the module's front connector.
- 1 × KTP1000 Basic HMI on the same PROFINET subnet, communicating with the S7-1200 via S7 communication.
- 1 × TIA Portal project with one instance FB (WP321_PE / WP321_WP) and three independent DBs (e.g.,
DB_WP321_SCALE_1,DB_WP321_SCALE_2,DB_WP321_SCALE_3).
Each WP321 occupies a slot in the device configuration and is assigned a unique PROFINET device name and a unique hardware identifier (HW_ID) under System constants in TIA Portal. The HW_ID is what the WRREC and RDREC system blocks use to route a data record to a specific physical module; it is not the same as the module's diagnostic address or input address.
2. How the WP321 Receives Calibration Commands
The SIWAREX WP321 exposes its parameter, command, and process interface exclusively through PROFIBUS/PROFINET data records. There is no direct I/O byte for "start calibration" — the HMI or user program must:
- Write the calibration parameters to
DR 3(calibration weight 0 / nominal weight) and toDR 4(calibration weight 1) as required. - Write a command code to
DR 2to trigger the calibration step. - Poll the command state by reading
DR 2and the module status by readingDR 0andDR 1.
Per the WP321 manual (SIWAREX WP321 function manual, A5E33715669-02):
- The command area of
DR 2uses a fixed coding: command code 2000 + 3 = 2003 addresses the data record number 3 of the module. The pattern is2000 + nfor read-side addressing, and4000 + nfor write-side addressing of the sameDR n. - Writing to a data record:
4000 + nwith the relevant payload. - Reading a data record:
2000 + nreturns the current contents ofDR n.
| DR | Name | Direction | Code | Purpose |
|---|---|---|---|---|
| 0 | Process / status word | Read | 2000 | Live weight, status bits, error code |
| 1 | Process / status word ext. | Read | 2001 | Extended status, fine weight, command state |
| 2 | Command interface | Read/Write | 2002 / 4002 | Trigger and observe command execution |
| 3 | Calibration weight 0 | Read/Write | 2003 / 4003 | Nominal/reference weight for adjustment |
| 4 | Calibration weight 1 | Read/Write | 2004 / 4004 | Second reference weight (multi-point cal.) |
| 5–9 | Calibration digits / zero / span | Read/Write | 200x / 400x | Raw counts, zero setpoint, span |
DR 3 (calibration weight 0) is zero, contains an uninitialized value, or was written to the wrong module's HW_ID, the module silently rejects the calibration command or returns CMDCODE = 0xFFFF with status "command not processable". The HMI may show "calibration started" because the HMI wrote the request, but the module never completes the adjustment.3. Why the Standard Example Breaks with Three Modules
The Siemens sample project (entry ID 66825585) instantiates a single WP321 FB with a single instance DB and a single HW_ID. To scale to three modules, engineers typically copy the instance DB three times and change two parameters at each call site:
-
LADDR(orHWi_IDin newer library versions) — input address of the module. -
HW_ID— the symbolic constant from the device configuration that uniquely identifies the slot.
That is the correct top-level approach, but three errors are common in the field:
-
Symbolic HW_ID collision. The constant from System constants must be re-resolved after each module is added. If the engineer copy-pastes the first module's HW_ID variable into the second/third call, both calls route
WRREC/RDRECto the same module. - Single instance DB used for command state. The example FB stores the last command number, command state machine, and result bytes in its instance DB. If the same DB is referenced for all three scales, the second and third calibrations overwrite the first's command state mid-execution, producing "command in progress" / "no command in progress" flicker on the HMI.
-
HMI tag binding not duplicated. The KTP1000 tag database still points to the original module's
DR 3symbolic tag, so two of the three scales never receive their calibration weight at all.
4. Diagnostic Procedure
Run the following checks in order. Each step ends with a pass/fail decision that points to the next action.
4.1 Verify module identity and firmware
- Open the S7-1200's Online & Diagnostics view in TIA Portal.
- Expand Distributed I/O and confirm each WP321 reports order number
7MH4960-2AA01and firmware version compatible with TIA Portal V16+ (typical field firmware is V1.x for WP321; V1.3+ is recommended). - Capture the Module Information > Status screen. A WP321 reporting diagnostic interrupt "channel error" or "parameter assignment error" will reject all data-record writes until cleared.
Pass: three modules online, no diagnostic alarms. Fail: clear alarms first (usually a missing load-cell terminator, mismatched full-bridge impedance, or unassigned HW identifier) before continuing.
4.2 Confirm distinct HW_IDs
- In the project tree, select PLC > System constants.
- Filter the constant list for the substring
WP321or the module name. - There must be exactly three HW_ID constants, one per slot, and the symbolic name must follow the pattern
<Head module name>~WP321~HW_ID(or the equivalent local constant name generated by TIA Portal).
Pass: three unique constants. Fail: the modules are likely mapped to the same PROFINET device or the project was not recompiled after adding modules 2 and 3.
4.3 Confirm three instance DBs are wired
- Open the cyclic OB (typically
OB1orOB35). - Confirm three calls of the WP321 FB exist, each with its own instance DB and its own
HW_IDinput. - Watch the three DBs in the watch table simultaneously. Each call must toggle its
Done,Busy, andErrorbits independently.
Pass: independent state machines. Fail: the same DB is being reused; create three new instance DBs and re-wire the calls.
4.4 Read DR 0 / DR 1 from each module
From the watch table, force a one-shot RDREC against each module's HW_ID with RECORD = 0 and RECORD = 1. Verify:
- All three return non-zero, non-static data.
- No module returns all-zero payload (would indicate the read landed on a non-existent slot or wrong device).
- Weight bits change when a calibrated test weight is placed on the scale.
4.5 Read DR 2 to confirm command interface
- From the HMI, start calibration on scale 2 only (leave scales 1 and 3 idle).
- Watch
DR 2on scale 2 in the watch table. The command code should appear immediately, the busy bit should clear, and the result byte should report success. - Repeat for scale 1 and scale 3.
If the command code never appears in DR 2 of the selected module but does appear in the other module's DR 2, the HW_ID wiring is wrong. If the command code appears but Error is set with reason "invalid calibration weight", DR 3 was not written correctly.
5. Step-by-Step Resolution
5.1 Replicate the FB and DB correctly
In the project tree under Program blocks:
- Duplicate the WP321 instance DB three times:
DB_WP321_1,DB_WP321_2,DB_WP321_3. - Open each call of the WP321 FB in
OB1and assign the matching instance DB. - Set the
HW_IDinput on each call to the matching constant from System constants. Do not paste the same constant into all three calls.
5.2 Build the HMI command path
The HMI should not write directly to DR 2. Use an S7 tag that the FB exposes for "start calibration", and let the FB assemble the data-record write. In the KTP1000 tag list:
- Three start bits, one per scale:
SCALE_n.START_CAL. - Three reference-weight tags:
SCALE_n.REF_WEIGHT_0, bound to a numeric input field that updatesDR 3on each entry. - Three status fields:
SCALE_n.CMD_STATEandSCALE_n.LAST_ERRORbound from the FB's outputs.
5.3 Drive DR 3 from the FB before each command
Extend the WP321 FB (or use the official "Siwarex" library block) so that the calibration sequence is:
- Write the user-entered calibration weight to
DR 3usingWRRECwithHW_ID= the scale's identifier andRECORD = 3. - Wait for
WRREC.Done= TRUE andWRREC.Error= FALSE. - Write command code 5 (calibration with weight 0) or 6 (calibration with weight 1) to
DR 2. - Wait for command completion by polling
DR 2viaRDREC; the result byte should reach the success state defined in the manual. - Update the FB's
Done,Busy,Error, andCmdStateoutputs.
5.4 Sample SCL skeleton
The following Structured Control Language fragment shows the multi-module routing pattern. Adapt the type names to your installed library version.
// Scale 1
WRREC_DB.WP321[1](REQ := SCALE_1.START_CAL,
LADDR := SCALE_1.HW_ID,
RECNUM := 3,
RECORD := SCALE_1.REF_WEIGHT_0_BUF,
DONE => SCALE_1.DR3_DONE,
BUSY => SCALE_1.DR3_BUSY,
ERROR => SCALE_1.DR3_ERROR,
STATUS => SCALE_1.DR3_STATUS);
// Trigger the calibration command on DR 2 after DR 3 has latched
IF SCALE_1.DR3_DONE AND NOT SCALE_1.DR3_ERROR THEN
WRREC_CMD_DB.WP321[1](REQ := TRUE,
LADDR := SCALE_1.HW_ID,
RECNUM := 2,
RECORD := CMD_CAL_W0, // command code 5
DONE => SCALE_1.CMD_DONE,
BUSY => SCALE_1.CMD_BUSY,
ERROR => SCALE_1.CMD_ERROR,
STATUS => SCALE_1.CMD_STATUS);
END_IF;
Repeat the same pattern for SCALE_2 and SCALE_3, each with its own WRREC call and its own HW_ID constant. Do not share a multi-instance FB output across scales; the WP321 command state is per-module and must remain so.
6. Verification Checklist
After the corrections, run this end-to-end check before releasing the machine:
- Power-cycle the S7-1200 and the ET 200SP station so the WP321 modules come up with a known-clean state.
- From the KTP1000, enter a 100.00 kg reference weight on scale 1 and press Start Calibration. The status field should transition: Idle → Sending DR 3 → Sending command → Calibrating → Done.
- Place a 100 kg test weight on scale 1. The process display should read 100.00 kg ± the module's specified accuracy class (typically ±0.05% for WP321).
- Repeat for scale 2 and scale 3. Each must transition through its own state machine independently.
- Read
DR 0from each module and confirm the weight signal is stable, non-zero, and tracks applied load. - Trigger a "taring" command on each scale; verify zero is set, then remove the test weight and confirm the display returns to 0.00 kg with no drift.
- Power-cycle again. Re-read
DR 3on each module; the calibration weight value must persist (it is stored non-volatile in the module), proving the write reached the correct physical module.
7. Troubleshooting Matrix
| Symptom on HMI / logs | Likely cause | Remediation |
|---|---|---|
| HMI shows "calibration started" but DR 2 never reports command running | WRREC routed to wrong HW_ID; HMI writes to first scale's DB only | Verify three distinct HW_ID constants in System constants; duplicate the HMI tags per scale |
| Command executes but module returns "invalid calibration weight" | DR 3 not written, contains zero, or contains float-typed value where integer is required | Use the FB's DR 3 write step before each command; convert reference weight to the WP321 fixed-point representation |
| Calibration succeeds on scale 1 only | Two of three modules share an instance DB | Create three independent instance DBs and re-wire FB calls |
| Intermittent "no command in progress" / "command in progress" flicker | Single shared command state tag for all scales | Expose per-scale CmdState output from the FB; bind to per-scale HMI tag |
| WP321 reports diagnostic interrupt "parameter assignment error" | HW identifier mismatch after TIA Portal recompile | Recompile hardware configuration, download to CPU, restart WP321 modules |
| Module appears offline in TIA Portal | PROFINET device name not assigned to the third ET 200SP station | Assign PROFINET name via Online > Accessible Devices; verify topology in the project |
| DR 3 read returns data from scale 1 for all three calls | LADDR input uses I/O address (e.g., 256) which is not unique per slot | Use the symbolic HW_ID constant, not the diagnostic/I/O address |
| Taring works but calibration does not | DR 3 write is conditional on a bit that the calibration path never sets | Trace the logic; ensure the calibration step sets the DR 3 write enable before triggering DR 2 command |
8. Parameter Reference
| Parameter | DR | Value range | Default | Notes |
|---|---|---|---|---|
| Calibration weight 0 | 3 | 0.0001 – 999999.0 (unit as configured) | 0 | Nominal weight for span adjustment |
| Calibration weight 1 | 4 | 0.0001 – 999999.0 | 0 | Second reference for multi-point cal. |
| Zero setpoint | 5 | 0 – 999999.0 | 0 | Preload offset |
| Adjustment command code | 2 | 5 = cal w/ weight 0; 6 = cal w/ weight 1; 9 = taring; 10 = delete taring; 16 = zero setting | — | Refer to manual section on commands |
| Command state | 2 (read) | 0 = idle; 1 = running; 2 = done; 0xFFFF = error | 0 | Poll until state ≠ 1 |
9. WP231 vs WP321 Distinction
Field engineers frequently mix up the two modules. The WP231 is the older S7-1200-direct module (order 7MH4960-2AA01 in some catalogs, distinct from the WP321 7MH4960-2AA01), while the WP321 is the ET 200SP variant. The data-record command codes are similar but not identical:
-
WP231: command interface in
DR 2, weight 0 inDR 10, weight 1 inDR 11. -
WP321: weight 0 in
DR 3, weight 1 inDR 4; command interface inDR 2with the same 2000/4000 prefix convention.
If the project loads the WP231 example onto WP321 hardware (or vice versa), the command sequence is accepted but the calibration weight value is never written, because the DR numbers do not align. Always confirm the module variant by reading the order number from the device label, not from a generic catalog page.
10. Common Command Codes
| Code | Function | Required DR writes before command |
|---|---|---|
| 5 | Calibration with weight 0 | DR 3 |
| 6 | Calibration with weight 1 | DR 3, DR 4 |
| 9 | Tare (set current load as zero) | — |
| 10 | Delete tare | — |
| 16 | Automatic zero setting | — |
| 17 | Delete automatic zero | — |
| 21 | Restore factory calibration | — |
When the field report says "no command in progress" yet the HMI shows calibration "started", it usually means DR 2 was written to the wrong module's HW_ID and the selected scale never received the command. The HMI is observing the local DB state ("command sent from PLC"), not the module's DR 2 echo.
11. Safety and Operational Notes
12. Related Documentation
- SIWAREX WP321 function manual (PDF, A5E33715669-02)
- ET 200SP manual collection, SIWAREX WP321 chapter
- SIWAREX WP321 sample project (entry ID 66825585)
FAQ
Why does automatic calibration fail on only two of three WP321 modules?
Almost always because the HMI tags and the WRREC calls share a single HW_ID or a single instance DB. Each scale needs its own HW_ID constant from System constants, its own instance DB, and its own set of HMI tags (reference weight, start, status). After correcting the wiring, run step 4.4 to confirm all three DR 0 reads return unique data.
What data record holds the calibration weight on a WP321?
Calibration weight 0 is in DR 3, calibration weight 1 is in DR 4. They are written with the 4000 + n code convention (i.e., 4003 for writing DR 3) and read back with 2000 + n (i.e., 2003 for reading DR 3). The reference weight must be written before command code 5 or 6 is issued via DR 2.
Is the WP231 example program compatible with the WP321?
No. The DR numbering differs (WP231 uses DR 10/11 for weights 0/1; WP321 uses DR 3/4), and the example project at entry ID 66825585 targets the WP321 specifically. Loading the WP231 program onto WP321 hardware causes the calibration step to be silently ignored because the module never receives the reference weight at the expected DR offset.
How do I read the command state during calibration?
Read DR 2 via RDREC with the scale's HW_ID. The command byte returns 0 when idle, a non-zero value while running, 2 on success, and 0xFFFF on error. Poll until the value is no longer "running" before issuing the next command on the same or any other module.
Why is the calibration weight value 0 when I send it from the HMI?
Two common reasons: (1) the HMI tag is bound to a DB offset that has not been initialized, so the float value transmitted is zero; (2) the HMI writes a Real (32-bit float) but the WP321 expects the value in its internal fixed-point format, and the conversion is missing. Insert a trace on the WRREC input RECORD to confirm the payload is non-zero and correctly scaled before the command is sent.
Can I share a single instance DB across all three WP321 modules?
No. The instance DB stores the command state machine, last error, and result bytes. If two modules share it, the second module's WRREC overwrites the first module's state mid-execution, producing indeterminate calibration results and HMI status flicker. Always allocate one instance DB per module and re-wire the HW_ID input at each call site.