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
- Hardware Measuring Range Configuration in STEP 7 HW Config
- How Channel Drivers Process Unipolar vs Bipolar Ranges
- Analog Input Signal Range and Integer Mapping Table
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
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:
- 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-27648to+27648.
- In this bipolar configuration, a raw integer input of0corresponds exactly to the mathematical midpoint (0.0 V).
- If the driver block is parameterized with nominal engineering limitsScale.Low = 0.0andScale.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:
- Open HW Config in SIMATIC Manager.
- Double-click the analog input module (e.g., ET 200M
6ES7331-7KF02-0AB0or6ES7331-7TF01-0AB0). - Navigate to the Inputs tab.
- Select the problematic channel group:
- Change Measuring type to4DMU(4-wire transducer) or2DMU(2-wire transducer).
- Change Measuring range from+/- 10Vto4..20 mA(or0..20 mA). - 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').
- 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:
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
- SIMATIC Process Control System PCS 7 Advanced Process Library (A5E39177307)
- SIMATIC Distributed I/O Device ET 200M Manual (A5E00088780)
- SIMATIC S7-300 / S7-400 Module Data Manual (A5E00105505)
Related Articles
- Evaluating SIMATIC PDM Requirements for HART Field Devices in SIMATIC PCS 7
- Integrating Field Instrumentation with the SIMATIC PCS 7 SITRANS Library
- Understanding OCM Attribute Constraints and Structure Tag Generation in SIMATIC PCS 7
Related Tags
- Channel Driver
- CH_AI
- FbAnIn
- Analog Scaling
- HW Config