Troubleshooting Unipolar vs Bipolar Scaling Mismatches in SIMATIC PCS 7 Analog Channel Drivers

Troubleshooting Unipolar vs Bipolar Scaling Mismatches in SIMATIC PCS 7 Analog Channel Drivers

In SIMATIC PCS 7 systems utilizing standard analog channel drivers like CH_AI or APL FbAnIn, unexpected output offsets—such as reading 750 on a 0 to 1500 scale when the raw input integer is zero—occur when the hardware configuration measuring range does not match the driver block scaling mode. While legacy libraries provided manual unipolar/bipolar parameter switches, modern PCS 7 drivers derive unipolar or bipolar behavior directly from the module configuration in STEP 7 HW Config. Configuring an analog input card for a bipolar range (+/-10V) when wired to a unipolar 4–20 mA instrument causes the driver to interpret zero as the 50% midpoint.

Table of Contents

Analog Signal Conditioning and S7 Integer Quantization

In SIMATIC S7-400 and distributed ET 200 I/O architectures, analog input modules convert continuous physical process variables into 16-bit signed integers:
- Standard Unipolar Measuring Ranges (e.g. 4–20 mA, 0–20 mA, 0–10 V): The module maps the active nominal measuring span to integer values from 0 to 27648.
- Standard Bipolar Measuring Ranges (e.g. +/-10 V, +/-20 mA): The module maps the span symmetrically around zero, spanning integer values from -27648 to +27648.

When raw peripheral integers are read by the automation program, channel driver blocks (CH_AI from the classic PCS 7 library or FbAnIn from the Advanced Process Library) translate this raw representation into an engineering value scaled between the configured high limit (Scale.High) and low limit (Scale.Low).

Hardware Measuring Range Configuration in STEP 7 HW Config

In PCS 7 V8.1 and V8.2, channel driver blocks do not feature manual 'polar/bipolar' selection pins. Instead, the driver block reads system data blocks (SDBs) generated by HW Config:

  1. The Origin of the 50% Offset:
    - If an engineer configures an analog input channel in HW Config as a Voltage Bipolar input (+/- 10V), the controller expects raw counts spanning -27648 to +27648.
    - In this bipolar configuration, a raw integer input of 0 corresponds exactly to the mathematical midpoint (0.0 V).
    - If the driver block is parameterized with nominal engineering limits Scale.Low = 0.0 and Scale.High = 1500.0, the block calculates:
    $$\text{Output} = \text{Low} + 0.5 \times (\text{High} - \text{Low}) = 0.0 + 0.5 \times 1500.0 = 750.0$$
    - Consequently, when 0 mA or 0 V is applied, the channel output displays 750.0 instead of 0.0.

How Channel Drivers Process Unipolar vs Bipolar Ranges

To correct the scaling offset, the hardware configuration must be aligned with the physical transmitter:

  1. Open HW Config in SIMATIC Manager.
  2. Double-click the analog input module (e.g., ET 200M 6ES7331-7KF02-0AB0 or 6ES7331-7TF01-0AB0).
  3. Navigate to the Inputs tab.
  4. Select the problematic channel group:
    - Change Measuring type to 4DMU (4-wire transducer) or 2DMU (2-wire transducer).
    - Change Measuring range from +/- 10V to 4..20 mA (or 0..20 mA).
  5. Ensure the physical measuring range coding modules (range keys on the side of S7-300 analog cards) are mechanically set to match the software configuration (e.g., position 'C' or 'D').
  6. Save and compile HW Config, download to the AS controller, and execute Generate Module Drivers.

Analog Input Signal Range and Integer Mapping Table

The following table details raw S7 integer mappings across standard industrial signal ranges:

Measuring TypePhysical Input SpanRaw S7 Integer RangeMidpoint Value (Raw 0)S7 Overflow / Wire Break4..20 mA (Unipolar)4 mA to 20 mA0 to 276484 mA = 0< 3.6 mA (-32768) Wire Break0..20 mA (Unipolar)0 mA to 20 mA0 to 276480 mA = 0< 0 mA (Negative underflow)0..10 V (Unipolar)0 V to 10 V0 to 276480 V = 0< -0.3 V Underflow+/- 10 V (Bipolar)-10 V to +10 V-27648 to +276480 V = 0 (Midpoint)> +11.85 V or < -11.85 V Overflow+/- 20 mA (Bipolar)-20 mA to +20 mA-27648 to +276480 mA = 0 (Midpoint)> +23.7 mA or < -23.7 mA Overflow

Note: S7 integer 27648 corresponds to 100% of nominal span across all standard Siemens analog modules.

Verification

Verify analog channel scaling accuracy:
1. In HW Config, confirm the channel measuring range is set to 4..20 mA.
2. Connect a calibrated 4–20 mA current calibrator to the module terminals.
3. Inject 4.0 mA; verify that the channel driver output PV_Out reads 0.0 with Quality Code 16#80 (Good).
4. Inject 12.0 mA; verify that PV_Out reads 750.0 (exact 50% midpoint).
5. Inject 20.0 mA; verify that PV_Out reads 1500.0 (100% full scale).
6. Disconnect the signal wire (<3.6 mA); verify FbAnIn flags wire break Bad = True with Quality Code 16#00.

Limitations and Operational Precautions

Essential rules for analog channel engineering:
- Downloading hardware configuration changes to active analog modules requires stopping the controller unless Configuration in RUN (CiR) is utilized.
- Always verify that the physical measuring range keys on the side of ET 200M analog cards match the software configuration in HW Config; mismatches will cause thermal damage or incorrect ADC conversions.
- Never compensate for incorrect hardware measuring ranges by applying manual math offsets in CFC; correct the configuration at the HW Config source.

Engineer FAQ

Why did older PCS 7 versions have a bipolar input on the block?

Legacy Standard Library blocks (e.g. CH_AI in PCS 7 V5/V6) lacked automatic hardware SDB interrogation and required manual boolean parameters to select unipolar or bipolar calculation modes.

What happens if a 4-20 mA loop drops to 0 mA on a module set to 4-20 mA?

The module detects wire break / underflow and outputs raw integer -32768. The channel driver immediately sets Bad = True and substitutes the parameterized fail-safe value.

Can I use negative engineering scales with unipolar inputs?

Yes. You can configure Scale.Low = -50.0 and Scale.High = +50.0 for a 4–20 mA input; the driver will scale 4 mA to -50.0 and 20 mA to +50.0 linearly.

Technical References

Related Articles

Related Tags

  • Channel Driver
  • CH_AI
  • FbAnIn
  • Analog Scaling
  • HW Config
6 respuestas