Problem Summary
A 4-20 mA pressure transmitter with a calibrated range of -10 to +10 PSI is wired to a Siemens S7 analog input module and scaled in the PLC using FC105 (SCALE). The scaled real value is displayed in a WinCC Flexible I/O field on a panel, but the HMI behaves as follows:
- At 4 mA (lowest current, should map to -10 PSI) the I/O field shows 0.
- At 20 mA (highest current, should map to +10 PSI) the I/O field shows the correct positive value.
- Negative values are never visible on the HMI even though the PLC tag temporarily shows the correct negative number during simulation.
The issue has been observed on WinCC Flexible 2008 SP3 / SP5 panels in combination with S7-300 / S7-400 CPUs using FC105/FC106 from the Standard Library. The same root cause applies to migrated projects on TIA Portal WinCC Comfort/Advanced when the legacy FC105 block is reused.
Root Cause Analysis
There are two independent failure layers, and both must be fixed to recover the full bipolar display.
Layer 1 — FC105 BIPOLAR input set to 1
The PLC engineer used the Standard Library block FC105 SCALE to convert the raw integer from the analog input card (0 to 27648) into the engineering range -10.0 to +10.0 PSI. The engineer mistakenly set the BIPOLAR input to 1 because the engineering range itself is bipolar (contains negative values).
BIPOLAR input on FC105 does not describe the polarity of the scaled output range. It describes the polarity of the raw integer input value coming from the analog input module. A 4-20 mA current loop is always unipolar: 4 mA maps to 0, 20 mA maps to 27648. Therefore BIPOLAR must be 0.When BIPOLAR = 1, FC105 expects the raw input integer in the range -27648 to +27648 and treats the half-scale point (0) as -10 PSI. The raw integer 0 (4 mA) therefore produces an output of -10 PSI in floating point, but the sign of the raw value is interpreted differently in the conversion math, and depending on the calling logic the value can clamp to zero or wrap, producing the observed behavior where 4 mA reads as 0 PSI on the HMI and the negative half of the range is never reached.
Layer 2 — WinCC Flexible I/O field format pattern
Even when the PLC tag holds the correct negative floating-point value, the I/O field will not render the minus sign unless the format pattern is signed. A pattern of 9999.9 is unsigned; the leading negative sign is suppressed, and a value of -10.0 is displayed as 10.0 (or as zero if the mask width is exceeded). The pattern must be s9999.9.
| Format Pattern | Value = -10.0 | Value = 0.0 | Value = 10.0 | Use Case |
|---|---|---|---|---|
9999.9 |
10.0 (or blank) | 0.0 | 10.0 | Unsigned display only |
s9999.9 |
-10.0 | 0.0 | 10.0 | Correct for bipolar scaled tag |
9999.99 |
10.00 (sign dropped) | 0.00 | 10.00 | Higher precision, still unsigned |
9999 |
10 | 0 | 10 | Integer, unsigned |
s9999 |
-10 | 0 | 10 | Integer, signed |
FC105 and FC106 Technical Reference
FC105 (SCALE) and FC106 (UNSCALE) are the legacy Siemens Standard Library blocks used on S7-300/S7-400 to linearize an analog raw value. They are documented in the Siemens Online Help entry Standard Library > TI-S7 Converting Blocks and the function manual S7-300/400 Standard and System Functions.
FC105 interface
| Parameter | Type | Meaning | Typical Value (4-20 mA → -10 to +10 PSI) |
|---|---|---|---|
| IN | INT | Raw value from analog input | 0 to 27648 |
| HI_LIM | REAL | Upper engineering limit | 10.0 |
| LO_LIM | REAL | Lower engineering limit | -10.0 |
| BIPOLAR | BOOL | 0 = unipolar input, 1 = bipolar input | 0 |
| RET | WORD | Return code / error word | 0 = OK |
| OUT | REAL | Scaled engineering value | -10.0 to +10.0 |
FC106 interface
FC106 performs the inverse operation. It is used when writing a real engineering value to an analog output.
| Parameter | Type | Meaning |
|---|---|---|
| IN | REAL | Engineering value to output |
| HI_LIM | REAL | Upper engineering limit |
| LO_LIM | REAL | Lower engineering limit |
| BIPOLAR | BOOL | 0 = unipolar output, 1 = bipolar output |
| RET | WORD | Return code |
| OUT | INT | Raw value to write to analog output |
FC105 scaling equation
For BIPOLAR = 0 (unipolar input 0 to 27648):
OUT = ((IN - 0) / (27648 - 0)) * (HI_LIM - LO_LIM) + LO_LIM
For BIPOLAR = 1 (bipolar input -27648 to +27648):
OUT = ((IN - (-27648)) / (27648 - (-27648))) * (HI_LIM - LO_LIM) + LO_LIM
If the bipolar equation is applied to a unipolar 0-27648 input, the midpoint (0 → -10 PSI) shifts and the low end clips to 0, which exactly matches the field symptom.
Step-by-Step Resolution
- Open the S7 program (STEP 7 V5.5 or TIA Portal) and locate the call instance of FC105 that drives the pressure I/O field.
- Change the
BIPOLARinput constant fromTRUE/1toFALSE/0. LeaveLO_LIM = -10.0andHI_LIM = 10.0unchanged. - Compile and download the program to the CPU. Confirm that the FC105 call instance now shows
BIPOLAR = 0in online view. - Open the WinCC Flexible project and locate the I/O field on the pressure screen.
- In the I/O field Properties > General, set:
-
Tag: the same DB/real tag that receives
FC105.OUT(e.g.DB100.DBD0REAL). - Mode: Output (or Input/Output if the operator may override).
- Format Type: Decimal
-
Format Pattern:
s9999.9 - Decimal Places Displayed: 1
-
Tag: the same DB/real tag that receives
- Compile and transfer the WinCC Flexible project to the panel.
- Force the analog input to 4 mA with a calibrated current source and verify the I/O field shows -10.0.
- Force the input to 20 mA and verify the I/O field shows +10.0.
- Force the input to 12 mA (mid-scale) and verify the I/O field shows 0.0.
Verification Procedure
After making the two changes, perform a four-point calibration check on the loop with a precision current calibrator (Fluke 754, Beamex MC6, or equivalent with ±0.025 % accuracy on current source):
| Applied Current (mA) | Expected PSI | PLC Tag (REAL) | HMI I/O Field | Pass/Fail |
|---|---|---|---|---|
| 4.000 | -10.0 | -10.0 ±0.05 | -10.0 | |
| 8.000 | -5.0 | -5.0 ±0.05 | -5.0 | |
| 12.000 | 0.0 | 0.0 ±0.05 | 0.0 | |
| 16.000 | +5.0 | +5.0 ±0.05 | +5.0 | |
| 20.000 | +10.0 | +10.0 ±0.05 | +10.0 |
Use the S7 Monitor/Modify tool to confirm the OUT real value of FC105 updates in real time. If the HMI field is correct but the PLC tag is wrong, the problem is upstream of FC105. If the PLC tag is correct but the HMI field is wrong, the problem is the HMI tag connection or the format pattern.
PLC Tag Verification
Open the tag list inside the WinCC Flexible project (Project > Communication > Tags) and confirm:
- The tag type is set to 32-bit IEEE float, not Integer or 16-bit.
- The PLC address points to the correct DB and offset (e.g.
DB100.DBD0for the FC105 output). - The Update cycle is appropriate (default 1 s is fine for pressure).
- The Acquisition mode is Cyclic continuous, not On demand.
To isolate the HMI rendering from the PLC value, temporarily add a second I/O field bound to a constant tag with a hard-coded -10.0. If the second field still drops the sign, the format pattern is the issue and not FC105.
WinCC Flexible I/O Field Format Pattern Reference
WinCC Flexible format patterns are described in the WinCC Flexible Online Help > Configuring Screens > Working with I/O Fields > Format Pattern section. The leading s denotes a signed mask, allowing leading minus characters. Mask width must be wide enough to hold the longest expected negative value, including the minus sign.
| Pattern | Width | Value = -12345.6 | Notes |
|---|---|---|---|
99999.9 |
7 | #####.# (overflow) | Width too small even unsigned |
999999.9 |
8 | 12345.6 (sign dropped) | Unsigned pattern, sign hidden |
s99999.9 |
7 incl. sign | -1234.5 (clipped) | Signed pattern but width too small |
s999999.9 |
8 incl. sign | -12345.6 | Correct, signed, full width |
Analog Input Module Wiring and Signal Conditioning
Verify the hardware layer before assuming software misconfiguration.
- Confirm the analog input module is configured for 4-20 mA, not 0-20 mA or ±10 V. For S7-300 SM331 (6ES7331-7KF02-0AB0 and similar), use STEP 7 HW Config > Properties > Inputs > Measurement type = Current (4-wire transducer) or Current (2-wire transducer) as required by the transmitter.
- Wire a 2-wire loop transmitter with the module's 24 V sensor supply, or a 4-wire transmitter from an external 24 VDC source, with the signal return on the module's M terminal.
- Check the unused channels of the same module are configured as deactivated or shorted, otherwise a floating input can inject noise that biases the scaled value.
- On SM331, set the measuring-range module (the small red jumper block on the side of the module) to the D position for 4-20 mA. This is the most common field error and produces raw values that do not start at zero.
Migration to TIA Portal / S7-1200 / S7-1500
On S7-1200 and S7-1500, FC105/FC106 are not available in the same form. The equivalent instructions are NORM_X and SCALE_X in the Convert folder of the Instructions task card. The conceptual flag is replaced by the type input of SCALE_X (BOOL: 0 = unipolar INTEGER / 1 = bipolar INT). For floating-point scaling, use SCALE_X with INT tag and a normalized MIN/MAX in the range 0.0 to 1.0 (unipolar) or -1.0 to +1.0 (bipolar). For an analog input raw 0-27648 mapped to engineering -10.0 to +10.0 on S7-1500:
// LAD: SCALE_X (EN, MIN, MAX, VALUE, RET, OUT)
// VALUE = %IW96 (raw 0-27648)
// MIN = -10.0 (REAL at MIN of input 0)
// MAX = +10.0 (REAL at MAX of input 27648)
// OUT = "Pressure_PSI" (REAL)
The same FC105-style BIPOLAR pitfall exists: if the engineer treats the engineering range sign as the input sign, the same zero-clip behavior is observed.
Field Commissioning Checklist
- Confirm transmitter calibration certificate matches -10 to +10 PSI at 4-20 mA.
- Loop-check the mA signal at the transmitter terminals with a clamp-on or in-line mA meter.
- Verify the measuring-range jumper on SM331 is in the correct position.
- In STEP 7 HW Config, set the analog input channel to 4-20 mA, Integration time = 20 ms (or 16.67 ms if line frequency is 60 Hz), Smoothing = none for first test.
- Compile and download the STEP 7 program with FC105
BIPOLAR = 0. - Compile and transfer the WinCC Flexible project with format pattern
s9999.9. - Apply 4 / 8 / 12 / 16 / 20 mA and record the HMI display at each point.
- Enable FC105 RET word monitoring — values other than 0 indicate scaling errors (e.g. limits inverted, IN out of range).
- Document the final tag address, scaling constants, and format pattern in the project functional specification.
Troubleshooting Matrix
| Observed Symptom | Most Likely Cause | Diagnostic Step | Fix |
|---|---|---|---|
| HMI shows 0 at 4 mA, correct at 20 mA | FC105 BIPOLAR = 1 on unipolar input | Monitor FC105.BIPOLAR online | Set BIPOLAR = 0 |
| HMI shows correct value in simulator, wrong on real PLC | BIPOLAR flag set wrong AND/OR measuring-range jumper | Compare online vs. simulated tag value | Set BIPOLAR = 0; verify HW jumper |
| PLC tag correct, HMI shows unsigned value | Format pattern lacks s
|
Inspect I/O field format pattern | Change to s9999.9
|
| PLC tag correct, HMI shows asterisks or blank | Format pattern width too small | Count required characters | Widen mask, e.g. s99999.9
|
| PLC tag = 0 even with 4 mA applied | Wrong HW Config channel type (voltage) or open loop | Check HW Config; measure mA at terminal | Set channel to Current 4-20 mA; repair wiring |
| PLC tag correct in STEP 7 monitor, HMI shows 0 | Tag connection or wrong data type in WinCC Flexible | Online tag diagnostics in WinCC Flexible | Set tag type to 32-bit float, verify address |
| Negative value flickers or wraps to positive | Tag type mismatch (signed/unsigned, INT/REAL) | Compare PLC tag type with HMI tag type | Match both to REAL / 32-bit float |
| RET word of FC105 is non-zero (e.g. W#16#0008) | HI_LIM ≤ LO_LIM, or IN out of range | Read FC105.RET in VAT | Re-enter limits; verify input range |
Common Pitfalls and Field-Proven Caveats
- Reusing an FC105 instance from another project: the BIPOLAR constant may have been compiled for a different signal type. Always re-verify the constant after copy/paste.
- On the 4 mA low end, the raw integer is 0, not 1. Some transmitters with a 3.6 mA low-rail-health fault sit at 553 raw; this is normal and does not require scaling changes.
- If the transmitter is 4-20 mA but the HMI range needs to include a 0-only deadband, do not bias the scaling — use a separate alarm tag and keep FC105 mathematically clean.
- WinCC Flexible 2008 SP3 has a known issue where adding a
sto a format pattern does not always trigger a recompile warning. Force a full project recompile (Project > Compiler > Rebuild All) after the change. - On OP177B and TP170A panels, the I/O field only supports the legacy format patterns (no
s). Migrate the panel to a TP177B or KTP series if signed display is required.
Related Siemens Documentation
For deeper background, consult the following official Siemens documents:
- Siemens Online Help: S7-300/400 Standard and System Functions Reference Manual — sections on FC105 SCALE and FC106 UNSCALE.
- Siemens Application Note: Analog value processing for S7-300/S7-400 (entry ID 23906620 on the Siemens Industry Online Support portal).
- Siemens Industry Online Support — search for "FC105 bipolar" to find migration notes to NORM_X / SCALE_X.
- WinCC Flexible 2008 SP5 Online Help: I/O field > Properties > Format.
FAQ
Why does my WinCC Flexible I/O field show 0 at 4 mA even though my PLC tag is -10?
The most common cause is FC105 BIPOLAR set to 1 with a unipolar 4-20 mA input. Set BIPOLAR = 0 and use the signed format pattern s9999.9 on the I/O field.
Does the BIPOLAR input on FC105 describe the engineering range or the input signal?
It describes the raw integer input from the analog module. A 4-20 mA current loop is always unipolar (raw 0-27648), so BIPOLAR = 0 regardless of whether the scaled engineering range is negative.
What is the correct format pattern for a signed decimal with one decimal place in WinCC Flexible?
Use s9999.9 for ranges up to ±9999.9. For wider ranges use s99999.9 and so on. The leading s is mandatory; the mask width must include the minus sign.
How do I scale a 4-20 mA signal on an S7-1500 if FC105 is not available?
Use the SCALE_X instruction from the Convert task card with the raw INT from the analog input as the VALUE input, MIN = -10.0, MAX = +10.0, and the engineering tag as OUT. There is no separate BIPOLAR input; SCALE_X handles polarity through the MIN/MAX values.
The PLC value is correct during simulation but wrong on the real plant. Why?
Simulation in S7-PLCSIM uses a virtual 0-27648 raw input. On the real plant, the analog input module must be hardware-configured for 4-20 mA, the measuring-range jumper (on SM331) must match, and the field wiring must deliver 4 mA at low range. A floating input or wrong channel type can pull the raw value above 0 even with 4 mA applied.