Siemens IP 242 Counter Module 6ES5-242 Technical Reference
The Siemens IP 242 counter module (order number family 6ES5 242-...) is a high-speed counter (HSC) intelligent module for the SIMATIC S5 PLC family. It plugs into any S5 central rack or expansion rack slot and provides hardware-assisted counting, measurement, and position-decoding functions that exceed the cycle-time capabilities of the CPU. This reference consolidates the operating information for the IP 242A and IP 242B variants, identifies the official Siemens documentation entry IDs, and provides a field-ready configuration matrix for engineers maintaining legacy S5 installations.
1. Module Identification and Variants
The IP 242 family is delivered under multiple MLFB (Maschinenlesbare Fabrikatebezeichnung) order numbers. The most common references in field service are:
| Order Number (MLFB) | Variant | Notes |
|---|---|---|
| 6ES5 242-1AA13 | IP 242A | Common early variant; single-width S5 module |
| 6ES5 242-1AB.. | IP 242A | Hardware revision updates of the A series |
| 6ES5 242-2A... | IP 242B | B series with extended FB library and operating modes |
The "A" suffix designates the IP 242A counter module; the "B" suffix designates the IP 242B, which adds additional operating modes and a richer Function Block (FB) library. Both modules share the front-panel connector footprint but require different FBs on the CPU side.
2. Official Siemens Documentation
The authoritative source for the IP 242 is the S5 Equipment Manual for the counter module, published under Siemens entry ID 6ES5 998-0KM21. This manual covers the IP 242A and IP 242B in a single volume (~400 pages) and is the only document that includes:
- Hardware and software setup procedures for both variants
- High-speed counter programming guidelines
- Commissioning (startup) procedures
- Sample programs for each counter type
- Descriptions of all operating modes
Two Siemens support entry IDs are directly associated with the IP 242:
- S5 Equipment Manual: Counter Module IP 242A / IP 242B (PDF, 6ES5 998-0KM21)
- Siemens Support Entry 1086302 - IP 242A/B Documentation Index
- Siemens Support Entry 7879768 - S5 Module Documentation Archive
Engineers should always download the PDF directly from the Siemens Industry Online Support portal to ensure revision currency; printed manuals discovered at customer sites are frequently superseded.
3. Hardware Specifications
| Parameter | Value |
|---|---|
| Module family | SIMATIC S5 intelligent I/O |
| Counter inputs | Up to 2 incremental encoder channels (A, B, and zero track per channel) |
| Maximum count frequency | Hardware-dependent (24 V / RS-422 input variants); see equipment manual for exact Hz rating per input configuration |
| Counter depth | 24-bit internal counters (typical S5 HSC architecture) |
| Digital outputs | 2 (one per counter, configurable as comparison or zero output) |
| Digital inputs | Hardware gate, set, reset per counter |
| Supply voltage | 24 V DC encoder supply derived from S5 backplane / external |
| Backplane interface | S5 bus (compatible with S5-90U, S5-95U, S5-100U, S5-115U, S5-135U, S5-155U depending on configuration) |
| Front connector | 40-pin Siemens front connector (front-panel screw or crimp) |
6ES5 998-0KM21 Section 2 for the specific MLFB under commissioning. The figures above are representative of the IP 242 family architecture; pre-release (E) and engineering sample variants may differ.
4. Operating Modes
The IP 242A and IP 242B each support several operating modes, selected by hardware DIP switches on the module front panel and parameterised through the FBs in the S5 user program. The principal modes are:
4.1 Continuous Counting
The counter increments or decrements on each valid input pulse and is read cyclically by the CPU through the FB interface. The 24-bit internal register wraps at full scale unless an explicit comparison value is loaded.
4.2 Single Counting with Gate Control
A hardware gate (typically wired from a sensor or output) enables and disables the counting process. The FB reads the gate state to determine whether the current count value is valid.
4.3 Periodic Counting
Used for measuring rotational or flow rates; the counter is gated by a fixed time window generated either internally on the module or externally via a hardware timer.
4.4 Comparison / Output Trigger (IP 242B enhanced)
A pre-loaded comparison value triggers one of the two digital outputs on the IP 242 when the counter reaches the setpoint. The IP 242B offers multiple comparison windows versus the IP 242A's single comparison per channel.
4.5 Position Decode / Measurement Mode
Quadrature decoding of incremental encoder A/B tracks with optional zero reference. The module performs the quadrature multiplication in hardware, freeing the S5 CPU from interrupt-driven pulse counting.
5. Hardware Configuration (DIP Switches)
Before applying power, configure the operating mode and signal level via the on-board DIP switch block. Switch assignment for the IP 242 family:
| Switch | Function | Typical Position |
|---|---|---|
| S1.1 – S1.2 | Input signal level (24 V / RS-422) | Per encoder specification |
| S1.3 – S1.4 | Counting direction / up-down mode | Per application |
| S1.5 – S1.6 | Quadrature / single-channel mode | Set to 1x, 2x, or 4x evaluation |
| S1.7 – S1.8 | Gate input source (HW / SW) | Hardware or software gate |
6. Function Block (FB) Library
The IP 242 does not expose a standard PII/PIQ byte image. Communication with the CPU is mediated by Function Blocks loaded into the S5 user program:
| FB | Module | Function |
|---|---|---|
| FB 10x series | IP 242A | Initialisation, read, write, gate control, comparison value load |
| FB 12x series | IP 242B | Extended mode set including periodic and multi-comparison |
| OB 1 / OB 21-22 | CPU | Cold restart / warm restart parameter assignment call sequence |
The FBs exchange data with the module through a parameter area in the CPU. The exact parameter structure (DX / DW) is documented in Section 5 of 6ES5 998-0KM21. A typical parameter load sequence is:
- CPU restart (OB 21 cold restart, OB 22 warm restart) calls the IP 242 initialisation FB.
- The initialisation FB transfers the operating mode and comparison values from a configured DB to the module.
- In cyclic OB 1 execution, a read FB fetches the current count and status; a write FB updates comparison setpoints as required.
- Comparison events raise the module interrupt output, which the FB converts to a flag or process input for the application.
7. Typical Parameter Block Layout
The following is a representative parameter data block layout for the IP 242B. Confirm exact byte offsets against the equipment manual for the FB version in use.
| DW Offset | Parameter | Description |
|---|---|---|
| DW 0 | SLOT | Module slot number in the S5 rack |
| DW 2 | MODE | Operating mode word (bit flags for direction, gate, quadrature) |
| DW 4 | CMP1_LO | Comparison 1 setpoint (low word) |
| DW 6 | CMP1_HI | Comparison 1 setpoint (high word) |
| DW 8 | CMP2_LO | Comparison 2 setpoint (low word) |
| DW 10 | CMP2_HI | Comparison 2 setpoint (high word) |
| DW 12 | GATE_CTL | Software gate enable mask |
| DW 14 | STATUS_MASK | Status bits the CPU should read back |
8. Wiring and Front Connector Pinout
The 40-pin front connector carries encoder signals, gate inputs, and the comparison outputs. The pinout varies between IP 242A and IP 242B revisions; always cross-check the wiring diagram printed on the inside of the front-panel door against the equipment manual before commissioning. Typical signal groups:
- Pins 1-8: Encoder 1 input (A, /A, B, /B, N, /N, 24 V supply, 0 V supply) for RS-422 variants
- Pins 9-12: Encoder 1 digital inputs (gate, set, reset)
- Pins 13-20: Encoder 2 input group
- Pins 21-24: Encoder 2 gate / set / reset inputs
- Pins 25-30: Comparison outputs 1 and 2
- Pins 31-40: Reserved / shield ground
For 24 V single-ended encoders, the differential pairs (e.g. /A) are unused and the corresponding pin must be tied to the reference voltage per the module documentation.
9. Commissioning Procedure
- Verify compatibility. Confirm the target CPU firmware supports the FB library version. Older S5-90U and S5-95U CPUs may not host the IP 242B FB set.
- Set DIP switches for the encoder type, counting direction, and gate source per the equipment manual matrix.
- Power down the rack, install the IP 242 in a free slot, and apply power.
- Load the FB library into the S5 program file using STEP 5 (or S5-DOS / S5 for Windows in legacy support scenarios).
- Configure the parameter DB with slot, mode, and comparison values.
- Call the initialisation FB in OB 21 (cold restart) and verify the module status LED transitions to "RUN" or equivalent.
- Wire the encoder and apply a known input (hand-crank or signal generator). Monitor the read-back count in a VAT table.
- Tune the comparison setpoint and verify the digital output toggles on the expected count value.
- Force-stop and test gate behavior by toggling the hardware gate input; confirm the FB status bits reflect the gate state.
10. Troubleshooting Matrix
| Symptom | Likely Cause | Action |
|---|---|---|
| Module SF (system fault) LED on at startup | Slot mismatch between DB SLOT parameter and physical position | Re-verify rack slot address and DB parameter; re-power rack |
| Count value frozen at zero | Hardware gate input not asserted, or encoder wiring reversed | Check gate input voltage; oscilloscope A/B tracks; verify encoder power |
| Count value drifts or increments without pulses | EMC noise pickup on encoder cable, or missing shield termination | Use shielded twisted pair; bond shield at module end only; check cable segregation from VFD power |
| Comparison output does not toggle at setpoint | Comparison value not loaded, or FB write never executed | Verify FB write call in OB 1; cross-check DW offset in DB |
| Quadrature count off by factor of 2 or 4 | DIP switch quadrature multiplier set incorrectly | Set switch to 1x, 2x, or 4x per encoder resolution vs. desired count/turn |
| CPU goes to STOP after IP 242 initialisation FB call | FB signature mismatch or unsupported FB version loaded | Re-load matching FB version from original Siemens disk or backup archive |
| Count resets unexpectedly on CPU restart | IP 242 initialisation FB overwrites counter with preset value | Configure initialisation FB for "no preset" or "retain on restart" |
11. Migration Considerations
For facilities planning to replace S5 lines with S7-1500, the modern functional equivalent is the SIMATIC TM Count 2x24V module (6ES7 138-6AA00-0BA0) or the integrated high-speed counter functionality of the S7-1500 CPU / ET 200MP. The TM Count module supports incremental encoders up to 1 MHz, hardware comparison, and PROFINET-based diagnostics that exceed the IP 242 capability. Plan migration around:
- Signal level: confirm 24 V push-pull or RS-422 compatibility with the field wiring
- Cycle time: S7-1500 application cycle is typically faster than S5 OB 1
- Function block replacement: the TM Count is configured via the TIA Portal, not hand-written FBs
12. Field-Engineering Checklist
- Confirm the exact MLFB on the module side label before consulting the manual; the IP 242A and IP 242B have different FB sets.
- Download the equipment manual from the Siemens Industry Online Support portal using the entry IDs above; printed copies at customer sites are often out of revision.
- Archive the FB source files alongside the program backup; rebuilding the FBs from documentation is non-trivial and error-prone.
- Log module serial number and firmware stamp in the maintenance system; the IP 242B firmware version affects supported operating modes.
- Verify front-connector wiring against the door label at every recommissioning; pinout drift between revisions is a common source of field faults.
What is the official Siemens manual order number for the IP 242 counter module?
The IP 242A and IP 242B counter modules are documented in the S5 Equipment Manual with order number 6ES5 998-0KM21. It is available as a PDF on the Siemens Industry Online Support portal under entry IDs 1086302 and 7879768.
How do the IP 242A and IP 242B differ?
The IP 242A is the original variant with a single comparison setpoint per counter channel and a smaller FB library. The IP 242B adds extended operating modes (periodic counting, multiple comparison setpoints) and requires the IP 242B-specific FB library to be loaded into the S5 CPU.
What S5 CPUs support the IP 242?
Compatibility depends on the FB library version and the CPU's address space. The IP 242 is typically deployed with the S5-115U, S5-135U, and S5-155U; smaller S5-90U / S5-95U CPUs may not support the full IP 242B FB set. Always verify the CPU firmware release notes against the FB version in the equipment manual.
Why is the IP 242 equipment manual 400+ pages for a single counter module?
The 6ES5 998-0KM21 manual covers both the IP 242A and IP 242B variants in a single volume, including all operating modes, FB parameter descriptions, hardware configuration tables, sample programs, and commissioning procedures. The size is typical of comprehensive S5 module documentation rather than a single-function operating guide.
Is the IP 242 still available from Siemens?
No. The SIMATIC S5 product family, including the IP 242, has been officially discontinued. Spares are available only through remanufactured stock, third-party distributors, or migration to a current S7-1500 platform with the TM Count 2x24V module.