Migrating S5-100U Analog Inputs to S7: Scaling Conversion Guide

David Krause22 min read
S7-300SiemensTutorial / How-to
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

Migrating S5-100U Analog Inputs to S7: Scaling Conversion Guide

When migrating a Siemens SIMATIC S5-100U application to a SIMATIC S7-300/400 or S7-1200/1500 controller, the analog input raw counts are not directly compatible. The S5-100U analog modules (for example, the 6ES5464-8MD11 four-channel +/-20 mA input) return a 16-bit value in the 0 to 32767 (or signed -32767 to +32767) range, while S7 analog modules return normalized values in the 0 to 27648 range (or -27648 to +27648 signed). This article documents the exact scaling math, the threshold preservation strategy, and a complete LAD/ST/SCL example for a typical S5 100U to S7 migration, with field-proven commissioning checks.

Overview: Why Unscaled Values Differ Between S5 and S7

Siemens used two different nominal end-of-scale values across the S5 and S7 generations for the same physical signal level. The S5 16-bit analog value of 32767 (and the S5-100U ADC output values) is roughly 18.5% larger than the S7 nominal value of 27648 for the same current or voltage input. The reason is the rated overrange:

  • S5 analog inputs: nominal full scale is rated at 100% of the configured range, with a 17.5% positive overrange permitted up to 32767 counts.
  • S7 analog inputs: nominal full scale is rated at 100% of the configured range, with a 5% (S7-1500) to 15% (S7-300 SM 331) overrange permitted up to 32511 to 32767 counts, but the rated "100%" point is 27648.

For an S5 program that loads an analog input word, performs arithmetic, and compares a difference against a constant (for example, the 150 used in the original STEP 5 program), the threshold value will not work directly when the raw value range is different. The migration must be performed either by rescaling the constant, by applying a multiplication or division to the inputs, or by using the S7 SCALE_X function block at the I/O boundary.

The block diagram below shows the signal path from the field sensor through the S5 and S7 generations and the scaling that must be applied for a threshold comparison to behave identically.

Sensor 4-20 mA S5 6ES5464-8MD11 0-32767 raw S7 SM 331/1231 0-27648 raw Scale 1.6908x to S5 equivalent ABS(Ch3 - Ch0) <= 150 (original S5 threshold) or <= 254 (S7 threshold)

S5-100U 6ES5464-8MD11 Module Identification

The source module referenced in the question is the Siemens 6ES5464-8MD11 from the SIMATIC S5-100U family. The full Siemens order designation and its key electrical and resolution parameters are summarised below.

Parameter Value
MLFB / order number 6ES5464-8MD11
Module family SIMATIC S5-100U
Function Analog input (4 AI in 4 channel groups)
Input range (per channel) +/-20 mA bipolar; jumper-selectable 0-20 mA or 4-20 mA unipolar
Resolution 12 bits plus sign (signed) - 11 bits effective + sign
Encoding Two's complement, 16-bit word in the input image (IW)
Raw value range (unipolar) 0 to 32767 (with 17.5% overrange)
Raw value range (bipolar) -32768 to +32767 (with 17.5% positive overrange)
Channel-to-channel isolation No (common ground return at the front connector)
Front connector 20-pin front connector, screw-type with shield clamp
Power supply 24 V DC from the S5-100U backplane bus
Conversion time Approximately 2.5 ms per channel (sequential conversion)

The four channels occupy four consecutive input words in the S5-100U process image. With the default slot assignment used in the original STEP 5 program (IW64, IW70), the slot is 8 (PI/PO area 0 starts at IW0, slot 8 = IW64 in some S5-100U addressing schemes), but the engineer must verify the actual slot configuration in COM 100U or the AG90 hardware report before remapping to S7 I/O addresses.

S5 vs S7 Analog Value Representation

The end-of-scale and overrange differences between S5 and S7 are the root cause of the scaling issue. A side-by-side comparison of the two families for the typical current input range is shown below.

Parameter S5-100U (6ES5464-8MD11) S7-300 SM 331 / S7-1200 SM 1231
Resolution (typical) 12 bits + sign (per polarity) 12 to 16 bits depending on module variant
Nominal 100% end of scale (positive) 27648 with 17.5% overrange to 32767 27648 with 5-15% overrange
Unsigned unipolar range 0 to 32767 0 to 27648
Signed bipolar range -32768 to +32767 -27648 to +27648
Live-zero (4 mA = 0 counts) Not in hardware - software scaling only Configurable: 0-20 mA, 4-20 mA, +/-20 mA
Overrange bit location Bit 15 / overflow indicator Bit 15 of the value word + status byte
Underrange / wire break Not standard Yes - bit 0 of the status byte, module-dependent
Status byte Not separately mapped Yes - S7 returns quality information in the input status byte
Process image address IW (input word) at fixed slot PIW (peripheral input word) at HW Config address

For a program block such as the STEP 5 example in the question, the immediate consequence is that the difference value calculated as ABS(FW98 - FW96) in S5 will be smaller in S7 unless the inputs are scaled up by the S5-to-S7 ratio. The original threshold of 150 in the S5 program must be reinterpreted for the S7 raw value range, or the S7 raw values must be rescaled into the S5 equivalent range before the comparison.

Identifying the Actual Source Range (Ambiguity Analysis)

The source S5 program and observed data leave the actual range ambiguous. Three plausible interpretations of the observed values exist:

Scenario Module configuration Predicted counts at 4 mA Predicted counts at 20 mA
A: 0-20 mA unipolar, 12-bit (2048 steps) Unipolar 0-20 mA, 11 effective bits + sign 409.6 2048
B: +/-20 mA bipolar, 12-bit (4096 steps) Bipolar +/-20 mA, 12 bits + sign 409.6 (4 mA on positive side) 2048
C: 0-20 mA unipolar, 14-bit (16384 steps) Unipolar 0-20 mA, higher-resolution variant 3276.8 (close to 3272) 16384 (close to 16353)
D: User-observed Verified by online view 3272 16353

Scenario C is the closest match to the user-observed values. This indicates that the actual installed S5 module is either a 14-bit unipolar variant (6ES5464-8MD21 or similar) or a 12-bit unipolar module with 4x hardware gain on the ADC output. The 6ES5464-8MD11 datasheet specifications describe 12 bits + sign, so the user should verify the actual MLFB of the installed module before assuming a particular range. Common verification steps:

  1. Read the S5 module order number from the front panel label (the MLFB is printed on the front of the module, for example on the right side near the connector).
  2. Cross-reference the S5 program in STEP 5 against the AG90 hardware report (FILE AG90) to confirm the configured slot and signal range.
  3. Use the PG online view to monitor the raw value at 0 mA (open input) and at a precision-calibrated 20.000 mA source. The slope (counts per mA) identifies the resolution unambiguously.

For the user's observed slope of 13081 counts over 16 mA, the resolution is 817.6 counts/mA, consistent with 14-bit unipolar (16384 / 20 mA = 819.2 counts/mA). The implementation in the remainder of this article assumes the user's observed slope and a 0-20 mA configuration on both the S5 and S7 modules.

Calculating the Scaling Factor

For a 0-20 mA unipolar input, the conversion from S5 raw value to S7 raw value is a single ratio based on the S7 module's full-scale count. The general formula is:

S7_value = S5_value * (S7_FS / S5_FS)

where S7_FS is the S7 raw value at 20 mA (27648 for 0-20 mA S7 modules) and S5_FS is the S5 raw value at 20 mA (as measured at the field calibration).

For the user's observed S5 calibration (20 mA = 16353 counts) and an S7 SM 331 in 0-20 mA mode (20 mA = 27648 counts):

  • Scale factor = 27648 / 16353 = 1.6908
  • Equivalent in integer: 1.6908 ~ 173/102 (less than 1 count per 1024 error, not practical) or use floating-point division.

Apply this to the original S5 threshold of 150 to get the equivalent S7 threshold:

  • S7 threshold = 150 * 1.6908 = 253.6 counts (round to 254)

Alternatively, the S7 raw values can be divided by 1.6908 (or multiplied by 0.5913) to bring them into the S5 equivalent range, and the original 150 threshold can be retained.

For the full 0-32767 S5 range mapped to the 0-27648 S7 range (the canonical comparison):

  • Scale factor = 27648 / 32767 = 0.8439
  • S5 150 = S7 126.6 counts (round to 127)

The two factors differ because the user's S5 module does not span the full 0-32767 range for a 0-20 mA input. Always derive the scale factor from the actual measured S5 calibration points, not from the theoretical 32767 maximum.

S7 Hardware Replacement Selection

The replacement analog input module depends on the target S7 platform. The most common replacements for a 4-channel 0-20 mA / +/-20 mA input on a 6ES5464-8MD11 are listed below.

Target S7 platform Recommended module Order number (typical) Resolution Channels
S7-300 SM 331 6ES7331-7KF02-0AB0 13 bits + sign 8 AI
S7-300 (compact) SM 331 6ES7331-1KF02-0AB0 13 bits + sign 8 AI
S7-1200 SM 1231 6ES7231-4HD32-0XB0 12 bits + sign 4 AI
S7-1200 (high speed) SB 1231 6ES7231-4HA30-0XB0 12 bits + sign 1 AI (signal board)
S7-1500 AQ 4xU/I 6ES7531-7QD00-0AB0 16 bits + sign 4 AI (analog input)
ET 200SP AI 4xI 2-wire 6ES7134-6GD01-0BA1 16 bits + sign 4 AI

All S7 analog input modules use the same 0-27648 nominal raw value for unipolar current ranges, regardless of the platform. This means the scaling factor derived above is portable across S7-300, S7-1200, S7-1500, and ET 200SP. The exact HW Config / device configuration steps differ, but the raw value at 20 mA is always 27648 (or -27648 to +27648 for bipolar).

STEP 5 to S7 Code Migration Strategy

Two main strategies exist for migrating the original STEP 5 program. Choose based on the number of uses of the analog value and on the engineering team's preference for the resulting code.

Strategy A - Rescale the S7 threshold (minimum code change)

  1. Read the S7 raw value from PIW x directly, without scaling.
  2. Use the S7 equivalent threshold of 254 (or 127 if the S5 was used at full range) in place of the original 150.
  3. Update only the constant; no scaling block is required.

Pros: smallest code change, easiest to verify, one line per use. Cons: the constant is now physically meaningless to anyone reading the code (it is "254 S7 counts" not "150 S5 counts"), and any subsequent change to the S7 module or scaling requires re-deriving the threshold.

Strategy B - Scale S7 raw values to S5 equivalent (preserves original threshold and logic)

  1. Read the S7 raw value from PIW x and convert to REAL.
  2. Divide by 1.6908 (or multiply by 0.5913) to convert to the S5 equivalent count range.
  3. Use the original threshold of 150 unchanged.

Pros: original threshold and code logic preserved, easier to cross-reference with the S5 program during commissioning. Cons: additional scaling code at every I/O point, slight rounding error from the floating-point division.

For a single threshold comparison such as the one in the question, Strategy A is generally preferred. For applications with many uses of the analog value, Strategy B is preferred because the original code can be copied across with a single scaling function at the I/O boundary.

LAD/STL Implementation

The migration code in STEP 7 STL (or LAD with the equivalent boxes) for the S7-300 SM 331 with 0-20 mA configuration and Strategy A is shown below. The S7 peripheral addresses are PIW 304 (slot 4, channel 0) and PIW 310 (slot 4, channel 3) for illustration; replace with the actual addresses from the S7 HW Config.

// =========================================================
// Migrated S5 -> S7 threshold comparison (Strategy A)
// Threshold: 254 S7 counts (= 150 S5 counts * 1.6908)
// =========================================================
NETWORK 1    // Ch0 raw value (S7 PIW 304)
TITLE = 'Channel 0 raw value'
      L     PIW 304              // S7 SM 331 channel 0
      T     MW   100             // Save Ch0 raw value

NETWORK 2    // Ch3 raw value (S7 PIW 310)
TITLE = 'Channel 3 raw value'
      L     PIW 310              // S7 SM 331 channel 3
      T     MW   102             // Save Ch3 raw value

NETWORK 3    // Ch0 - Ch3 (signed difference)
TITLE = 'Channel 0 minus channel 3'
      L     MW   100             // Load Ch0
      L     MW   102             // Load Ch3
      -I                          // Integer subtraction: Ch0 - Ch3
      T     MW   104             // Save raw difference

NETWORK 4    // |Ch0 - Ch3| absolute value
TITLE = 'Absolute value of difference'
      L     MW   104
      L     0                     // Compare with zero
      >I                          // Greater than zero?
      JC    POS                   // Yes: skip negation
      L     0
      L     MW   104
      -I                          // Negate
      T     MW   104
POS:  NOP   0

NETWORK 5    // Threshold comparison (S7 threshold = 254)
TITLE = 'Difference within 254 S7 counts'
      L     MW   104             // ABS(Ch0 - Ch3)
      L     254                  // S7 threshold (= 150 S5)
      <=I                         // Less than or equal?
      =     M 40.0               // Set output bit if true

For LAD (Ladder Diagram), the same logic is built from MOVE, SUB_I, ABS (in the IEC library), and LE_I (less-than-or-equal-to-integer) contactor boxes. The S7-300 has the IEC function blocks in the "Standard Library -> IEC Function Blocks" library; the ABS function is in the "FC 21" (or the IEC equivalent) and takes a DINT input.

For Strategy B with floating-point scaling, replace NETWORK 3 with a DTR / /R / TRUNC sequence and use the original 150 threshold in NETWORK 5. This preserves the exact S5 threshold value in the S7 code.

SCL / TIA Portal Implementation

In a TIA Portal project (S7-1200 / S7-1500 / S7-300 with TIA Portal), the same logic is more compact in SCL (Structured Control Language). The code below implements Strategy A using the symbolic tags defined in the PLC tag table.

// =========================================================
// Migrated S5 -> S7 threshold comparison (SCL, Strategy A)
// Symbolic tags: Ch0_AI (Int), Ch3_AI (Int), Diff_OK (Bool)
// =========================================================
#Ch0_scaled := REAL_TO_INT(INT_TO_REAL(#Ch0_AI) / 1.6908);
#Ch3_scaled := REAL_TO_INT(INT_TO_REAL(#Ch3_AI) / 1.6908);

#diff_abs := ABS(#Ch0_scaled - #Ch3_scaled);

#Diff_OK := (#diff_abs <= 150);  // Original S5 threshold preserved

For a single-line implementation in TIA Portal, use the inline SCL syntax in a Code block, or call an FC that contains the scaling. The symbolic tags Ch0_AI and Ch3_AI are configured in the PLC tag table with the data type INT and the I/O address assigned to the corresponding AI channels (e.g., %IW64 for SM 1231 channel 0 in slot 1). The constants 1.6908 and 150 should be defined as named constants at the top of the block to make them easier to update if the S5 calibration is re-verified.

For TIA Portal V17 and later, the IEC function "ABS" is available directly in SCL without a library call. In TIA Portal V16 and earlier, use the IEC library's ABS function (FB1810 or similar) or compute the absolute value inline with an IF/ELSE construct.

SCALE_X and NORM_X Function Block Patterns

For applications where the analog value is used for more than a threshold comparison (for example, scaled to engineering units for HMI display or for PID control), the canonical TIA Portal pattern is to scale the raw 0-27648 count to a 0.0-1.0 normalized value with NORM_X, then to a 0-100% or 0-bar engineering unit with SCALE_X. See the TIA Portal help documentation on Processing of analog values for the full pattern.

// =========================================================
// Scale Ch0 to 0.0-100.0% engineering units
// =========================================================
CALL "NORM_X"
  MIN     := 0                    // Raw 0 count
  VALUE   := "Ch0_AI"             // 0..27648 raw
  MAX     := 27648                // Raw full scale
  RET_VAL := "Ch0_norm"           // 0.0..1.0 normalized

CALL "SCALE_X"
  MIN     := 0.0                  // Eng unit min
  VALUE   := "Ch0_norm"           // 0.0..1.0 normalized
  MAX     := 100.0                // Eng unit max
  RET_VAL := "Ch0_eng"            // 0.0..100.0 engineering units

// Same for Ch3
CALL "NORM_X"
  MIN     := 0
  VALUE   := "Ch3_AI"
  MAX     := 27648
  RET_VAL := "Ch3_norm"

CALL "SCALE_X"
  MIN     := 0.0
  VALUE   := "Ch3_norm"
  MAX     := 100.0
  RET_VAL := "Ch3_eng"

// Threshold comparison in engineering units
// 150 S5 counts = 0.54% engineering units (assuming S5 FS = 16353 at 20 mA)
"Diff_OK" := (ABS("Ch3_eng" - "Ch0_eng") <= 0.54);

The 0.54% threshold in engineering units is derived from the same 1.6908 scale factor: 150 * 1.6908 / 27648 * 100 = 0.917 (for S5 20 mA = 27648 S7 counts equivalent), or 150 / 16353 * 100 = 0.917 (same answer, expressed differently). For the canonical S5 full-range 32767 case, the threshold becomes 150 * 0.8439 / 27648 * 100 = 0.458%. Verify the threshold against the actual S5 calibration rather than against the canonical ratio.

Verification and Testing Procedure

To verify the migration is correct, perform the following checks on the running S7 PLC with the field wiring and sensors connected as in the original S5 system. Use a precision current calibrator (Fluke 705/707, Beamex MC6, or equivalent) with at least 0.05% accuracy to inject the test current.

  1. Zero check: Disconnect the field sensor from Ch0. Set the calibrator to 4.000 mA and connect to the Ch0 input terminal. Read the S7 raw value at PIW 304 and confirm it matches the predicted value. For the user's S5 module with a slope of 817.6 counts/mA, the S7 raw value at 4 mA is 3272 * 1.6908 = 5532 counts (for an S7 module configured for 0-20 mA).
  2. Full-scale check: Set the calibrator to 20.000 mA on Ch0. Read the S7 raw value and confirm it is 16353 * 1.6908 = 27646 counts, very close to the S7 full scale of 27648.
  3. Threshold check: Set Ch0 to a value that produces 5532 counts (4.000 mA). Set Ch3 to Ch0 + 254 S7 counts. The output flag (M 40.0) should be set. Increase Ch3 by 1 S7 count. The flag should clear. This confirms the threshold transition is at the correct value.
  4. Status byte check: Watch the S7 analog input status byte (in HW Config, the status byte is at the address PIW + 1, i.e., PQB 305 for the example). Bit 0 = 1 indicates underrange, bit 7 = 1 indicates overrange, bit 1 = 1 indicates wire break (4-20 mA mode only). The status byte should be 0 for the test inputs above.
  5. Linearity check: Sweep the calibrator from 4.000 mA to 20.000 mA in 1.000 mA steps on Ch0. Plot the S7 raw value versus the expected value (slope 1382.4 counts/mA). The linearity error should be within the S7 module's specified accuracy (typically +/-0.3% of full scale for the SM 331).
  6. Cross-check with original S5 values: Read the actual process value (for example, a 4-20 mA pressure transmitter) on both the original S5 system and the new S7 system simultaneously. The S7 engineering value should match the S5 engineering value within the combined accuracy of the two systems.
Always disconnect the field sensor from the S5 system before applying a calibrator to the S7 input, or wire the calibrator into both systems in parallel. Applying two simultaneous current sources to a passive 4-20 mA loop will produce incorrect readings on both systems and may damage the input modules if the loop is not designed for parallel connection.

Field Commissioning Checklist

Use the following checklist at the field commissioning stage of the S5-to-S7 migration. Each item must be verified and signed off before the new S7 program is put into production control.

  • Confirm the S5 module order number and the configured range from the AG90 hardware report.
  • Verify the S5 raw value at 4.000 mA and 20.000 mA calibration points on each channel.
  • Compute the scale factor (S7_FS / S5_FS) for each channel independently. Channels may have different factors if the S5 module is configured for different ranges per channel group.
  • Select the S7 replacement module and confirm the order number, slot, and channel addressing in the S7 HW Config / TIA Portal device configuration.
  • Configure each S7 channel for the correct input range (0-20 mA, 4-20 mA, or +/-20 mA) matching the original S5 configuration. Verify the wire break detection setting for 4-20 mA channels.
  • Implement the scaling per Strategy A or Strategy B consistently across all uses of the analog value.
  • Run the verification procedure above and document the readings in the commissioning report.
  • Test the threshold transition in both directions (rising and falling) for any flag outputs.
  • Test the diagnostic behavior (overrange, underrange, wire break) by applying out-of-range signals and confirming the expected alarm is generated.
  • Back up the S7 project to the project server and to a TIA Portal portal-format archive before site exit.

Common Pitfalls and Edge Cases

The following pitfalls are observed in field migrations of S5-100U analog inputs. Each is documented with the failure mode and the corrective action.

1. Skipping the sign bit on bipolar ranges. The 6ES5464-8MD11 can be wired for 0-20 mA or +/-20 mA. For a 0-20 mA input, all values are non-negative and the sign bit is always 0. For a +/-20 mA input, negative currents produce negative counts, and the S5 program must use signed comparison operations. The S7 program must also use signed operations (L PIW ... / ITD / signed SUB / ABS / signed compare) or the sign bit will be lost during the conversion to DINT. The ABS function in the S7 IEC library operates on DINT and preserves the sign correctly.

2. Reusing the S5 threshold constant directly in S7. The user observed 20 mA = 16353 on S5 and 20 mA = 27648 on S7. A constant of 150 in S5 does not represent the same physical quantity as 150 in S7. Either rescale the constant (Strategy A) or rescale the inputs (Strategy B). A common error is to use the S5 constant of 150 in the S7 program without adjustment, resulting in the output flag triggering at a different physical threshold than the original S5 program.

3. Dividing by 2 or 4 from a misunderstanding of S5 resolution. The S5 6ES5464-8MD11 has 12-bit signed resolution. The S5 raw value of 16353 at 20 mA is consistent with a 14-bit unipolar module, not 12-bit. Dividing the user's 16353 value by 2 or 4 does not produce a meaningful engineering unit. Verify the actual S5 ADC count first, then derive the scale factor from the measured slope (counts per mA).

4. Forgetting the live-zero offset for 4-20 mA inputs. The S5 0-20 mA module produces 0 counts at 0 mA. The S7 4-20 mA module produces 0 counts at 4 mA. If the S5 program assumes 0 mA = 0 counts and the S7 module is configured for 4-20 mA, the S7 value will be 5529.6 counts (27648 * 0.2) lower than the S5 value at any given signal. Add the live-zero offset when scaling from 4-20 mA S7 to 0-20 mA S5 equivalent, or configure the S7 module for 0-20 mA if the sensor is wired for 0-20 mA.

5. Integer division truncation. Dividing the S7 raw value by 1.6908 in integer arithmetic truncates the result. For 27648 / 1.6908 = 16353, the integer division 27648 / 1 = 27648 is useless, and 27648 / 2 = 13824 is wrong. Use floating-point arithmetic (DTR / /R / TRUNC in STL, INT_TO_REAL / REAL_TO_INT in SCL) for the division. For applications requiring exact integer arithmetic, use a lookup table or a precomputed integer multiplier (for example, 16908 / 10000 with proper scaling).

6. Channel addressing in S7 vs S5. The S5-100U uses fixed IW addresses based on slot position. The S7-300 uses PIW addresses that are configured in HW Config, and the S7-1200/1500 use symbolic tags mapped to the I/O address. The S5 IW64 does not correspond to S7 PIW 64 or S7 %IW64. The engineer must remap the I/O addresses during the migration; a common error is to leave the S5 IW addresses in the migrated STL code, which produces a compile error or, worse, reads from the wrong PIW address and triggers diagnostic events.

7. Forgetting to terminate unused channels. The 6ES5464-8MD11 has four channels. If only two are used, the unused channels should be configured in HW Config and jumpered or shorted to the common terminal at the front connector. Floating inputs on the S7 SM 331 can produce noise and random overrange or underrange flags. The recommended termination is a wire from the unused input terminal to the common terminal (M- or M), which holds the input at 0 mA without floating.

8. Wire break detection on 4-20 mA inputs. The S7 SM 331 in 4-20 mA mode provides a wire break detection feature (the status byte bit 1 is set if the input current drops below approximately 3.6 mA). The S5 6ES5464-8MD11 does not have an equivalent feature in 4-20 mA mode. If the original S5 program relied on a "no input current = raw value of 0" condition to detect wire break, the S7 program must check the status byte to detect the same condition. Failure to update the wire break detection logic can leave the S7 program unable to detect a broken sensor cable, leading to a process upset.

FAQ

What is the scaling factor from S5 0-32767 raw values to S7 0-27648 raw values?

Divide the S5 raw value by 32767 and multiply by 27648 (factor 0.8439). For the S5-100U 6ES5464-8MD11 in a 0-20 mA configuration with the actual measured 20 mA calibration point, the empirical factor is 27648 divided by the measured S5 count at 20 mA. For the user-observed 20 mA = 16353 counts, the factor is 1.6908 (S5 to S7 direction).

Why does my S5 6ES5464-8MD11 read 16353 counts at 20 mA and not 2048 or 32767?

The 16353 value is consistent with a 14-bit unipolar ADC (16384 counts full scale), not the 12-bit specification in the 6ES5464-8MD11 datasheet. The most likely explanation is that the installed module is a higher-resolution variant (e.g., 6ES5464-8MD21 or a third-party replacement) or that the module has a hardware gain stage. Verify the actual MLFB on the module label and re-derive the scale factor from the measured 4 mA and 20 mA points.

Can I use SCALE_X to convert the S7 raw value to engineering units and keep the original 150-count threshold?

Yes. Convert the 150 threshold to the same engineering units as the scaled value. For 0-20 mA to 0-100% scaling with the user's S5 20 mA = 16353 counts and S7 20 mA = 27648 counts, 150 S5 counts = 150 / 16353 * 100 = 0.917% engineering units. Apply the comparison in engineering units (e.g., ABS(Ch3_eng - Ch0_eng) <= 0.917).

What if my S5 module is configured for 4-20 mA with live-zero?

The 6ES5464-8MD11 has no hardware live-zero. The 4 mA point produces a non-zero raw count (3272 in the user's case). For an S7 SM 331 in 4-20 mA mode, 4 mA produces 0 counts. To match the S5 reading, scale the S7 value with the empirical factor and add the live-zero offset: S5_equiv = (S7_raw / 1.6908) + 0, or configure the S7 module for 0-20 mA and treat the 4 mA point as 20% of full scale.

Do S7-1200 SM 1231 and S7-1500 SM 531 use the same 0-27648 raw value as the S7-300 SM 331?

Yes. All S7 analog input modules (S7-300 SM 331, S7-400 SM 431, S7-1200 SM 1231, S7-1500 SM 531, ET 200SP AI) use the same 0-27648 nominal raw value for unipolar current ranges and -27648 to +27648 for bipolar ranges. The scaling factor between S5 and S7 is portable across all S7 platforms and does not need to be re-derived for each platform.

Back to blog