S7-1200 High-Speed Counter Limit: 6 HSC Maximum Workarounds

David Krause12 min read
S7-1200SiemensTechnical 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

Overview

The SIMATIC S7-1200 controller family supports a maximum of six high-speed counters (HSC1 through HSC6) per CPU. This is a firmware-enforced ceiling that applies to every CPU variant in the S7-1200 range, including the compact CPU 1211C, the mid-range CPU 1212C, CPU 1214C, CPU 1215C, and the high-frequency CPU 1217C. The limit cannot be raised by installing additional Signal Boards (SB), digital input (DI) modules, or digital input/output (DI/DO) signal modules on the right-side expansion port. The ceiling is bound to the onboard logic of the CPU image and cannot be extended in TIA Portal by selecting additional HSC numbers.

Engineers who require more than six incremental encoders or pulse sources on a single logical controller must therefore select from a small set of alternatives: software-based counting on standard digital inputs using cyclic or hardware interrupts, distribution of encoders across multiple networked S7-1200 CPUs, the use of LOGO! 8 base modules as remote counters over Ethernet, or the deployment of dedicated counter modules on distributed I/O stations such as SIMATIC ET 200SP or ET 200MP.

S7-1200 HSC Architecture and Resource Allocation

Each HSC instance occupies dedicated onboard or SB digital inputs that are hard-mapped to specific counters. TIA Portal enforces the relationship between input terminals and HSC instances. The HSC channel selection list in the device configuration (CPU Properties → High-speed counters) exposes exactly six HSC instances with predefined input assignments per CPU variant.

HSC Instance Typical Input Group (CPU 1214C/1215C) Typical Input Group (CPU 1217C)
HSC1 I0.0 / I0.1 (A/B), I0.3 (Z) I0.0 / I0.1 (A/B), I0.3 (Z)
HSC2 I0.2 / I0.3 (A/B), I0.5 (Z) I0.2 / I0.3 (A/B), I0.5 (Z)
HSC3 I0.4 / I0.5 (A/B), I0.7 (Z) I0.4 / I0.5 (A/B), I0.7 (Z)
HSC4 I0.6 / I0.7 (A/B), I1.1 (Z) I0.6 / I0.7 (A/B), I1.1 (Z)
HSC5 I1.0 / I1.1 (A/B), I1.3 (Z) I1.0 / I1.1 (A/B), I1.3 (Z)
HSC6 I1.2 / I1.3 (A/B), — I1.2 / I1.3 (A/B), —
Pin assignments are CPU-specific. Always verify against the device configuration in TIA Portal. CPU 1217C offers 1 MHz inputs on HSC1–HSC4 onboard, while HSC5/HSC6 onboard inputs run at 100 kHz. Signal Board HSC paths are limited to 30 kHz on all S7-1200 CPUs.

HSC Counting Modes and Maximum Input Frequencies

The S7-1200 HSC supports several counting modes selectable per instance. Mode selection determines how the encoder pulses are decoded and influences the effective pulse rate at the input terminal. Quadrature 4x evaluation multiplies the input pulse rate by four, which can saturate the 100 kHz ceiling even at modest encoder shaft speeds.

Counting Mode Input Source Effective Pulse Multiplier Typical Use Case
Single-phase count up/down with direction 1 pulse + 1 direction 1× Simple pulse trains, proximity sensors
Two-phase (A/B counter 1x) A + B, 90° phase shift 1× Quadrature encoders, low resolution
Two-phase (A/B counter 2x) A + B 2× Quadrature encoders, double resolution
Two-phase (A/B counter 4x) A + B 4× Quadrature encoders, max resolution
A/B counter with Z (index) 1x/2x/4x A + B + Z 1x, 2x, 4x Absolute reference on index pulse

Maximum input frequency per HSC instance depends on the CPU model and the input source:

CPU Model Onboard HSC Frequency (HSC1–HSC6) SB HSC Frequency
CPU 1211C / 1212C 100 kHz 30 kHz
CPU 1214C / 1215C 100 kHz 30 kHz
CPU 1217C 1 MHz (HSC1–HSC4 onboard), 100 kHz (HSC5–HSC6 onboard) 30 kHz
For quadrature 4x encoders, divide the maximum input frequency by 4 when calculating the maximum encoder shaft pulse rate. A 100 kHz HSC can decode a quadrature encoder running at 25 kHz A/B channel frequency (100,000 counts/second at 4x).

Why the Six-HSC Limit Cannot Be Expanded Onboard

The S7-1200 HSC engine is implemented in the CPU's dedicated counter hardware block. Each HSC instance consumes a fixed resource pair: one or two dedicated high-speed input channels plus a hardware counter register. The firmware exposes six such resources, and they cannot be reallocated through SB, SM (signal module), or CP (communication processor) expansion.

Attempting to configure additional HSC instances in TIA Portal beyond HSC6 yields the message "No HSC available" or removes the option from the selection list. Adding a SB 1221 DI4 module only provides additional digital inputs usable as HSC inputs if a free HSC instance number (1–6) is still available; the SB does not introduce a seventh HSC engine. Likewise, an SM 1221 digital input module cannot serve as HSC inputs because SM inputs are scanned by the standard image and lack the hardware connection to the HSC engine.

This design choice is documented in the SIMATIC S7-1200 Programmable Controller System Manual, which explicitly states the maximum number of HSC instances per CPU.

Alternative 1 — Software Counters on Standard Digital Inputs

Standard digital inputs (DI from onboard, SB, or SM modules) can be used to implement software counters using the cyclic OB1 scan, hardware interrupts on the rising/falling edge of a DI, or timed interrupts. This approach extends the counting capacity beyond six channels without requiring additional hardware, but it is limited by the input filter time and the OB execution time.

Method A — Hardware Interrupt Counting

Attach a hardware interrupt OB (OB40) to the DI used as the pulse input. Each rising edge increments a counter tag in a global DB. The maximum countable frequency is governed by the input filter (configurable from 0.1 ms to 20 ms in TIA Portal) and the OB40 execution latency.

Approximate maximum count rate with a 0.1 ms digital input filter:

f_max ≈ 1 / (t_filter + t_OB40)

For a 0.1 ms filter and a 100 µs OB40 latency, expect ~5,000 pulses/s as a practical limit. The CPU 1211C/1212C require a longer filter due to the input acquisition scan. Always validate on the target hardware before deployment.

Method B — Timed Interrupt Counting

A cyclic timed interrupt OB (OB30–OB38) can sample a standard DI at a configurable interval (1 ms to 60 s in TIA Portal). The interrupt handler reads the DI state and increments or decrements a counter tag accordingly. This method supports up to ~1 kHz with a 1 ms OB30 cycle on a lightly loaded CPU, which is sufficient for encoders under 50 Hz A/B quadrature as described in the source application.

Software counters lose precision under heavy CPU load. For applications where a missed pulse cannot be tolerated, hardware HSC remains the only reliable choice and the application must fit within the 6-HSC budget or be distributed as described below.

Alternative 2 — Distribute Encoders Across Multiple S7-1200 CPUs

When the application requires more than six incremental encoders with full hardware counting reliability, the most pragmatic S7-1200-native approach is to use two or more S7-1200 CPUs networked over PROFINET or Industrial Ethernet, with each CPU handling up to six encoders. The host CPU aggregates the count values from the partner CPU via PUT/GET, TSEND/TRCV, or PROFINET I-device data exchange.

Configuration Procedure

  1. Add the second S7-1200 CPU to the TIA Portal project as a separate device.
  2. Configure HSC1–HSC6 on each CPU according to encoder count.
  3. Establish an Ethernet connection between the two CPUs.
  4. In the host CPU's program block, add PUT instructions to read the partner CPU's HSC count DB or use the simpler TSEND_C/TRCV_C pair on ISO-on-TCP connections (port 2000).
  5. Enable PUT/GET access on the partner CPU under Properties → Communication → Access to the PLC.
  6. Update the HSC count value at a rate appropriate to the application (typically 10–100 ms).

Two CPU 1215C units can therefore serve up to 12 incremental encoders while remaining within the S7-1200 product line. PROFINET IRT is not required; standard PN RT communication is sufficient for counter aggregation.

Alternative 3 — LOGO! 8 Base Module as a Remote Counter

The LOGO! 8 base module (BM) includes four high-speed digital inputs (I3, I4, I5, I6) that operate as up/down counters at up to 5 kHz. Each LOGO! BM can therefore supply four counters and can be networked to the S7-1200 as an Ethernet participant using the LOGO! Access Tool or the S7 communication PUT/GET mechanism (LOGO! 8 BM supports S7 communication from firmware version FS04 onward).

LOGO! Variant High-Speed Inputs Maximum Count Frequency Ethernet / S7 Support
LOGO! 8 BM (FS04+) I3, I4, I5, I6 5 kHz Yes (S7 server)
LOGO! 8.3 BM (FS06+) I3, I4, I5, I6 5 kHz Yes (S7 server + Modbus TCP)

For applications with encoders below 50 Hz A/B quadrature, the 5 kHz capability of the LOGO! 8 BM is comfortably sufficient. One S7-1200 CPU combined with two LOGO! 8 BM modules can serve 6 (onboard HSC) + 4 + 4 = 14 counter channels, each fully hardware-backed.

LOGO! 8 counter inputs run at 5 kHz maximum. Quadrature 4x evaluation reduces the maximum A/B channel frequency to 1.25 kHz. For encoders below 50 Hz this is irrelevant, but verify against the application if higher frequencies are present.

Alternative 4 — Distributed I/O with Dedicated Counter Modules

For higher count rates (above 100 kHz) or for applications where a single logical controller is mandated, deploy a distributed I/O station with a dedicated counter module. The S7-1200 CPU can communicate as the PROFINET IO controller with an ET 200SP or ET 200MP station that hosts a counter module.

Module Order Number (MLFB) Channels Max Frequency Quadrature Support
TM Count 1x24V 6ES7138-6AA01-0BA0 1 200 kHz Yes (1x, 2x, 4x)
TM PosInput 1 6ES7138-6BA01-0BA0 1 1 MHz Yes (1x, 2x, 4x)
TM PosInput 2 6ES7138-6BB00-0BA0 2 1 MHz Yes (1x, 2x, 4x)
ET 200MP TM Count 2x24V 6ES7552-1AA00-0AB0 2 1 MHz Yes

Each TM PosInput 2 module adds two counter channels without consuming any of the six onboard HSC instances. Multiple modules can be deployed on a single ET 200SP station up to the PROFINET slot limit (typically 64 modules per IO controller). This is the recommended path when the S7-1200 must remain the single CPU and encoder count exceeds six.

Alternative 5 — External Standalone Counter Hardware

For installations where encoder count, PROFINET availability, or speed requirements exceed what S7-1200-class CPUs can absorb, consider third-party standalone counters that publish data via Modbus TCP, EtherNet/IP, or PROFINET. Devices such as the Wachendorff WDG series with Ethernet gateway, IFM AL1342, or Balluff BUS0027 provide multi-channel counting in industrial housings and present the data as cyclic PROFINET IO. The S7-1200 can consume this data without using any of its six HSC instances.

Quadrature Encoder (A/B) Specific Considerations

When A/B quadrature encoders are involved, the HSC's mode setting determines the count multiplier:

  • 1x evaluation: counts once per A-channel rising edge. Maximum input frequency = max count rate.
  • 2x evaluation: counts on each A-channel edge. Maximum input frequency / 2 = max shaft pulse rate.
  • 4x evaluation: counts on every A and B edge. Maximum input frequency / 4 = max shaft pulse rate.

For encoders < 50 Hz shaft speed with 1,024 ppr (pulses per revolution), the resulting 4x quadrature count rate is approximately 200 kHz. This exceeds the 100 kHz HSC ceiling on CPU 1214C/1215C and would saturate HSC1–HSC4 on CPU 1217C at 1 MHz. The application described in the source (< 50 Hz, unspecified ppr) is compatible with the 6-HSC budget assuming standard ppr ratings. For > 6 encoders with similar speed/ppr profile, the two-CPU distribution or TM PosInput approach is recommended.

Selection Matrix — Choosing the Right Expansion Method

Application Characteristic Recommended Approach Capacity Gain Hardware Cost
1–6 encoders, < 100 kHz, hardware reliability required Onboard HSC (HSC1–HSC6) Baseline None
7–12 encoders, < 100 kHz, low CPU load tolerance Two networked S7-1200 CPUs +6 channels Second CPU + Ethernet
7–14 encoders, < 1.25 kHz A/B 4x, low-budget build One S7-1200 + LOGO! 8 BM units +4 to +8 channels LOGO! 8 BM units
7–64 encoders, > 100 kHz, single-CPU architecture ET 200SP / ET 200MP with TM PosInput modules +2 channels per module ET 200 station + TM modules
Many encoders at low speed, software tolerance acceptable Hardware interrupt OB counters on standard DI +∞ (subject to OB load) None
> 64 encoders, high speed, mixed vendor environment Standalone Ethernet counters (Modbus TCP, PROFINET) +∞ (subject to network) Per-channel hardware

Commissioning and Verification Procedure

  1. In TIA Portal, navigate to CPU Properties → High-speed counters and confirm that no more than six HSC instances are assigned to inputs. Verify the input terminal assignment matches the wiring diagram.
  2. Place a CTRL_HSC instruction block in the user program and connect it to the HSC instance. The CTRL_HSC_EXT extended instance provides additional parameter access.
  3. Enable Access to the PLC via PUT/GET communication on any partner CPU before commissioning networked alternatives.
  4. Rotate each encoder through a known displacement (e.g., 1,000 pulses) and verify the HSC count reads exactly 1,000 × evaluation multiplier.
  5. For quadrature encoders, rotate in both directions and verify the HSC direction status bit transitions correctly.
  6. For distributed alternatives, exercise the network update cycle (PUT/GET, TSEND/TRCV) and verify the host CPU sees count updates at the expected rate.
  7. Capture diagnostic buffer entries during commissioning to confirm no HSC overflow or input filter warnings are logged.

Troubleshooting Matrix

Symptom Likely Cause Corrective Action
Cannot select HSC7 in TIA Portal Six-HSC firmware limit reached Apply one of Alternatives 1–5
HSC count drifts or skips pulses Input filter set too long for encoder frequency Reduce input filter to 0.1 ms or use HSC-rated inputs
HSC count always zero after encoder rotation Encoder A/B wiring reversed or HSC mode mismatch Verify wiring against HSC terminal assignment; check mode (1x/2x/4x)
Quarter or half of expected count Quadrature evaluation mismatch Verify 4x vs 2x vs 1x mode matches encoder documentation
Counter overflow at expected position Counter upper limit not set to encoder's true range Configure CV/RV using HSC wizard or CTRL_HSC parameters
Networked CPU counter not updating PUT/GET not enabled or TSEND connection not established Enable access rights; verify TSEND_C status bits
Software counter (interrupt-based) losing pulses OB execution time exceeds pulse period Reduce OB1 load, switch to HSC or hardware interrupt OB40

FAQ

What is the maximum number of HSC instances on an S7-1200 CPU?

Six. The firmware reserves HSC1 through HSC6, and this cannot be extended by Signal Boards, signal modules, or communication modules. This applies across the S7-1200 CPU range including 1211C, 1212C, 1214C, 1215C, and 1217C.

Can I add a Signal Board (SB 1221) to gain more high-speed counters?

No. A Signal Board DI module adds digital inputs that can be assigned to a free HSC instance (HSC1–HSC6) but does not create a new HSC engine. If HSC1–HSC6 are already in use, the SB inputs cannot serve as HSC inputs.

What is the fastest HSC input frequency on the S7-1200?

The CPU 1217C supports 1 MHz on HSC1–HSC4 onboard inputs (I0.0–I0.3). All other S7-1200 CPUs and HSC5/HSC6 onboard inputs on the 1217C cap at 100 kHz. Signal Board HSC inputs cap at 30 kHz on every CPU.

Can two S7-1200 CPUs be networked to share counter data?

Yes. Two S7-1200 CPUs can communicate over PROFINET or Industrial Ethernet using PUT/GET (with access rights enabled), TSEND/TRCV on ISO-on-TCP, or by configuring one CPU as a PROFINET I-device. This effectively doubles the available HSC budget to twelve channels.

Can a LOGO! 8 base module replace an S7-1200 HSC for an encoder below 50 Hz?

Yes. The LOGO! 8 BM provides four high-speed inputs (I3–I6) capable of counting at 5 kHz, well above the 50 Hz requirement. The LOGO! can be read by the S7-1200 over Ethernet using S7 communication (firmware FS04 and later) without consuming any of the six onboard HSC instances.

Back to blog