SIWAREX U Weight Value Scaling to REAL in TIA Portal
The SIWAREX U is a single-channel weighing electronics module for the SIMATIC S7-200 automation system. It digitizes load-cell signals at 10 Hz (high resolution) or 50 Hz and reports a stable, calibrated weight to the PLC as an integer (DINT/INT) value. The standard application library exposes these values through the SIWA_FB (FB45) function block, with two main outputs: a calibrated GROSS_WEIGHT integer (delivered at parameters GROSS1/GROSS2) and the uncalibrated raw digit value (delivered at FLT_RAW1/FLT_RAW2). This reference explains how to interpret both outputs, perform a one-time two-point calibration, and convert the integer weight value to a REAL for use in HMI comparisons, setpoint coils, and recipe math.
1. SIWAREX U Module Overview
The SIWAREX U (order number 7MH4950-1AA01 and successors) is installed to the right of the S7-22x CPU and occupies one slot in the expansion rack. The module communicates with the CPU through the I/O bus; no additional fieldbus coupler is required. Per the SIWAREX U Device Manual (Edition 38), the analog front end resolves load-cell bridge excitation at 5 V DC and returns a signed 16-bit filtered ADC value that the module firmware scales into engineering units (kg, g, t, lb) based on the calibration parameters you store inside the module.
The two channels exposed in the FB are not physical inputs; rather, CHANNEL 1 and CHANNEL 2 are two independently maintained weight values (e.g., gross and net, or scale 1 and scale 2 if two weighing platforms are connected through a summing junction). For most compact bin/silo installations only CHANNEL 1 is used.
2. FB45 (SIWA_FB) Data Layout
FB45 (SIWA_FB) is the standard S7-200 function block that wraps the SIWAREX U. It must be instantiated once per module and called in the main OB1 cycle. The block handles handshaking, command dispatch, and parameter reads/writes through the analog I/O image.
| FB45 Output | Data Type | Meaning | Range |
|---|---|---|---|
GROSS1 |
INT | Calibrated weight, channel 1 | Engineering units (kg, g, t) as configured |
GROSS2 |
INT | Calibrated weight, channel 2 | Engineering units (kg, g, t) as configured |
FLT_RAW1 |
WORD | Filtered raw ADC digits, channel 1 | 0 to 65535 (live ≈ 2427 to 63107) |
FLT_RAW2 |
WORD | Filtered raw ADC digits, channel 2 | 0 to 65535 (live ≈ 2427 to 63107) |
NET_WEIGHT |
INT | Net weight (GROSS - TARE), if tare active | Engineering units |
STATUS_WORD |
WORD | Module status / error flags | Bit-mapped (see manual §6) |
For typical HMI displays, recipes, and coil comparisons, use GROSS1 directly. The FLT_RAW1 value is useful only for diagnostic, custom scaling, and trial-weight calibration before a formal adjustment has been stored in the module.
3. Calibration Fundamentals: The 2427 and 63107 Digit Reference
Every SIWAREX U module has two intrinsic digit endpoints that the firmware uses to derive the calibration curve:
-
0% load (dead load only, scale empty): the filtered ADC digit value
2427corresponds to the no-load bridge condition. This value varies slightly per cell and per installation, which is why a per-site zero-point calibration is mandatory. -
100% load (sum of nominal loads of all parallel cells): the filtered ADC digit value
63107represents the combined rated capacity of all load cells wired in parallel. The span (gain) of the module is normalized to this fixed end point.
These endpoints are not user-entered. The module uses them internally to build the characteristic curve that the device manual describes in §5.1. The user-entered parameters are simply the two stored digit values captured during a two-point calibration, and the engineering-unit range configured in the module parameters.
4. Selecting the Calibration Weight (5% Rule)
Per the device manual and confirmed in the field, the minimum calibration weight is 5% of the sum of nominal loads of all load cells connected in parallel to the module's sense leads.
| Load Cell Configuration | Sum of Nominal Loads | Minimum Calibration Weight |
|---|---|---|
| 1 x 50 kg | 50 kg | 2.5 kg |
| 3 x 100 kg | 300 kg | 15 kg |
| 4 x 200 kg (silo) | 800 kg | 40 kg |
| 1 x 5 t (tank) | 5,000 kg | 250 kg |
Although 5% is the documented minimum, the practical accuracy of the curve improves substantially as the calibration weight approaches 50% to 100% of the total nominal load. For a 50 kg platform the easiest field procedure is to use the rated load itself as the calibration weight whenever mechanical access allows.
5. Step-by-Step Calibration Procedure (HMI or Siwatool)
The two-point calibration stores two reference digit values inside the module: zero adjustment digits and adjustment digits. A separate zero setting digits parameter is reserved for the zeroing command (a runtime tare of the current empty-scale reading), not for the calibration curve itself.
-
Define the calibration weight. On the HMI calibration screen (delivered with the SIWAREX example TIA project, e.g.,
Siwarex_U_Template.ap13) or in Siwatool, enter the numerical value of the calibration weight in the configured engineering unit (kg by default). - Send the changed parameter to the SIWAREX U. Press the Send/Write button. The FB45 command dispatcher will move the new weight to the module's parameter block.
- Calibrate the zero point. With the scale empty (only the dead load of the bin, hopper, vessel, or platform on the cells), press the Calib. zero point button. The current filtered digit value is captured and stored as the Zero adjustment digits parameter.
- Calibrate the defined weight. Place the calibration weight on the scale and wait for the digit value to stabilize. Press the Calib. defined weight button. The current filtered digit value is captured and stored as the Adjustment digits parameter.
After step 4, the module internally constructs the characteristic curve between the two captured digits and the fixed 2427 / 63107 reference, and the GROSS1 output begins reporting weight in the configured engineering unit. You do not need to read or manipulate the digit values manually; they are bookkeeping entries for the firmware.
zeroing command for calibration. The zeroing command writes the current digit value into Zero setting digits, which is a runtime tare offset applied on top of the calibration curve. It does not move the calibration zero point. Use it only for a one-shot tare of the empty vessel during production, never as a substitute for the two-point adjustment.6. Converting GROSS_WEIGHT INTEGER to REAL in S7
The GROSS1 output is a 16-bit signed integer (INT, range -32768 to +32767) when displayed in the default engineering unit without any decimal shift. In STEP 7 Micro/WIN and TIA Portal for S7-200, the canonical three-instruction conversion chain is:
// STL (S7-200 / Micro/WIN)
L MW100 // Load GROSS1 (INT, e.g. from VB/VW mapped area)
ITD // INT to DINT (sign extend)
DTR // DINT to REAL (IEEE 754 single precision)
T MD102 // Store REAL to MD102 / VD102
For SCL in TIA Portal (S7-1200/1500 used as gateway CPU) the equivalent is:
// SCL (TIA Portal)
#iWeight_INT : INT;
#diWeight_DINT : DINT;
#rWeight_REAL : REAL;
#diWeight_DINT := INT_TO_DINT(#iWeight_INT);
#rWeight_REAL := DINT_TO_REAL(#diWeight_DINT);
If your engineering unit uses two decimal places (e.g., display in kg with 0.01 kg resolution) and the module is configured to transmit the scaled integer in hundredths, divide the REAL by 100 before use:
#rWeight_kg := #rWeight_REAL / 100.0;
Always confirm the module's Decimal places parameter (default 0) before doing division scaling. A wrong divisor is the single most common source of factor-of-100 reading errors on SIWAREX U integrations.
7. Using FLT_RAW for Trial-Weight Custom Scaling
If you have not yet performed a formal calibration (or you deliberately want to display a custom unit relative to a known test weight), the FLT_RAW1 output can be processed directly. The procedure is:
- Read
FLT_RAW1with the scale empty. Record value D0. - Place a known test weight W on the scale.
- Read
FLT_RAW1after stabilization. Record value D1. - Compute the scale factor k = (D1 - D0) / W in digits per engineering unit.
- For any future raw reading D, weight = (D - D0) / k.
Example from a typical 50 kg platform with one 50 kg cell:
- D0 = 10000 digits (empty hopper + dead load)
- Place 25 kg test weight, D1 = 25000 digits
- Span per kg = (25000 - 10000) / 25 = 600 digits/kg
- Full load 50 kg = 10000 + 50 * 600 = 40000 digits
This method is acceptable for visualization, prototype work, and OEM machines with a known fixed load. For trade-legal or accuracy-critical applications, perform the formal two-point adjustment in §5 instead.
8. STL and SCL Code Examples
Example A — Direct INTEGER-to-REAL conversion of GROSS1 in STL:
NETWORK 1 // Read GROSS1 and convert to REAL for HMI
L IW0 // GROSS1 mapped to process input word 0
ITD // Sign-extend INT to DINT
DTR // DINT to REAL
T MD100 // REAL weight stored in MD100
Example B — SCL function for HMI tag with safety clamp:
FUNCTION "FC_Weight_REAL" : Void
VAR_INPUT
iWeight_INT : INT; // GROSS1
iMax_kg : INT; // Mechanical max, e.g. 60
iMin_kg : INT; // Mechanical min, e.g. -10
END_VAR
VAR_OUTPUT
rWeight_kg : REAL;
bOutOfRange : BOOL;
END_VAR
BEGIN
#rWeight_kg := INT_TO_REAL(#iWeight_INT);
IF #rWeight_kg > INT_TO_REAL(#iMax_kg)
OR #rWeight_kg < INT_TO_REAL(#iMin_kg) THEN
#bOutOfRange := TRUE;
ELSE
#bOutOfRange := FALSE;
END_IF;
END_FUNCTION
Example C — Toggling between gross and net for fill control:
// In a periodic OB (e.g. OB1 or OB35)
IF "bTareActive" THEN
// Use NET_WEIGHT output of FB45
"rDisplay_kg" := INT_TO_REAL("NET_WEIGHT");
ELSE
"rDisplay_kg" := INT_TO_REAL("GROSS1");
END_IF;
9. HMI Calibration Screens in the Sample Project
The SIWAREX U example project for TIA Portal (search the Siemens Support portal for Siwarex U sample project S7-200) ships a pre-built HMI faceplate with the following touch targets:
- Numeric input field: Calibration weight (engineering units)
- Numeric display fields: Zero setting digits, Zero adjustment digits, Adjustment digits (read-only diagnostic)
- Buttons: Calib. zero point, Calib. defined weight, Zeroing, Send parameters
For first-time commissioning the recommended path is:
- Wire the load cells; energize the system; let the SIWAREX warm up for ≥ 5 minutes.
- Open the HMI faceplate; enter the calibration weight; press Send.
- With the scale empty, press Calib. zero point. The current digit value is shown in the Zero adjustment digits field.
- Place the calibration weight; press Calib. defined weight. The current digit value is shown in the Adjustment digits field.
- Remove the calibration weight. The GROSS1 display should now read 0 (or the dead-load mass if you configured a non-zero zero offset).
Reuse the same HMI faceplate to issue the runtime Zeroing command during production to tare a partially filled bin.
10. Troubleshooting Matrix
| Symptom | Likely Cause | Verification | Corrective Action |
|---|---|---|---|
| GROSS1 reads 0 in all states, FLT_RAW1 ≈ 2427 | Wiring polarity reversed at one or more cells | Measure cell output with multimeter at SIWAREX sense terminals | Swap signal + and - at the affected cell |
| GROSS1 saturates at 32767 with empty scale | Wrong sense lead wiring or open bridge | Check 5 V excitation present, cell resistance 350-1100 Ω | Re-wire per manual §3 wiring diagram |
| Weight reads correctly at zero, off by factor of 100 with test weight | Decimal place parameter mismatch | Read module parameter Decimal places via Siwatool | Set Decimal places to 0 and remove the /100 in the PLC, or set to 2 and add /100 |
| GROSS1 drifts with temperature | Mechanical binding or thermal load on platform | Observe FLT_RAW1 trend over 30 min, scale empty | Improve mechanical guidance; verify no sun exposure; rerun zero calibration |
| GROSS1 stable, FLT_RAW1 stable, but reading is 2-3% high | Calibration weight too small (close to 5% minimum) | Compare actual used weight to 5% rule calculation | Repeat calibration with ≥ 20% of nominal load |
| GROSS1 shows negative values for empty scale | Zero set to a non-zero digit or zeroing command issued with material on scale | Read Zero setting digits parameter | Execute Calib. zero point with empty scale, then Zeroing if needed |
| Weight oscillates ±2 kg on a 50 kg platform | Mechanical vibration or low-pass filter disabled | Check parameter Filter setting (low / medium / high) | Set filter to medium or high per manual §5.4 |
| STATUS_WORD bit 0 set, GROSS1 frozen | Module-internal command in progress | Wait 2 s; verify no command is hanging | Re-issue Calib. zero point or power-cycle module |
11. Verification Procedure
After a successful calibration and REAL conversion, perform these checks before releasing the system to production:
-
Zero check. With the scale empty, observe
GROSS1in the HMI for 60 s. It must remain within the resolution of the configured unit (e.g., ±0.1 kg on a 50 kg platform with two decimals). - Span check. Place a test weight of ≥ 50% of nominal load on the scale. The displayed weight on the HMI must match the test weight within the SIWAREX U accuracy class (typically ±0.05% of the calibrated span per the device manual).
- Linearity check. Repeat with 25% and 75% of nominal load. The error at each point must remain within the accuracy class envelope.
-
REAL conversion check. In TIA Portal, add a watch table on
MD102/VD102. The float value must equal the integer value ofGROSS1with no truncation or sign error (negative values for under-range conditions). - Decimal scaling check. Add 0.1 kg, observe the HMI. The integer must advance by the correct number of counts (10 if two decimals configured, 1 if no decimals).
-
Long-term drift check. Log
GROSS1over 24 h with a known fixed load. The maximum deviation is the system's true repeatability.
12. Field-Proven Best Practices
- Always run the calibration from the HMI or Siwatool, never by writing digits manually. The stored digit values are easy to corrupt; let the module's command dispatcher capture them.
- Use the largest practical calibration weight. A 50% calibration weight delivers roughly an order of magnitude lower zero-point error than a 5% calibration weight, at no hardware cost.
- Perform the zero-point calibration after the mechanical installation is complete, with all piping, agitators, and peripheral dead load attached. The 2427 reference assumes the dead load is present.
- Use shielded twisted pair from each load cell; ground the shield at the SIWAREX end only. Floating shields are a frequent source of 50/60 Hz interference on FLT_RAW1.
- For S7-200 CPUs the analog I/O mapping is fixed by slot position. Verify in the project that
GROSS1is at the expected process input word (commonlyIW0for the CPU's first expansion slot). - Do not place the integer GROSS1 directly into a comparison that is sensitive to a single LSB of noise. Round the REAL value (e.g.,
rWeight := ROUND(rWeight_kg * 10.0) / 10.0;) before driving a coil.
Following the procedure in §5, the conversion in §6, and the verification in §11, the SIWAREX U delivers a stable, calibrated weight in engineering units that is straightforward to consume in HMI displays, recipe setpoints, and PLC control logic. The raw digit outputs remain available as a powerful diagnostic tool whenever a custom scaling or trial-weight validation is required.
FAQ
Can I tell the SIWAREX U to display 0 to 50 kg directly?
No. The SIWAREX U has no parameter to enter an engineering range. The displayed range is determined by the sum of nominal loads of the cells you wire in parallel and the calibration weight you store during the two-point adjustment. To get 0 to 50 kg on the display, use a 50 kg cell (or a parallel combination whose nominal total is 50 kg) and calibrate against a known weight in that range.
What do the digit values 2427 and 63107 mean?
2427 is the firmware reference for 0% load (scale with dead load only). 63107 is the firmware reference for 100% load (sum of nominal loads of all cells in parallel). The module builds the calibration characteristic curve between these endpoints and the two digit values you store via the Calib. zero point and Calib. defined weight commands.
What is the minimum calibration weight?
5% of the sum of nominal loads of all cells. For three 100 kg cells the minimum is 15 kg. Using 20% to 50% of nominal load is recommended for higher absolute accuracy.
How do I convert GROSS_WEIGHT (INT) to REAL in S7-200?
Use the three-instruction chain: L MW100 / ITD / DTR / T MD102. This loads the integer, sign-extends it to a DINT, converts the DINT to IEEE 754 single-precision REAL, and stores it. In TIA Portal SCL the equivalent is INT_TO_DINT followed by DINT_TO_REAL.
Should I use GROSS1 or FLT_RAW1 for my application?
Use GROSS1 (or GROSS2) for any application that requires an engineering-unit weight in kg, g, t, or lb. The GROSS outputs are valid only after a successful two-point calibration. Use FLT_RAW1 only for diagnostics, custom scaling experiments, or when no formal calibration has been performed yet. The raw value is the uncalibrated ADC digit count and requires manual span computation in the PLC.