Siemens S7-300 Analog Input Scaling PT100 RTD and FC105 Reference

David Krause18 min read
S7-300SiemensTechnical Reference
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

Siemens S7-300 Analog Input Scaling: PT100 RTD and FC105 Reference

This reference documents the scaling, conversion, and commissioning of analog input words (PIW) on the SIMATIC S7-300 platform. It applies when an engineer locates a peripheral input word such as PIW 216 in a STEP 7 program and needs to determine whether the value already represents a usable engineering unit (as with a PT100 RTD input) or whether it must be passed through a scaling block such as FC105 "SCALE" or a manual integer-to-real conversion.

The two cases produce dramatically different engineering outcomes. Reading PIW 216 = 2730 can mean 273.0 °C on a standard PT100 input, 27.30 °C on a climatic-range PT100 input, or 13.65 mA on a 4-20 mA input scaled through FC105 with the wrong HI/LO limits. Misreading the format is the single most common cause of "the AI shows wrong values" complaints on S7-300 commissioning sites.

Engineering impact: An incorrect interpretation of a single PIW can disable closed-loop control, freeze an interlock, or push a heater into thermal runaway. Always confirm the hardware configuration in HW Config before trusting a raw PIW value.

1. Analog Input Architecture in the S7-300

The S7-300 reads analog signals through Signal Modules (SM) in the central rack or through distributed I/O on PROFIBUS/PROFINET. The most commonly deployed analog input modules are listed in the table below. Module order numbers and the relevant firmware ranges are taken from the Siemens S7-300 Automation System Manual and the S7-300 Module Data Manual.

Module Order Number (MLFB) Inputs Supported Sensor Types Resolution (bits)
SM 331 AI 8x12 bit 6ES7331-7KF02-0AB0 8 ±10 V, 0-10 V, ±5 V, 0-20 mA, 4-20 mA, PT100, PT1000, NI100, thermocouple type J/K/T 12 + sign (15 total)
SM 331 AI 8x13 bit 6ES7331-1KF02-0AB0 8 ±80 mV, 0-10 V, ±10 V, 4-20 mA, PT100 standard/climatic 13
SM 331 AI 8x14 bit 6ES7331-7NF00-0AB0 8 ±10 V, 0-10 V, 4-20 mA, PT100/PT1000, TC with internal cold-junction compensation 14
SM 331 AI 8x16 bit 6ES7331-7NF10-0AB0 8 High-accuracy RTD/TC, ±25 mV to ±10 V, 4-20 mA 16
SM 331 AI 2x12 bit 6ES7331-7KB02-0AB0 2 Cost-optimized, PT100/NI100/±10 V/4-20 mA 12 + sign
SM 334 AI 4/AO 2 x 12 bit 6ES7334-0KE00-0AB0 4 in / 2 out ±10 V, 0-10 V, 4-20 mA (no RTD) 12

Every analog input is mapped into the process image input table (PII). By STEP 7 convention, the first byte of an analog channel occupies an even-numbered byte address; the 16-bit value (PIW) sits on that even address. For the SM 331 starting at slot 4 of a CPU 314, the first analog input is typically PIW 304, the second PIW 306, and so on, advancing by 2 bytes per channel.

2. Locating and Reading a PIW in STEP 7 / TIA Portal

When a programmer uploads a project from the S7-300, the symbol table and block comments are stripped, leaving only the absolute addresses. Three tools are essential for tracing an analog signal:

  1. Go To Location (Ctrl+Alt+Q) in STEP 7 V5.x - reveals every block that references the address. Repeated use on PIW 216 shows whether the value is consumed in OB1, FCs, or FBs.
  2. Cross-References (View → Cross-References) - provides a flat list of all access points with the byte/bit offsets within each block.
  3. HW Config → Module Properties → Inputs tab - reports the configured measurement type and range for each individual channel. This is the single source of truth.

If PIW 216 is consumed only by a bit-test such as A I 217.7, it may be a digital status packed into the analog module's PIW. That is rare on SM 331 but occurs on ET 200S and on some third-party modules. The check is simple: open the VAT or the variable table online and watch whether the value drifts smoothly between two integers (analog) or jumps between 0 and 1 (digital misrouting).

3. PT100 RTD Inputs - When No Scaling Is Required

If HW Config shows the channel measurement type as RTD (PT100), the module performs the entire Ohm-to-Celsius conversion in hardware. The CPU receives a signed 16-bit integer that already represents a temperature in tenths (standard range) or hundredths (climatic range) of a degree Celsius. Passing this value through FC105 will corrupt it.

Property Standard Range Climatic Range
Lower limit -273 °C (PT100 lower physical) -120 °C
Upper limit +850 °C (PT100 upper physical) +130 °C
Resolution 0.1 °C (1 digit after decimal) 0.01 °C (2 digits after decimal)
PIW interpretation Divide integer by 10 Divide integer by 100
PIW = 2730 example 273.0 °C 27.30 °C
PIW = -32768 (underrange) Wire break / sensor short Wire break / sensor short
PIW = 32767 (overrange) Out of measurement range Out of measurement range

The selection between standard and climatic range is made in HW Config → Properties → Inputs → Measurement → RTD type → Temperature coefficient → Range. The same PIW value, scaled by the wrong range, is the cause of the most common "PIW 216 is off by a factor of 10" field issue.

3.1 Conversion Code for PT100 (Standard Range)

For a standard-range PT100, the engineering value in °C is the integer divided by 10.0. In Structured Text (SCL) or in ladder math this looks like the snippet below.

// L PIW 216          // Read raw RTD value (signed 16-bit)
// ITD                // Convert INT to DINT (sign extension)
// DTR                // Convert DINT to REAL
// L 10.0e+0          // Divisor for standard range (0.1 deg resolution)
// /R                 // Divide real by real
// T MD 100           // Store result in MD100 (REAL, °C)

The same calculation in STEP 7 STL without the SCL block is two operations: L PIW 216 then ITD to sign-extend. The double-integer is then DTR'd and divided by 10.0. SCL allows the same in one statement:

TempC_REAL := INT_TO_REAL(PIW_216) / 10.0;  // Standard range
TempC_REAL := INT_TO_REAL(PIW_216) / 100.0; // Climatic range

4. FC105 "SCALE" Function Block - When a Voltage or Current Must Be Converted

For non-RTD signals (0-10 V, 0-20 mA, 4-20 mA, ±10 V) the PIW holds a raw 16-bit representation of the ADC count. The mapping is linear, and FC105 turns the raw integer into a scaled REAL engineering unit. The function is part of the standard STEP 7 library "Standard Library → TI-S7 Converting Blocks" and ships in every STEP 7 V5.x install. The official description is in the Siemens TIA documentation on scaling analog values.

4.1 FC105 Block Interface

Parameter I/O Type Meaning Typical Value (4-20 mA → 0-100 %)
IN INPUT INT Raw input from PIW PIW 216 (signed 16-bit)
HI_LIM INPUT REAL Engineering value at IN = 27648 100.0
LO_LIM INPUT REAL Engineering value at IN = 0 0.0
BIPOLAR INPUT BOOL TRUE for ± ranges, FALSE for unipolar FALSE
RET OUTPUT REAL Scaled engineering value e.g. 56.34
OUT OUTPUT BOOL TRUE if IN is out of range (over/underflow) —

4.2 The Scaling Math (Unipolar, 4-20 mA)

For a unipolar input (BIPOLAR = FALSE), FC105 implements the linear equation:

OUT = [ ((IN - 0) / (27648 - 0)) × (HI_LIM - LO_LIM) ] + LO_LIM

For a bipolar input (BIPOLAR = TRUE), the endpoints become -27648 and +27648:

OUT = [ ((IN - (-27648)) / (27648 - (-27648))) × (HI_LIM - LO_LIM) ] + LO_LIM

For a 4-20 mA input mapped to 0-100 %, the engineer must offset the integer by 0 and apply an extra -25 % lift. The most common field implementation writes a custom block because FC105 alone does not perform the 4 mA zero lift. Two practical approaches:

  1. Use FC105 with HI_LIM/LO_LIM chosen for the live range: subtract 0 at 4 mA, recognize the underrange bit, and accept a non-zero LO. Example: LO_LIM = -25.0, HI_LIM = 100.0, BIPOLAR = FALSE, then treat negative OUT as "less than 4 mA" via the OUT flag.
  2. Custom scaling with the standard equation:\pre>// Unipolar with 4 mA zero lift // PV = ((IN - 0) / 27648.0) × 125.0 - 25.0 // where 125.0 = (HI_LIM - LO_LIM) / 0.8 (because 4-20 mA spans 80 % of the 0-25 mA range) // and -25.0 shifts the 4 mA point to LO_LIM = 0

If FC105 is not present in the program blocks folder, the engineer has either deleted it, never inserted it, or the original program was downloaded from a third-party library. The standard solution is to retrieve the block from the STEP 7 Standard Library, place it in the project's "Blocks" container, and call it from the network where the PIW is consumed.

4.3 FC105 Status Output Truth Table

IN (BIPOLAR=FALSE) IN (BIPOLAR=TRUE) OUT (BOOL) RET (REAL) Meaning
< 0 < -27648 TRUE LO_LIM Underflow (or below 4 mA on 4-20 mA)
0 to 27648 -27648 to +27648 FALSE Scaled value Valid range
> 27648 > +27648 TRUE HI_LIM Overflow (over-range)

The OUT bit is the standard "I/O fault" indicator and should be brought into the OB1 or an FB fault collector for alarming.

5. Manual Scaling Without FC105

Some legacy S7-300 programs were written before FC105 was added to the standard library, or the engineer wants to avoid the call overhead on time-critical loops. The math is identical to FC105 and fits in four STL instructions:

// Scale a 0-10 V input on a 12-bit module (PIW range 0..27648) to 0.0..100.0 %
// L  PIW 216           // raw ADC count
// ITD                  // INT → DINT (sign-extend)
// DTR                  // DINT → REAL
// L  2.7648e+4         // divisor (full scale = 27648)
// /R                   // divides MD100 (REAL) by REAL → MD104 (REAL, 0..1)
// L  1.0e+2            // multiply by 100 to get %
// *R                   // MD104 := MD104 × 100.0
// T  MD 108            // store the percent value

For a bipolar ±10 V input where PIW 216 spans -27648 to +27648:

// L PIW 216
// ITD
// DTR                  // REAL in MD100
// L  2.7648e+4         // full scale magnitude
// /R
// L  5.0e+1            // span = HI - LO = 100 - (-100) = 200; /2 for sym → 100
// *R
// T MD 108             // result in MD108, range -100.0 .. +100.0

Always store the divisor (27648 for SM 331, 27648 for SM 332, 2048 for some older 8-bit modules) in a clearly-named DB constant. Engineers who hard-code the divisor at the network level are committing the program to one specific module type, which complicates a later module upgrade.

6. Common PIW Address Map for a S7-300 Station

The following table shows the typical default addresses for an S7-300 with a CPU 314 in slot 2, an IM 360 in slot 3, and the analog modules listed. Always confirm by reading HW Config → Addresses; the table reflects the most common S7-300 defaults but is not authoritative.

Module Slot Channel PIW Address (decimal) PIW Address (hex)
SM 321 DI 32 × 24 V (digital) 4 — I 0.0..I 3.7 0..3
SM 331 AI 8x12 bit 5 CH0 PIW 304 130
SM 331 AI 8x12 bit 5 CH1 PIW 306 132
SM 331 AI 8x12 bit 5 CH2 PIW 308 134
SM 331 AI 8x12 bit 5 CH3 PIW 310 136
SM 331 AI 8x12 bit 5 CH4 PIW 312 138
SM 331 AI 8x12 bit 5 CH5 PIW 314 13A
SM 331 AI 8x12 bit 5 CH6 PIW 316 13C
SM 331 AI 8x12 bit 5 CH7 PIW 318 13E

If the user's program references PIW 216 it is more consistent with a CPU 312/313 layout (smaller process image) or with a distributed I/O device mapped through PROFIBUS. The diagnostic step is the same: open the address in Monitor/Modify in STEP 7 and watch whether the value moves with the physical signal.

7. Hardware Configuration in HW Config (STEP 7 V5.x)

The hardware configuration is the single source of truth for an analog channel. It must match the wiring and the field-side transducer. The configuration sequence for an SM 331 AI 8x12 bit is:

  1. Open the S7 station in SIMATIC Manager → Station → Open HW Config.
  2. Drag the SM 331 from the hardware catalog onto the correct slot (4-11 on a CPU 31x).
  3. Double-click the module to open Properties → Addresses. Note the start address (e.g., 256) and the channel count (e.g., 8).
  4. Switch to the Inputs tab. For each of the 8 channels select:
    • Measurement: Voltage, Current, RTD, or Thermocouple.
    • Range: ±10 V, 0-10 V, 4-20 mA, 0-20 mA, PT100 standard, PT100 climatic, etc.
    • Interference frequency suppression: 50 Hz, 60 Hz, or 400 Hz. The lower the frequency, the higher the resolution. Choose 50 Hz for European mains environments.
    • Smoothing: None / Weak / Medium / Strong. Smoothing is a hardware-side IIR filter on the ADC; it is independent of any software scaling.
  5. Click OK and save/compile the hardware configuration back to the CPU.

On the S7-300 Automation System Manual Siemens publishes the resolution and integration time for every combination of interference frequency and range. For a PT100 with 50 Hz suppression, the integration time is 60 ms and the resolution is 0.1 °C; for climatic range with 50 Hz suppression, the resolution improves to 0.01 °C over a narrower span of -120 °C to +130 °C.

Critical commissioning check: After downloading HW Config, always re-validate the PIW start address by reading it from the module's diagnostic buffer. Module re-configuration does not always retain the address chosen in the offline project, and a mismatch between the offline address and the actually loaded address is the root cause of "PIW 216 reads 0" after a hardware change.

8. Troubleshooting Matrix

Symptom Most Likely Cause Diagnostic Action Corrective Action
PIW reads 0 regardless of input Wrong measurement type (e.g., RTD configured for a 4-20 mA transmitter) Open HW Config → module properties → Inputs tab Re-select "Current 4-wire" or "RTD PT100" matching the wiring
PIW reads 32767 constantly Overrange or wire break (depends on module type) Inspect channel; check for 0-24 mA loop power Repair the field wiring; check transmitter power supply
PIW reads -32768 Underrange, RTD wire break, polarity reversed Verify 4-wire compensation; measure resistance at the channel Correct polarity; check terminal block for loose wires
PIW correct, scaled value is 0.0 FC105 wired to wrong PIW or LO_LIM=HI_LIM Online monitor FC105 instance or the variables feeding IN Correct the IN pointer; verify LO_LIM < HI_LIM
PIW correct, scaled value is off by factor of 10 PT100 standard vs climatic range misread Open HW Config → Inputs → Range Use divisor 10 for standard, 100 for climatic
PIW fluctuates wildly (no smoothing) No hardware smoothing and no software filter Check smoothing setting in HW Config Set smoothing = "Medium" or "Strong"
PIW jumps to 0 in 1-2 s cycles Channel diagnostic interrupt clears the PIW Check diagnostic buffer (Module Information → Diagnostic Buffer) Disable diagnostic interrupt in HW Config if the interrupt is nuisance
FC105 OUT bit always TRUE IN exceeds 27648 (or -27648 in bipolar) Check transmitter scaling; verify engineering range Re-range transmitter or raise HI_LIM

9. Choosing Between PT100 (No FC105) and 4-20 mA (Use FC105)

Engineers migrating from an existing system often discover that the original program already has a scaling block in use somewhere else, and they expect to find the same FC105 in their own network. The decision rule is straightforward:

  • If the field device is a direct PT100 RTD (2-, 3-, or 4-wire connection to the SM 331), no FC105 is needed. The PIW is the temperature in tenths or hundredths of °C. Scaling is a single division by 10 or 100.
  • If the field device is a 4-20 mA temperature transmitter (Rosemount 644, WIKA T32, Endress+Hauser iTEMP, Yokogawa YTA, etc.), the channel is configured for "Current 4-wire DM 4-20 mA". The PIW is the raw ADC count 0..27648. FC105 (or an equivalent) is required to convert to °C, °F, or %.
  • If the field device is a 0-10 V or ±10 V transducer (pressure, level, flow), the channel is configured for voltage. FC105 with the appropriate bipolar flag and HI/LO limits converts the PIW to the engineering unit.

The OEM documentation for the transmitter includes the "high trim" and "low trim" values that set the 4 mA and 20 mA endpoints. Many modern transmitters (Rosemount 3051S, Yokogawa EJX) support a digital HART range that can be larger than the hardware 4-20 mA range. The FC105 HI_LIM and LO_LIM must match the engineering range, not the digital range; otherwise the scaled value will be clipped at HI_LIM or LO_LIM and the OUT fault bit will be set whenever the process approaches the digital endpoints.

10. Verification Procedure After Configuration

The verification must be performed before the program is released to production, regardless of whether FC105 is used or not. The standard S7-300 commissioning check is:

  1. Wire a calibrator. Connect a WIKA Pascal 100 or Beamex MC6 to the channel. Set the calibrator to four points: 0 % (4 mA or 0 °C), 25 % (8 mA or 25 °C), 50 %, and 100 % (20 mA or 100 °C). For a PT100, use decade resistance boxes accurate to ±0.05 Ω.
  2. Open a Variable Table (VAT) in STEP 7. Include the PIW, the scaled REAL output, and the FC105 OUT bit (or the equivalent bits/flags for a manual scaling implementation).
  3. Force the process image update. In OB1 add an unconditional L PIW 216 / T MW 200 for diagnostic visibility, or use Monitor/Modify with the "Modify" tab left empty so the engineer can only read.
  4. Compare against the calibrator. At each of the four points, the scaled REAL output must match the calibrator setting within the module's rated accuracy (typically ±0.1 % of full scale for a 12-bit module, ±0.05 % for a 14-bit module, ±0.025 % for a 16-bit module).
  5. Check fault bits. At 0 % the OUT bit must be FALSE; below 4 mA (or below 0 °C on climatic PT100) it must be TRUE. The diagnostic buffer must not contain module-internal fault entries (SF or BF LEDs must be off).
  6. Remove the diagnostic MW 200 (if added) before the final program download to the production CPU.

11. Performance and Cycle-Time Considerations

The S7-300 analog input conversion time depends on the configured interference frequency suppression:

Interference Frequency Integration Time (ms/channel) Conversion Time across 8 channels Effective Resolution
50 Hz 60 480 Highest
60 Hz 50 400 High
400 Hz 10 80 Lowest

Fast PID loops (< 200 ms cycle) cannot afford 480 ms conversion plus smoothing, and a 50 Hz integration on a temperature loop usually is fine because the process itself is slow. For pressure or flow loops, 60 Hz or 400 Hz integration with FC105 is acceptable. Note that FC105 is non-blocking; the call takes less than 50 microseconds on a CPU 314, so it does not affect OB1 cycle time materially.

12. Migration to TIA Portal

Users porting an S7-300 program to TIA Portal on an S7-1500 will not have access to FC105 by name. The TIA equivalent is SCALE (S7-1500) in the "Converters" library, or the SCALE_X and NORM_X blocks for the 16-bit analog modules of the ET 200SP. The I/O address mapping also changes: on the S7-1500 the input words are typed as %IW rather than PIW, and the module returns the scaled REAL in %ID if the option "Value status" is enabled. Always re-validate the scaling on the new hardware; the FC105 → SCALE_X translation is one-to-one but the limit constants may need to be re-entered.

13. Frequently Asked Questions

PIW 216 reads 2730. What temperature is that?

It depends on the channel range in HW Config. On a PT100 in standard range, the temperature is 273.0 °C (divide by 10). On a PT100 in climatic range, the temperature is 27.30 °C (divide by 100). If the channel is configured for 4-20 mA, the value is not a temperature and FC105 (or equivalent scaling) is required to convert it.

I cannot find FC105 in my STEP 7 project. How do I add it?

Open the Standard Library → TI-S7 Converting Blocks in SIMATIC Manager and drag FC105 (or its source STL file) into the Blocks container of the S7-300 station. Call it from the network that reads the PIW. Note that the same block can be renamed (e.g., FC50) without affecting the logic.

Does the S7-300 need scaling for a 4-20 mA pressure transmitter?

Yes. The PIW holds the raw ADC count 0..27648. Use FC105 with BIPOLAR=FALSE, LO_LIM = lower engineering value (e.g., 0 bar), and HI_LIM = upper engineering value (e.g., 10 bar). For 4-20 mA inputs that must be live at 0 % (e.g., zero suppression), a custom offset is required because FC105 does not perform the 4 mA zero lift.

What does the OUT bit of FC105 tell me?

OUT = TRUE means the IN value is outside the legal ADC range: below 0 or above 27648 for unipolar, below -27648 or above +27648 for bipolar. On a 4-20 mA input, OUT = TRUE is the field "wire break or underflow" indicator (live zero lost). Use OUT to drive an interlock or alarm in OB1.

Is the divisor always 27648?

For SM 331 and SM 332, yes - 27648 is the S7-300 nominal full scale. Some older 8-bit modules use 2048 or 4096; PROFIBUS slave modules from third-party vendors may use 32767. Always check the module's data sheet in the S7-300 Module Data Manual before hard-coding the divisor.

Can I omit FC105 if the PIW is consumed only by an FB that already does the scaling?

Yes. Many programs put the scaling inside a custom FB (e.g., FB9 in the user's example) and call it from FC304. In that case, FC105 is unnecessary and the scaling is performed inside the FB instance. To confirm, open the FB source (or its online view) and look for the divisor constant. If the FB divides the PIW by 10 or 100, it is scaling a PT100. If it multiplies the PIW by a gain and adds an offset, it is scaling a 4-20 mA.

How do I know if my channel is configured for RTD or current without opening HW Config?

Three indirect checks: (1) In Monitor/Modify, force a 0 Ω resistance and a 4 mA current and observe whether the PIW responds. Only one will move the value. (2) Inspect the diagnostic buffer of the SM 331 - a configured RTD reports "overrange" at open terminals, whereas a current channel reports "wire break" at the same condition. (3) Measure the voltage on the input terminals with the module powered: 0 V on a current input indicates the field loop is open.

Back to blog