Problem Definition
An S7-300 CPU 313C is wired to an ABB drive (e.g., ACS355 or ACS800) and configured to read the motor speed through the analog input of the PLC. The STEP 7 standard library block FC105 "SCALE" is used to convert the raw integer value (PIW) read from the analog input into a real engineering unit in Hz. The reported symptom is that the FC105 output does not match the actual motor speed displayed on the ABB drive keypad: for example, the drive shows 25 Hz and FC105 returns a value of 25.3, while the raw word PEW 256 shows 116800 instead of the expected 27648 (which the engineer tried first as EW 256).
The defect is rarely caused by FC105 itself. It is caused by a combination of incorrect address mapping, wrong polarity selection, wrong analog range configuration on either the CPU 313C or the ABB drive, and a missing step in the conversion pipeline (PIW → INT → FC105 → REAL). This article walks through the diagnosis, the correct addressing, the parameter block for FC105, and the ABB drive analog output configuration needed to recover correct speed feedback.
Root Cause Analysis
Four overlapping root causes explain almost every FC105 speed-readout problem on a CPU 313C:
-
Wrong address type or wrong channel.
EW 256/PEW 256is not the integrated analog input on the CPU 313C. The integrated analog inputs live in the process input image atPIW 752throughPIW 760. Reading an uninitialized process image word produces garbage (116800 = 0x1C800), which is the symptom reported. -
Polarity mismatch. A 0 to 20 mA signal is unipolar (always positive), yet the
BIPOLARinput of FC105 is left at TRUE. With TRUE, FC105 treats the value as -27648 to +27648, so a 10 mA signal at 13824 decimal is interpreted as the negative half of the bipolar range, scaling to a negative Hz value. - Wrong HI_LIM / LO_LIM. Using 100.0 / 0.0 will yield percent. Using 50.0 / 0.0 yields Hz only if the drive is configured to output 20 mA at parameter 20.02 MAXIMUM SPEED. If the drive's analog output max is left at 50 Hz but the motor nameplate max is 1450 rpm at 50 Hz, FC105 will still be correct, but the output will have a residual error of roughly ±0.3 Hz because the ABB internal scaling is rounded to 1 rpm.
- Drive output configuration mismatch. The ABB ACS355 by default maps analog output 1 (AO1) to motor speed frequency, but it does not automatically link AO1 scaling to parameter 20.02 MAXIMUM SPEED; the user must set parameters 13.04 (AO1 minimum), 13.05 (AO1 maximum), and 13.07 (AO1 signal range = 0-20 mA).
CPU 313C Analog Input Architecture
The SIMATIC S7-300 CPU 31xC Technological Functions manual documents the integrated analog I/O of the CPU 313C (order number 6ES7313-5BF03-0AB0 and earlier variants) as follows:
| Address | Channel | Usable Signal Type | Notes |
|---|---|---|---|
| PIW 752 | AI0 | 0-10 V, 0-20 mA, ±10 V | Current: use terminals I+ and I-, jumper Mana to M |
| PIW 754 | AI1 | 0-10 V, 0-20 mA, ±10 V | Current: use terminals I+ and I- |
| PIW 756 | AI2 | 0-10 V, 0-20 mA, ±10 V | Current: use terminals I+ and I- |
| PIW 758 | AI3 | 0-10 V, 0-20 mA, ±10 V | Current: use terminals I+ and I- |
| PIW 760 | AI4 | RTD / resistance / 0-10 V | Reserved for temperature measurement |
For a 0 to 20 mA signal the wire pair connects to the I+ and I- terminals of the chosen channel. The analog common Mana (pin 20 of the front connector) must be referenced to the drive's analog common. Unused channels must be shorted at their common to suppress noise pickup, as recommended in the same manual.
The Siemens analog normalization is the same as for any SM 334 / SM 331 AI:
| Range selected in HW Config | Decimal value at 0% | Decimal value at 100% | Sign bit behavior |
|---|---|---|---|
| 0 - 20 mA | 0 | 27648 | Unipolar, no negative values |
| 4 - 20 mA | 0 | 27648 (with 1 mA underrange = -1) | Unipolar with wire-break flag at -32768 |
| ±10 V | -27648 | 27648 | Bipolar, 15 bits + sign |
FC105 SCALE Block Parameter Mapping
FC105 is documented in the STEP 7 Standard Library reference (function blocks FC105 / FC106). The block call in OB1 or a cyclic OB looks as follows:
CALL FC 105
IN := MW100 // INT input from PIW (load via MOVE PIW-->MW)
HI_LIM := 5.0E+01 // REAL, 50.0 for 50 Hz max speed
LO_LIM := 0.0E+00 // REAL, 0.0
BIPOLAR:= FALSE // BOOL, FALSE for 0-20 mA unipolar
RET_VAL:= MW102 // WORD return code (0 = OK, >0 = overflow)
OUT := MD104 // REAL output, e.g. 25.3 (Hz)
Internally FC105 computes:
OUT = LO_LIM + (IN - K1) / (K2 - K1) * (HI_LIM - LO_LIM)
where K1 = 0 and K2 = 27648 when BIPOLAR = FALSE, and K1 = -27648, K2 = 27648 when BIPOLAR = TRUE. For bipolar FC105 the input integer must be supplied as INT (signed). FC106 is the inverse function (REAL → scaled integer for output).
| Symptom from FC105 output | Likely cause | Remedy |
|---|---|---|
| Output is always 0.0 | IN is pointing at EW address outside process image | Use MOVE PIW 756 → MW 100; feed MW 100 to IN |
| Output is always negative (~ -25 to -50) | BIPOLAR = TRUE on a unipolar 0-20 mA signal | Set BIPOLAR = FALSE |
| Output is double the actual Hz | HI_LIM = 100 used as percent instead of Hz | Set HI_LIM = 50.0 (or actual drive max) and LO_LIM = 0.0 |
| Output reads 116800.0 (or similar nonsense) | EW/PEW 256 was never initialised; reading the wrong word | Switch to PIW 752/754/756/758 and reload HW Config |
| RET_VAL = 7FFF hex or non-zero | Overflow: HI_LIM out of range / IN out of range | Verify ret_val docs, tighten LO_LIM < HI_LIM |
ABB ACS355 / ACS800 Analog Output Configuration
The LVD-EOTN97U-EN_REVA ACS800 speed-scaling note describes how the ABB drive maps its internal MAIN DS ACT1 / ACT2 frequency word to the analog output. For the ACS355 the equivalent parameter set is parameter group 13. The settings that fix the FC105 mismatch are:
| ACS355 Parameter | Name | Value to set | Effect |
|---|---|---|---|
| 1301 | AO1 LOCATION (output module) | 1 (internal) | Routes AO1 to onboard terminal block |
| 1304 | AO1 MINIMUM | 0.0 % | Anchors 0 Hz to 0 mA / 4 mA |
| 1305 | AO1 MAXIMUM | 100.0 % | Anchors MAX SPEED to 20 mA |
| 1306 | AO1 CONTENT | 103 (Output Frequency) or 102 (Motor Speed rpm) | Selects which process value is sent out |
| 1307 | AO1 SIGNAL | 0 (0-20 mA) or 1 (4-20 mA) | Must match PLC HW Config selection |
| 2002 | MAXIMUM SPEED (rpm) | 1450 (typical 4-pole 50 Hz motor nameplate) | Used as 100 % reference for AO1 |
| 2008 | MAXIMUM FREQUENCY (Hz) | 50.0 | Used as 100 % reference for AO1 |
Setting AO1 SIGNAL to one range on the drive while the CPU 313C is configured for another range will produce a consistent offset error. If the drive is set to 4-20 mA and the CPU is set to 0-20 mA, 4 mA will produce 1 / 5 scale (because 4 mA is at 0 in CPU range but at 0 % in drive range), so 0 Hz becomes 25 % of the PLC range, giving an 12.5 Hz offset at low speed. Always match both ends.
Wiring, Shielding, and Signal Integrity
The integrated analog inputs of the CPU 313C are referenced to Mana (analog ground). To keep noise-induced offsets out of FC105 (a typical 0.1 mA noise coupled into the analog loop produces about 0.25 Hz of displayed error at 50 Hz max), apply this wiring discipline:
- Use a shielded, twisted pair cable from the drive's AO1 terminals to the CPU 313C AI terminals. Ground the shield at one end only — at the panel ground bar near the PLC — to avoid ground loops.
- Connect the drive's analog common (often labeled AGND or AGND1) to
Manaon the CPU 313C. If the drive and PLC are powered from different supplies, this link prevents floating common from clipping the analog signal. - Short any unused analog channel input to its own common on the CPU 313C side. The S7-300 manual specifically calls this out as a noise-reduction measure.
- Place the analog cable in a tray separated from motor power cables and from any VFD output cabling by at least 200 mm. Crossings should be at 90°.
- Verify the drive's analog output drive capability. The ACS355 AO1 source impedance is roughly 700 Ω max at 20 mA. The CPU 313C AI input impedance in current mode is 50 Ω typical, so voltage compliance on the drive is roughly 10 V at 20 mA — adequate for the loop.
A floating AGND or a missing Mana reference is the single most common cause of FC105 returning values that drift a few Hz between no-load and full-load, which is what produces the 25.3 display when the drive is actually outputting 25.0.
Step-by-Step Corrective Procedure
- Stop the drive and PLC. Open the panel and confirm there is no active motion.
- Open SIMATIC Manager → HW Config. Select the CPU 313C and open Properties → Analog Inputs. Set the channel wired to the drive (typically Channel 0 or 1) to Current, 0-20 mA (or 4-20 mA if you chose that). Save and download.
- Wire the drive's AO1. Connect AO1+ to I+ of the selected CPU channel, AGND to Mana. Tie the shield to panel ground.
- Configure the ABB drive. From the keypad navigate to parameter groups 13 and 20. Set 1304 = 0.0, 1305 = 100.0, 1306 = 103 (output frequency), 1307 = 0 (0-20 mA), 2002 = motor nameplate rpm, 2008 = 50.0 Hz.
-
Open the STEP 7 program. In OB1 add a
MOVEinstruction that copies the integer from the chosen analog channel to a flag word:L PIW 754 T MW 100. This forces the conversion into STEP 7's signed-INT representation, which is what FC105 expects. -
Call FC105 with the parameters listed above (HI_LIM = 50.0, LO_LIM = 0.0, BIPOLAR = FALSE). Drive
OUTinto a real tag such asMD104. - Download and monitor. Use a VAT table on PIW 754 to confirm the raw integer; use a separate VAT table on MD104 to watch the FC105 output. With the drive at 0 Hz you must see PIW 754 ≈ 0 and MD104 ≈ 0.0.
- Run a three-point verification — 0 Hz, 25 Hz, 50 Hz — and record both the drive display and the FC105 output.
Verification Procedure and Acceptance Criteria
After the corrective procedure, the following must hold across the operating range:
| Drive Display (Hz) | Expected PIW Value (0-20 mA) | Expected FC105 OUT (Hz) | Tolerance |
|---|---|---|---|
| 0.0 | 0 ± 4 | 0.0 ± 0.01 | ADC offset only |
| 25.0 | 13824 ± 8 | 25.0 ± 0.03 | Mid-scale linearity |
| 50.0 | 27648 ± 8 | 50.0 ± 0.03 | Full-scale + drive DAC drift |
Any deviation larger than ±0.05 Hz at three points indicates one of: a noisy analog loop, an offset in the drive's DAC, or wrong polarity on FC105. The 0.3 Hz offset seen in the original report (25.3 vs 25.0) corresponds to a raw error of roughly 16 counts (≈ 0.116 mA), which fits both the ACS355 DAC quantization (12 bits across 0-20 mA = 4.88 µA/LSB) and the CPU 313C ADC quantization. To compensate, apply a one-point trim in the drive (parameter 1304 / 1305) or in the PLC (offset on MD104) rather than chasing hardware noise.
For HMI display, ROUND(REAL_TO_DINT(MD104)) before sending to the operator panel — engineers reading 25.3 on screen will call it a fault; displaying 25 masks the LSB-level noise without hiding real errors.
Resolution and Precision Optimization
If FC105 still shows a residual 0.3 Hz error after the steps above, apply these field-proven fixes:
- Use FC105 only at the analog front-end. Do not push the FC105 REAL output to a tag and then multiply elsewhere; chain the formatting (ROUND, TRUNC, REAL_TO_DINT) before the HMI tag so the HMI never sees a non-integer Hz value.
- Average the raw input. Insert a 4-to-8 sample moving average in the PIW-to-MW pre-stage if the value jitters visibly on the VAT table. This typically halves the displayed jitter without changing FC105 behavior.
- Switch to Profibus/Profinet if the 0.3 Hz error matters. Using the ABB drive's Profibus-DP process data word eliminates the analog chain entirely: word 1 of the PPO contains actual speed as a 16-bit signed value scaled by parameter 50.01 (Speed scaling). For the ACS800, MAIN DS ACT1 carries the same value; for the ACS350/355 the corresponding word is PZD2 / PPO word 1.
-
Verify RET_VAL. If FC105's
RET_VALis non-zero, ignore the output entirely. RET_VAL codes are documented in the STEP 7 Standard Library reference and indicate ranges of OUT / IN overflow. - Document the scaling choice. Place the equivalent of the formula above — for 0-20 mA, 0-50 Hz, bipolar = FALSE — into the project's HMI tag descriptor so that future maintenance understands why PIW 754 is no longer the raw display word.
Once these corrections are made, the original symptom (FC105 returning 25.300 when the drive shows 25.0) drops to ≤ 25.05 across the operating range, which is within ADC noise and acceptable for any drive-control HMI.
Frequently Asked Questions
Why does PIW 256 / EW 256 return 116800 instead of the speed?
PEW 256 is not an analog input on the CPU 313C. The integrated analog inputs start at PIW 752. Reading an unconfigured word returns the process image default value (often 0x1C800 = 116800). Map PIW 752–758 or PIW 754 specifically when reading the drive's speed.
Do I need BIPOLAR = TRUE on FC105 for a 0-20 mA speed signal?
No. 0-20 mA is a unipolar signal (always positive). Set BIPOLAR = FALSE so K1 = 0 and K2 = 27648. Setting BIPOLAR = TRUE will produce negative speed values at small positive currents because FC105 expects signed range -27648 to +27648.
What HI_LIM and LO_LIM should I use for a 50 Hz ABB drive?
Set LO_LIM = 0.0 and HI_LIM = 50.0. These are engineering units in Hz, mapped to a 0-20 mA input. If you prefer to display percent, use LO_LIM = 0.0 and HI_LIM = 100.0; FC105 cannot tell you both at once.
How do I stop the FC105 output from drifting ±0.3 Hz?
The drift comes from the analog loop (drive DAC + ADC quantization + cable noise). Tighten the shield wiring, verify AGND-to-Mana is bonded, and apply a one-point offset on either the drive (parameter 1304) or the PLC (post-trim on MD104). For <0.1 Hz accuracy, switch to Profibus/Profinet and read the parameter-50-scaled integer directly.
Can I read the speed over Profibus-DP instead of the analog input?
Yes. The ABB ACS350/355 and ACS800 expose actual speed in PZD2 / PPO word 1 of the cyclic Profibus-DP exchange. No FC105 scaling is needed — the integer-to-Hz scaling is fixed by parameter 50.01 (Speed scaling) on the drive. This is the preferred path when end-to-end precision below ±0.05 Hz is required.