An analog transmitter sends a physical signal, but the PLC program normally receives a digitized integer. Scaling converts that raw integer into a value the process engineer actually understands—for example, 13824 becomes 5.0 bar when it represents 50% of a 0–10 bar range.
- Configure the channel signal type correctly before writing scaling logic.
- Use the raw range documented for the exact module and configured measuring range.
- Convert to REAL for calculation to avoid unwanted integer rounding.
- Validate zero, midpoint and full-scale values before trusting the measurement in control logic.
Analog Input Scaling in Siemens TIA Portal
This guide targets practical searches for PLC analog input scaling, TIA Portal analog scaling, Siemens 0 to 27648 scaling, NORM_X SCALE_X, 4-20mA PLC scaling, S7-1200 analog input and S7-1500 analog scaling.
1. What Is PLC Analog Input Scaling?
An analog input channel converts an electrical measurement into a digital number. The PLC cannot inherently know that a particular raw value means 6.2 bar, 143 °C or 72% tank level. The program must map the digital range to the physical engineering range.
Raw value
0...27648 is a machine-friendly representation used by many Siemens current and unipolar analog applications.
Engineering value
0.0...10.0 bar, -50.0...150.0 °C or another process range is what operators, alarms and PID loops need.
Scaling is therefore a linear mapping from one range to another. If both ranges are linear, the same percentage position in the raw range must produce the same percentage position in the engineering range.
2. Signal Flow: Sensor → PLC → Engineering Units
For example, a 0–10 bar pressure transmitter may output 4–20 mA. The analog module digitizes the current and the PLC scales the resulting raw value to 0.0–10.0 bar. The scaled value can then be used by HMI displays, alarms, trends, recipes or PID control.
3. Understand Siemens Analog Raw Values
Siemens standardizes the nominal analog representation so the application logic is not tied directly to the hardware converter resolution. For general-purpose S7-1200/S7-1500 analog processing, the rated current range is represented by 0 to 27648, while bipolar voltage ranges use -27648 to +27648. Values beyond the nominal range can indicate overrange or underrange depending on module type and configuration.
| Configured signal | Typical nominal raw range | Midpoint example | Use |
|---|---|---|---|
| 0–20 mA | 0...27648 | 13824 ≈ 10 mA | Unipolar current |
| 4–20 mA | 0...27648 for the configured rated range | 13824 ≈ 12 mA | Industrial transmitters |
| 0–10 V* | Module/range dependent; many unipolar voltage modules use a positive raw span | Check module manual | Potentiometer / sensor |
| -10...+10 V | -27648...+27648 | 0 = 0 V | Bipolar command / feedback |
*Always verify the exact analog module and measuring-range table. Siemens families and modules differ in supported voltage/current ranges and diagnostic regions.
4. Universal PLC Analog Scaling Formula
The general linear equation maps a raw input range to an engineering range:
Engineering = EngMin + (Raw - RawMin) × (EngMax - EngMin) / (RawMax - RawMin)Where:
| Term | Meaning |
|---|---|
Raw | Current analog input value read by the PLC |
RawMin | Raw value corresponding to the transmitter minimum |
RawMax | Raw value corresponding to the transmitter maximum |
EngMin | Minimum engineering value |
EngMax | Maximum engineering value |
For a standard current channel where RawMin = 0 and RawMax = 27648, the equation becomes:
Engineering = EngMin + Raw × (EngMax - EngMin) / 276485. Example 1: 0–10 V Pressure Transmitter, 0–10 bar
Assume the configured analog range gives 0...27648 across the transmitter span and the engineering range is 0.0 to 10.0 bar. At half scale, Raw = 13824.
Pressure = 0 + (13824 - 0) × (10 - 0) / (27648 - 0) = 5.0 barZero scale
Raw = 0
Result = 0.0 bar
50% scale
Raw = 13824
Result = 5.0 bar
75% scale
Raw = 20736
Result = 7.5 bar
Full scale
Raw = 27648
Result = 10.0 bar
0...27648 for the voltage example when that is the nominal representation of the exact configured channel. For bipolar voltage inputs the minimum is negative.6. Example 2: 4–20 mA Temperature, 0–200 °C
When the analog module is configured for a 4–20 mA measuring range, the rated current span is represented from raw minimum to raw maximum. Therefore 4 mA represents the engineering minimum and 20 mA represents the engineering maximum.
| Signal | Raw | Normalized | Temperature |
|---|---|---|---|
| 4 mA | 0 | 0.00 | 0 °C |
| 8 mA | 6912 | 0.25 | 50 °C |
| 12 mA | 13824 | 0.50 | 100 °C |
| 16 mA | 20736 | 0.75 | 150 °C |
| 20 mA | 27648 | 1.00 | 200 °C |
Temperature = 0 + 13824 × (200 - 0) / 27648 = 100.0 °CThis is different from connecting a 4–20 mA transmitter to a channel configured as 0–20 mA. In that case, 4 mA is already 20% of the electrical range, so the raw value at the transmitter’s zero point is not zero. The hardware configuration and scaling equation must agree.
7. Example 3: -10...+10 V Position, -100...+100 mm
For a bipolar voltage range with raw values -27648...+27648, let the engineering range be -100.0 to +100.0 mm.
| Raw value | Position |
|---|---|
| -27648 | -100 mm |
| -13824 | -50 mm |
| 0 | 0 mm |
| 13824 | +50 mm |
| 27648 | +100 mm |
Position = -100 + (-13824 + 27648) × 200 / 55296 = -50 mm8. NORM_X and SCALE_X in TIA Portal
Siemens recommends a two-stage method for most PLC applications:
NORM_X
NORM_X determines where the input sits between the selected minimum and maximum. A halfway raw value produces approximately 0.5.
Normalized = (Raw - RawMin) / (RawMax - RawMin)SCALE_X
SCALE_X converts the normalized value into the required engineering range.
Scaled = EngMin + Normalized × (EngMax - EngMin)Keeping normalization and engineering scaling separate makes the program easier to reuse: the same normalized signal can be mapped to different display, command or diagnostic ranges.
9. SCL Example: Analog Input Scaling
For a 0–10 bar pressure transmitter using a nominal raw span of 0...27648, an SCL implementation can be written as:
VAR
AI_Raw : INT;
AI_Normalized : REAL;
Pressure_bar : REAL;
END_VAR
AI_Normalized := NORM_X(
MIN := 0,
VALUE := AI_Raw,
MAX := 27648
);
Pressure_bar := SCALE_X(
MIN := 0.0,
VALUE := AI_Normalized,
MAX := 10.0
);
You can also implement the equation explicitly. Convert the raw integer to REAL before multiplication and division so the calculation keeps fractional precision.
Pressure_bar := 0.0
+ (INT_TO_REAL(AI_Raw) - 0.0)
* (10.0 - 0.0)
/ (27648.0 - 0.0);
RawValue, RawMin, RawMax, EngMin and EngMax as parameters. Then the same block can scale pressure, flow, level, temperature and speed channels.10. LAD / FBD Workflow with NORM_X and SCALE_X
Create the raw tag
Map the configured analog input address to an INT tag such as AI_Pressure_Raw.
Insert NORM_X
Set MIN and MAX to the nominal raw limits for the configured channel.
Create a REAL normalized tag
Store the normalized result in a tag such as Pressure_Norm.
Insert SCALE_X
Set engineering MIN and MAX, for example 0.0 and 10.0 bar.
Verify online
Check raw, normalized and scaled values together using a watch table while applying known test signals.
11. Configure the Analog Channel Before Scaling
Correct logic cannot repair an incorrectly configured analog module. In TIA Portal, open Device configuration, select the analog module/channel and verify the supported measuring type and range.
- Voltage or current input selected correctly
- 0–20 mA vs 4–20 mA selected correctly
- Bipolar voltage range selected when negative values are required
- Channel address matches the PLC tag
- Wire type and terminal connection match the module manual
- Diagnostics are enabled where useful
- Transmitter supply and loop power are correct
- Shielding and grounding follow plant standards
After downloading the hardware configuration, monitor the raw value first. Only after the raw channel behaves correctly should you troubleshoot the scaling math.
12. Overrange, Underrange and Diagnostic Values
The nominal range is not the only possible integer region. Analog modules can provide overrange/underrange information and may report substitute or diagnostic states depending on hardware and configuration. Therefore a robust program should not assume that every raw value is valid process data.
Recommended
Validate channel diagnostics and raw-value plausibility before using the scaled signal for alarms, interlocks or closed-loop control.
Avoid
Blindly clamping every abnormal raw value to the engineering minimum or maximum, because this can hide a broken wire or failed transmitter.
Use module-specific diagnostics for wire break, overflow, underflow and configuration faults where supported. The exact thresholds differ by module, so use the device manual rather than hard-coding one universal diagnostic number.
13. Analog Noise, Smoothing and Filtering
Scaling changes units; it does not remove electrical noise. If the raw value fluctuates, first check the physical installation: transmitter stability, cable routing, shield termination, grounding, power supply and channel integration/filter settings.
Software filtering can be added after the measurement chain is healthy. Common approaches include a moving average, first-order low-pass filter or deadband. The filter time constant must suit the process: a fast pressure-control loop needs a different response than a slowly changing tank level.
14. Common PLC Analog Scaling Problems
| Symptom | Likely cause | Check / fix |
|---|---|---|
| Scaled value always zero | No loop current, wrong address, disabled channel | Measure signal and monitor raw tag online |
| Scaled value is 20% at transmitter zero | 4–20 mA transmitter connected to channel/scaling treated as 0–20 mA | Align channel range and raw limits with transmitter configuration |
| Full-scale value is too low/high | Wrong raw maximum or engineering maximum | Apply a known full-scale simulator value |
| Negative voltage reads incorrectly | Used unipolar scaling for bipolar channel | Use the documented negative raw minimum |
| Value jumps or flickers | Noise, grounding, unstable loop, insufficient filtering | Check wiring and hardware filter settings first |
| Result has no decimal places | Integer arithmetic | Convert to REAL before division |
| Value exceeds engineering maximum | Input in overrange or scaling limits wrong | Check diagnostics and raw value before clamping |
| Reading is reversed | Engineering min/max or signal mapping reversed | Verify transmitter calibration and scaling endpoints |
15. Best Practices for Siemens Analog Scaling
- Document signal type beside every analog tag
- Keep raw value and scaled value as separate tags
- Use descriptive engineering units in tag comments
- Use REAL for normalized and engineering calculations
- Build one reusable scaling FC/FB instead of repeating arithmetic
- Validate zero, 25%, 50%, 75% and 100% where practical
- Handle module diagnostics separately from process scaling
- Do not silently mask sensor faults with clipping
- Use a simulator/calibrator for commissioning
- Trend both raw and scaled values during troubleshooting
Recommended Tag Pattern
| Tag | Data type | Purpose |
|---|---|---|
AI_Pressure_Raw | INT | Direct module process value |
AI_Pressure_Norm | REAL | Normalized 0.0...1.0 signal |
Pressure_bar | REAL | Engineering value |
Pressure_Valid | BOOL | Diagnostic/plausibility status |
Pressure_HighAlarm | BOOL | Process alarm after validation |
Frequently Asked Questions
Why does Siemens use 27648 for analog values?
Siemens uses standardized integer representations for the nominal analog span. General current ranges use 0 to 27648 and bipolar voltage ranges use -27648 to +27648. This lets application scaling remain consistent across modules with different internal converter resolutions.
What is the PLC analog scaling formula?
Engineering = EngMin + (Raw - RawMin) × (EngMax - EngMin) / (RawMax - RawMin). Use REAL arithmetic so fractional engineering values are preserved.
What is the difference between NORM_X and SCALE_X?
NORM_X maps the raw input range to a normalized floating-point position, normally 0.0 to 1.0. SCALE_X maps that normalized position to the desired engineering range.
How do I scale a 4–20 mA signal in TIA Portal?
Configure the channel for 4–20 mA, use the documented nominal raw span for that configured current range, normalize it, then scale 0.0–1.0 to the transmitter range such as 0–10 bar or 0–200 °C.
Can I scale analog values in SCL?
Yes. Call NORM_X and SCALE_X in SCL or implement the general linear equation directly using REAL arithmetic.
Why is my scaled analog value above the engineering maximum?
The channel may be in an overrange region, the measuring range may be configured incorrectly, or the scaling limits may not match the transmitter. Check diagnostics and the raw value before deciding whether to clamp the result.
Siemens Technical References
Siemens S7-1200 and S7-1200 G2 system documentation describes the nominal analog ranges and recommends normalizing an input to 0.0...1.0 before scaling it to engineering units with NORM_X and SCALE_X.
