S7-1200 Belt Scale: Material Weight Calculation Using Load Cell

David Krause11 min read
S7-1200SiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

1. Belt Scale System Overview

A conveyor belt scale (also called a belt weigher, dynamic scale, or in-line checkweigher) determines the mass of bulk material transported on a moving belt by simultaneously measuring two physical quantities and multiplying them. The two sensors used on the original reference application — a T100A-class conveyor scale (Slovenian manufacturer) and a shaft-mounted speed sensor — feed an S7-1200 controller that runs the integration math.

The fundamental belt scale equation is:

q [kg/m]   = belt load (mass per unit length)
v [m/s]    = belt linear speed
Q [kg/s]   = q × v                (instantaneous mass flow)
Q [t/h]    = q × v × 3.6          (instantaneous mass flow, metric tons per hour)
M [kg]     = Σ (q × v × Δt)       (totalized material weight, integrated over time)

The accuracy of the integrated weight is bounded by the accuracy of the load-cell calibration, the speed sensor resolution, the idler spacing, the belt tension profile, and the cycle time of the controller. A properly designed S7-1200 system using a SM 1231 16-bit analog input module and the on-board high-speed counter (HSC) can achieve OIML R50 class 0.5 accuracy when commissioned correctly.

2. Sensor Selection and Signal Types

Sensor Measurand Common Output Notes
Compression load cell in weigh idler Belt load (kg or kg/m) 0–20 mV/V (analog) or 4–20 mA via transmitter Bridged into 350 Ω or 700 Ω strain gauge network
Single-point bending beam Belt load 0–20 mV/V or 4–20 mA Lower cost, but more sensitive to off-center loading
Inductive proximity + toothed wheel Belt speed NPN/PNP pulse, 4–24 V Typical: 1 pulse per tooth, 8–60 teeth
Incremental encoder on tail pulley Belt speed HTL (push-pull) or TTL, A/B quadrature Higher resolution; recommended for high accuracy
Wheel-driven tachometer Belt speed Reed switch or Hall, 0–24 V pulse Slip can occur; not preferred for class 0.5 systems

The S7-1200 HSC supports up to 200 kHz on the CPU 1217C and 100 kHz on the CPU 1214C/1215C, which is more than adequate for any belt scale speed sensor up to 60 pulses per revolution at 3 000 rpm.

3. S7-1200 Hardware Configuration

For a belt scale application, select the controller and I/O modules to match the sensor count and update rate.

Module Function Catalog Number Notes
CPU 1215C DC/DC/DC Main controller with on-board HSC 6ES7215-1AG40-0XB0 (FW 4.5+) 14 DI / 10 DQ / 2 AI on-board
SM 1231 AI 4×13 bit Cost-effective analog input for load cell transmitter 6ES7231-4HD32-0XB0 ±10 V, 0–20 mA, 4–20 mA selectable
SM 1231 AI 4×16 bit Higher accuracy analog input for direct mV/V load cell 6ES7231-5ND32-0XB0 ±80 mV, ±250 mV, ±500 mV, ±1 V, ±2.5 V ranges
SM 1231 AI 8×RTD/TC Optional for thermocouple-based load cell trim 6ES7231-5PF32-0XB0 For temperature compensation
SB 1231 AI 1×12 bit Single-channel signal board for compact panels 6ES7231-4HA30-0XB0 Slot at CPU right side
CSM 1277 (optional) Ethernet switch for remote I/O or HMI 6GK7277-1AA10-0AA0 4 × RJ45 unmanaged
Note: The 16-bit SM 1231 (±80 mV range) is mandatory when the load cell is connected directly without a transmitter. Using a 4–20 mA loop powered by a dedicated transmitter is acceptable and provides better noise immunity over long cable runs.

4. Wiring the Load Cell and Speed Sensor

A four-wire or six-wire load cell is wired as follows. Six-wire (sense-line) connection is recommended because the sense leads compensate for cable resistance drift, especially over long runs to a remote scale.

Load cell (6-wire) → SM 1231 AI 4×16 bit terminal block
  Pin 1  EXC+  (excitation +)   →  M+/V+ on module
  Pin 2  EXC-  (excitation -)   →  M-/V- on module
  Pin 3  SIG+  (signal +)       →  Channel+ (I+/I+)
  Pin 4  SIG-  (signal -)       →  Channel- (I-/I-)
  Pin 5  SEN+  (sense +)        →  Sense+ terminal
  Pin 6  SEN-  (sense -)        →  Sense- terminal

For 4–20 mA transmitters, the SM 1231 AI 4×13 bit module is sufficient. Connect the transmitter's positive terminal to the channel I+ and the negative terminal to channel I-; jumper the 24 V supply from the CPU to the transmitter.

Speed sensor wiring to the on-board HSC input of the CPU 1215C:

Encoder/tach PNP output → CPU input I0.0 (HSC1, A-track)
Encoder/tach 0 V        → CPU terminal 1M (common)
24 V supply             → CPU terminal 24V (sensor power)

For quadrature encoders use I0.0 (track A) and I0.1 (track B) on HSC1. Configure the HSC in the device configuration for "Count external" with evaluation at 1×, 2×, or 4×.

5. TIA Portal Project Configuration

Open TIA Portal V18 (or later), create a new project, and add the S7-1200 station matching the ordered hardware. Perform the following configuration steps.

  1. Add the CPU and SM 1231 modules in the device view. The device configuration must reflect the physical rack so the analog input addresses align.
  2. Open Properties → Analog inputs on the SM 1231 AI 4×16 bit module. Set Channel 0 to the appropriate voltage range (typically ±10 mV/V × excitation = 0–20 mV range) and enable diagnostics for wire break if the transmitter supports it.
  3. Set the smoothing factor on the analog channel to "Weak", "Medium", or "Strong". For belt scale, "Medium" (a software filter constant of 4) is usually a good starting point; "Strong" may cause under-reading at high belt speeds.
  4. Configure the high-speed counter on the CPU. Go to Properties → High-speed counter (HSC) and enable HSC1. Set type to "Count", input to "Single phase", and initial/final values. Enable the interrupt on CV = RV (compare value reached) for periodic sampling.
  5. Set the analog input conversion cycle. The SM 1231 AI 4×16 bit defaults to an integration time of 50 Hz (20 ms). For dynamic belt applications, set the rejection frequency to 60 Hz (16.67 ms) to filter mains noise.

6. SCL Program for Flow Calculation

Implement the following code blocks. A cyclic interrupt OB is preferred over OB1 because it gives deterministic sampling and decouples the integration from the main scan time.

OB30 — Cyclic interrupt, 100 ms (10 Hz) execution

// =========================================================
// Belt scale material flow calculation
// Cyclic OB, 100 ms update period
// =========================================================

// 1) Read raw load cell value from AI channel
#LoadCell_Raw  := %IW64;                  // 16-bit raw value, +/-27648
#LoadCell_mV   := INT_TO_REAL(#LoadCell_Raw) / 27648.0 * 20.0;  // mV at full scale
#LoadCell_kg   := #LoadCell_mV * #ScaleGain_kg_per_mV;          // calibrated load

// 2) Convert HSC frequency to belt speed
//    Pulses per second from HSC1 period measurement
#HSC_Count     := "HSC1".Count;           // current count value
#Speed_Hz      := #HSC_Count / #TimeBase; // pulses per second
#BeltSpeed_m_s := (#Speed_Hz * 3.14159 * #PulleyDiameter_m) / #PulsesPerRev;

// 3) Compute belt load per unit length (kg/m)
#Load_kg_per_m := #LoadCell_kg / #IdlerLength_m;

// 4) Compute instantaneous material flow
#Flow_kg_s     := #Load_kg_per_m * #BeltSpeed_m_s;
#Flow_t_h      := #Flow_kg_s * 3.6;

// 5) Integrate totalized weight
IF #Reset_Totalizer THEN
    #TotalWeight_kg := 0.0;
    #TotalWeight_t  := 0.0;
ELSE
    #TotalWeight_kg := #TotalWeight_kg + (#Flow_kg_s * 0.1);  // Δt = 0.1 s
    #TotalWeight_t  := #TotalWeight_kg / 1000.0;
END_IF;

// 6) Output scaling (engineering units to HMI)
"DB_BeltScale".Flow_kg_s     := #Flow_kg_s;
"DB_BeltScale".Flow_t_h      := #Flow_t_h;
"DB_BeltScale".BeltSpeed_m_s := #BeltSpeed_m_s;
"DB_BeltScale".Load_kg_per_m := #Load_kg_per_m;
"DB_BeltScale".TotalWeight_kg := #TotalWeight_kg;
"DB_BeltScale".TotalWeight_t  := #TotalWeight_t;
"DB_BeltScale".Sample_OK     := TRUE;

FB_BeltScaleCalib — Calibration function block

// Calibration procedure:
// 1) Empty belt (zero load): capture zero offset
// 2) Apply known calibration weight (chain or test masses):
//      scale_gain_kg_per_mV = (cal_weight_kg) / (cal_mV - zero_mV)
// 3) Optional in-situ calibration using a static reference weight passed over the idler

FUNCTION_BLOCK FB_BeltScaleCalib
VAR
    bZeroCal       : BOOL;     // trigger zero calibration
    bSpanCal       : BOOL;     // trigger span calibration
    rCalWeight_kg  : REAL;     // known calibration mass
    rCal_mV        : REAL;     // measured mV with cal weight on belt
    rZero_mV       : REAL;     // measured mV with empty belt
END_VAR
BEGIN
    IF #bZeroCal THEN
        #rZero_mV := INT_TO_REAL(%IW64) / 27648.0 * 20.0;
        #bZeroCal := FALSE;
    END_IF;

    IF #bSpanCal THEN
        #rCal_mV := INT_TO_REAL(%IW64) / 27648.0 * 20.0;
        // store gain in scale gain tag
        "DB_BeltScale".ScaleGain_kg_per_mV :=
            #rCalWeight_kg / (#rCal_mV - #rZero_mV);
        #bSpanCal := FALSE;
    END_IF;
END_FUNCTION_BLOCK

7. Calibration Procedure

  1. Mechanical zero — run the belt empty for two full revolutions, then capture the load cell zero offset. This eliminates idler friction, belt tension effect, and cell creep.
  2. Speed calibration — run the belt at production speed and verify the measured linear speed against a hand-held tachometer or wheel reference. The difference should be below 0.5%.
  3. Span / weight calibration — apply a known chain or test weight to the weigh idler. For in-situ calibration, pass a static test mass over the idler at production speed and compare the integrated total to the known weight. The acceptable deviation for OIML R50 class 0.5 is ±0.5% of the material weight.
  4. Material test — run a defined quantity of bulk material across the scale. Weigh the same material on a static floor scale and compare the S7-1200 integrated total. Adjust the scale gain if the deviation exceeds ±0.25% over three runs.
Note: Belt tension between the tail pulley and the head pulley can change with material loading. Always re-zero the scale with the empty belt running, not with the belt stopped, because idler deflection differs.

8. Totalizer Reset and Persistence

Totalized material weight is a 64-bit value over a long production run. Use the following structure to avoid rollover and to survive power loss.

// 32-bit LREAL would lose precision after 9 trillion kg,
// but use two 32-bit DWords in a DB and store high/low word manually

// DB_BeltScale_Total (retentive)
TYPE "UDT_BeltScaleTotal" :
STRUCT
    Total_kg_Hi  : DINT;   // high 32 bits, retentive
    Total_kg_Lo  : DINT;   // low 32 bits, retentive
    Total_kg_REAL: LREAL;  // optional, computed on read
END_STRUCT
END_TYPE

Mark the data block as retentive in the device configuration so the totals survive a power cycle. Provide a protected reset function (operator HMI button plus password) to clear the registers.

9. Diagnostics and Error Handling

Symptom Possible Cause Diagnostic Step Corrective Action
Flow reads 0 when belt is loaded Speed sensor wiring reversed or HSC not enabled Watch HSC1.Count in online view Verify A/B wiring, enable HSC in CPU properties
Flow reads negative Load cell signal polarity reversed Apply known weight, observe raw count direction Swap SIG+ and SIG- on SM 1231
Drift over 24 hours Load cell creep or temperature change Monitor zero mV with empty belt Re-zero at scheduled shift change
Totalizer drifts without material Zero offset non-zero or speed sensor noise Check load cell zero with belt stopped Implement deadband: suppress integration when |load| < threshold
SM 1231 wire-break diagnostic Load cell cable damage or connector loose Check device diagnostics in TIA Inspect cable, retighten connector, replace cell
HSC shows 0 frequency Encoder not powered or wrong voltage level Measure 24 V at encoder terminals Verify PNP/NPN compatibility with CPU input type
Belt speed reads high PPR (pulses per revolution) value wrong Compare hand tachometer reading Adjust #PulsesPerRev parameter in DB

10. SVG Flow Diagram of the System Topology

Load Cell (T100A) mV or 4–20 mA SM 1231 AI 16-bit %IW64 S7-1200 CPU 1215C OB30 / FB_BeltScale HMI / SCADA flow / total Speed Sensor PNP / HTL pulse CPU HSC1 (I0.0) frequency PROFINET

11. Verification and Acceptance Test

After mechanical installation, electrical wiring, and TIA Portal commissioning, perform a structured acceptance test to confirm the system meets accuracy requirements.

  1. Run the belt empty for ten minutes. Confirm flow reads 0 ±0.05 kg/s and totalizer does not advance.
  2. Run the belt at production speed with no load. Confirm the measured belt speed matches the nameplate within 0.5%.
  3. Pass a known calibration weight three times. Confirm totalizer reads within ±0.25% of the expected value.
  4. Pass a known bulk quantity (weighed on a certified static scale) through the conveyor. Confirm the S7-1200 integrated weight matches the static reading within the configured class tolerance (typically ±0.5% for OIML R50 class 0.5).
  5. Trigger a power cycle. Confirm the totalizer retains the cumulative weight across power loss.
  6. Trigger the reset function. Confirm both the high and low DWords of the totalizer return to zero and the reset is logged in the HMI audit trail.

12. Cross-Reference: Siemens Application Example

Siemens publishes an application example for this exact use case — calculating the material quantity passing a conveyor belt with a speed sensor and weighing module. The example ships as a STEP 7 Manager V5.x project; the same SCL logic is portable to TIA Portal V18 with minor naming changes. Refer to the official Siemens Industry Online Support article ID 23061633 for the original downloadable project, FB block source, and signal list: Siemens Support Article 23061633 — Belt Scale Material Calculation.

For HSC programming details see the S7-1200 Programmable Controller System Manual: Siemens S7-1200 System Manual (entry ID 109751049).

What is the minimum S7-1200 firmware for belt scale totalization?

Firmware V4.0 is the minimum supported version for the SM 1231 AI 4×16 bit module (6ES7231-5ND32-0XB0) and for the cyclic interrupt OB. Siemens recommends V4.5 or later for full TIA Portal V18 compatibility and LREAL support in SCL.

How fast should the cyclic OB run for an accurate belt scale?

Run OB30 at 100 ms (10 Hz) for typical bulk applications. Faster sampling (50 ms or 20 ms) is possible but rarely necessary; slower sampling (200 ms) begins to show integration error on fast belts exceeding 2 m/s.

Do I need a 4–20 mA transmitter or can I wire the load cell directly?

Direct connection requires the SM 1231 AI 4×16 bit module with the ±10 mV, ±20 mV, or ±80 mV range. Use a transmitter if the cable length exceeds 10 m, if the installation is in a high-noise environment, or if the load cell has built-in signal conditioning.

How is totalized weight retained across a power loss?

Mark the data block containing the totalizer DWords as retentive in the device configuration. The S7-1200 retains up to 14 KB of retentive data on power loss, which is more than enough for two 32-bit totalizer registers plus scaling parameters.

What accuracy can I expect from an S7-1200 belt scale?

With proper mechanical installation, calibrated load cell, and an encoder-based speed sensor, a typical system achieves ±0.25% to ±0.5% of totalized weight, qualifying for OIML R50 class 0.5. Class 0.2 (0.2% accuracy) requires a high-resolution load cell, matched idlers, and temperature compensation.

Back to blog