IMDHMIControls LibraryShop main store

Explainer

Connecting an NPN open collector encoder to PLC inputs

Controllers and I/O Published 7 min read By IMDHMI controls team

Short answer

Wire phases A, B and Z to PLC inputs whose schematic sources current into the encoder's open-collector outputs, and only where the shortest pulse is wider than the input's documented minimum pulse time; otherwise use three optocoupler channels into high-speed counter inputs. The encoder manual's CQM1H-CPU43 does not exist: the pulse processor is the CQM1-CPU43, and on the CQM1 CPU the high-speed channels are inputs 4, 5 and 6.

On this page
  1. The current path an NPN output needs
  2. What the manual's connection example really shows
  3. Direct, pull-up or optocoupler: choosing the circuit
  4. Wiring the three buffer channels
  5. Checking a 500 Hz channel against the input's pulse time
  6. Counter settings that keep the counts honest
  7. Power-up checks before enabling motion
  8. Questions asked

Yes — the direct connection can work, and both conditions that decide it are checkable before you energize anything. An E6C2-C6WZ has NPN open-collector outputs on phases A, B and Z: each output transistor only pulls its line down toward the encoder common and never drives it high, so the PLC input must supply the current. Land A, B and Z on inputs whose schematic shows that current path, and only where the shortest pulse is wider than the input's documented minimum pulse time; where either condition fails, put three optocoupler channels between the encoder and the high-speed counter inputs. One correction to the drawing you found: the encoder manual's example names a CQM1H-CPU43, and no unit carries that number — the pulse processor is the CQM1-CPU43.

The current path an NPN output needs #

An open-collector channel is a switch to the encoder's 0 V common and nothing more. When the transistor turns on, current has to arrive from somewhere — from the PLC input's internal pull-up, from an external resistor, or from a buffer module — flow through the receiver, and exit into the transistor to common. Four documented numbers bound the design: the encoder's rated output voltage, which the PLC-side rail must not exceed; the encoder's rated sink current, which the channel must not pull harder than; and the PLC input's guaranteed ON current and guaranteed OFF state. The E6C2-C6WZ ratings sit in its datasheet and are not restated here; read them before choosing a rail or a resistor.

This is also why the label NPN digital input on an input unit cannot be trusted. Some catalogues name an input by the sensor type it accepts, others by the circuit inside it, and the two conventions disagree. Ignore the words and read the input schematic: you need the variant that sources current out of its signal terminal. Wire the encoder to an input built for a sourcing field device and the channel sits at zero forever — the same electrical reason an open collector status output can read nothing on a PLC.

What the manual's connection example really shows #

The datasheet example points at a CQM1H-CPU43; that part number is a typo that has traveled widely. The real unit is the CQM1-CPU43, a high-speed pulse input/output processor with two 15-pin D-sub connectors on its front — hardware built for exactly this encoder. Copying its drawing onto another NPN input unit is a different circuit, and it succeeds only when that unit's schematic sources the current and its pulse specification is fast enough; the NPN on the label decides neither. On the CQM1 CPU itself, the built-in DC inputs 4, 5 and 6 — IN04, IN05 and IN06 in the wiring diagrams — were the channels intended for high-speed encoder input. Those, not the ordinary terminals, are the landing zone for A, B and Z; general-purpose inputs lose encoder edges even at modest speed, for the response-time reasons covered in why digital input counting misses fast encoder pulses.

Direct, pull-up or optocoupler: choosing the circuit #

Circuit Use it when What to watch
Direct into a sourcing-type input the input schematic sources current into the output; the rail stays within the encoder's rated output voltage; the input current stays under the rated sink current a wrong input variant reads permanently off; a shared common carries field noise into the counter
External pull-up resistor the input has no internal current path but accepts the pull-up's rail too small a resistor overloads the output; too large never reaches the guaranteed ON current
Three optocoupler channels the encoder and PLC run different supply domains, the field wiring is noisy, or the input topology cannot be confirmed a slow isolator flattens edges and drops counts even at low frequency

The pull-up rule in one line: with the resistor from the signal line to the rail and the transistor saturated, the sink current is close to the rail voltage divided by the resistance, so one resistor sets both the encoder's load and the input's high level. Choose it so the current sits between the input's guaranteed ON current and the encoder's rated sink current. The optocoupler route removes that balancing act: the module's input side is sized for the encoder, its output side for the PLC, and the isolation comes with it.

Wiring the three buffer channels #

Remove every supply, the encoder's included, and prove the circuit dead before opening a terminal. Then, per channel:

  1. Encoder phase A to the buffer channel's input terminal A1, and terminal A2 to the encoder's positive supply. That polarity matches the buffer arrangement commonly printed for these modules, and it holds only for a device whose datasheet draws the same input circuit.
  2. The channel's output + to the PLC inputs' positive common rail; its output − to the PLC input terminal for that phase.
  3. Repeat identically on the second and third channels for B and Z — one channel each, never shared.
  4. Route the three PLC-side wires to IN04, IN05 and IN06 when your CPU's documentation assigns those terminals as the high-speed channels.
  5. Keep the encoder run away from motor and switched-load conductors, and terminate the shield where the machine's grounding design puts it, so shield current never shares a signal conductor.

Checking a 500 Hz channel against the input's pulse time #

You report a low pulse frequency; here is the check with an example input, so you can rerun it with your real figure.

Inputs:

  • Channel frequency: 500 Hz on phase A — an example value; yours is the encoder's pulses per revolution times shaft revolutions per second.
  • Duty: each quadrature channel is a nominally square wave, so high and low times are equal.
  • Counting mode: 4×, four edges per A/B cycle, taken from the counter configuration.

The rule, in words: the shortest pulse a channel hands the input is half its period, and the input's documented minimum pulse time must be shorter than that; at 4× the counter must also accept four edges in every channel cycle.

Arithmetic:

  • Period T = 1 / f = 1 / 500 Hz = 2 ms
  • Shortest pulse = T / 2 = 2 ms / 2 = 1 ms
  • 4× count rate = 4 edges per cycle × 500 cycles/s = 2000 counts/s

Result: the input chain must pass those 1 ms pulses, and the counter must take 2000 counts/s.

Decision: the bar is 1 ms, and a general-purpose DC input unit does not clear it — its response time is specified in milliseconds because its filter exists to reject signal changes of exactly this speed. Land the phases on the high-speed inputs, IN04 to IN06 on a CQM1 CPU, or on a counter module whose documented pulse width covers it; that response limit is the mechanism behind why a PLC misses short input pulses and how to catch them. The rule for any frequency: when the shortest pulse is at least the input's documented minimum pulse time, direct wiring is sound; when it is shorter, high-speed channels only. At 50 Hz per channel the shortest pulse stretches to 10 ms, which an ordinary input with a faster documented response passes — so a genuinely low frequency is what makes your direct attempt plausible at all.

Counter settings that keep the counts honest #

  • Select A/B quadrature as the counter mode, not single-phase: direction comes from which channel leads. The setup screens differ per CPU family; the walk-through in configure a CP1H high-speed counter for an encoder input shows where the mode and filter selections live on one of them.
  • At 4×, one A/B cycle yields four counts, so scale from the machine calculation — counts per millimetre or per degree of shaft — rather than pasting the encoder's named pulse figure, which is not a 4× number.
  • Set the input filter shorter than the shortest pulse, under 1 ms in the example, choosing among the permitted values the counter setup offers; a longer setting rejects noise but eats pulses.
  • Let the hardware counter do the accumulating. Program logic reads the count; it never gathers edges from a scanned image, which is the same reason PC-polled remote I/O cannot count encoder pulses for SCADA.

Power-up checks before enabling motion #

With the drive disabled or the mechanics blocked, turn the shaft by hand and watch each channel at the buffer indicator, at the PLC's input monitor, or with a meter across the input terminals. Confirm the count direction agrees with the machine's defined positive direction and correct it before scaling. Then enable motion and repeat at working speed: a channel that is clean by hand can still drop out at speed if the filter or the buffer is too slow, and that check is what proves the wiring rather than the diagram.

Questions asked

Which manual documents the CQM1 high-speed inputs?

The CQM1 manual, number W226, covers the CPU's built-in inputs and the CQM1-CPU43 pulse processor, including the count-rate and minimum pulse-width figures for the high-speed channels. Read those two numbers there before you energize the encoder wiring; the encoder datasheet gives its side of the same two checks.

Can the Z phase use the same buffer arrangement as A and B?

Yes. Give Z its own third optocoupler channel, wired exactly like the other two: encoder output to the channel input, channel return to the encoder supply, channel output to its own PLC input. Z delivers one pulse per shaft revolution, so a homing routine latches the count once per turn, and that channel sees far less activity than A or B.

What will the PLC show if the encoder lands on a sourcing-type input with no pull-up?

The input stays off permanently and the counter never increments, whichever way the shaft turns. The transistor can only pull the line down; with nothing in the receiver driving current in, the monitor sits at zero and the fault looks like a dead encoder. Move the same three wires to inputs that source current, or add the buffer channels, and the signals appear.

The counter runs backwards — what changes?

Swap the A and B assignments, at the terminals or in the counter configuration, and leave everything else as wired; quadrature direction is set by which channel leads. Then verify the sign against the machine's defined positive direction before scaling, because a motor that was re-coupled backwards produces the same symptom by a different cause.

Keep reading

  • Explainer

    How discrete PLC I/O modules isolate and switch field signals

    A discrete channel is a power section and a logic section joined only by an optocoupler or a pulse transformer. The Zener diode sets the voltage an input must exceed, an AC triac output leaks a few mA when off, and one channel tops out at 2 to 3 A — which is why big loads switch through an interposing relay.

    Controllers and I/O

  • How-to

    Configure a CP1H high-speed counter for an encoder input

    The CP1H gives you four built-in high-speed counter inputs: single-phase counting to 100 kHz and differential-phase 4x counting to 50 kHz input frequency, with a 32-bit range in linear or ring mode. Wire the encoder's phase outputs to the counter input terminals, set the mode and range in CX-Programmer, and prove the count on a known rotation before you use it for control.

    Controllers and I/O

  • Troubleshooting

    Why PC-polled remote I/O cannot count encoder pulses for SCADA

    A 100 PPR quadrature encoder on a line at 200 m/min produces 333 Hz on channel A, about 1.3 kHz once the counter decodes quadrature at 4x. No PC poll, and no 4 ms discrete input, can follow that rate. Count the pulses in a PLC high-speed counter input and let the SCADA sample the accumulated register.

    Controllers and I/O