Explainer
Stepper pulse timing from a PLC discrete output module
Short answer
A PLC discrete output can index a stepper, but the scan sets the pace: one complete pulse per two scans, so a 10 ms scan delivers about 50 pulses per second and a full-step 90-degree move takes about 1.0 s. Count only what the scan can see, match the driver input polarity before wiring, and move to a dedicated pulse output when the move must be faster.

On this page
A PLC discrete output module can index a stepper motor, but the scan — not the module's switching speed — sets the pace. Ladder logic that turns a point on for one scan and off for the next emits exactly one complete pulse per two scans, so the fastest train the program can count is 1 ÷ (2 × scan time). At a typical 10 ms scan, a full-step quarter turn takes about 1.0 s: fine for an indexer, useless for continuous motion. This article works the timing arithmetic for a 90-degree move, explains why a flasher set faster than the scan loses count, and settles the wiring rule — a sourcing output feeds a sinking driver input, never through a relay — so you can decide whether the discrete-output path fits your axis.
What the scan does to a pulse train #
The scan cycle reads the inputs, executes the program and writes the outputs, then starts over — a loop that typically completes in 1 to 20 ms depending on program size and processor. A discrete output changes state only when the scan writes the output image, so a rung that energizes the point for one scan and de-energizes it for the next emits one complete pulse per two scans. That gives the counting limit this whole article rests on: the fastest reliable pulse rate is 1 ÷ (2 × scan time). The table works the formula at three scan times.
| Scan time | Max counted pulse rate | Full-step shaft speed* |
|---|---|---|
| 1 ms | 500 pulses/s | 150 rpm |
| 3 ms | about 167 pulses/s | 50 rpm |
| 10 ms | 50 pulses/s | 15 rpm |
*Shaft speed assumes the full-step setting used in the worked example below; divide it by your microstep multiplier.
The rest of the signal chain is far faster than any row in that table. A transistor output point switches in fractions of a millisecond, and a stepper driver's optoisolated step input is typically rated into the tens of kilohertz. Neither the module's response nor the driver's input is ever the bottleneck on a scan-generated train — the scan is.
Timing a 90-degree move at 200 pulses per revolution on a 10 ms scan #
The case: a shaft that must index one quarter turn and hold, with no microstepping — a clamp-index or parts-present move. The inputs, and where each comes from:
- Target move: 90 degrees of shaft rotation, then stop and hold.
- Step setting: 200 pulses per revolution — the full-step setting of a 1.8-degree motor, no microstepping.
- Scan time: 10 ms — an example value for a program of ordinary size; read the real figure from your controller's scan-time diagnostic.
- Output switching response: 0.5 ms to turn on and 0.5 ms to turn off — an example figure for a discrete transistor output module; take yours from that module's specification.
The rule in words: the pulse count is the fraction of a revolution multiplied by the pulses-per-revolution setting, and the move time is that count multiplied by two scans per pulse and by the scan time. The output's switching delays then stretch the move by one turn-on lag at its first edge and one turn-off lag at its last.
pulses = (90 / 360) × 200 pulses per revolution = 50 pulses
move time = 50 pulses × 2 scans per pulse × 10 ms per scan = 1000 ms ≈ 1.0 s
with switching: 1000 ms + 0.5 ms + 0.5 ms ≈ 1001 ms
The delays add about a millisecond in total, not one per pulse: every edge is delayed alike, so the pulse period itself stays two scans and only the start and the finish of the move shift.
Decision: this meets a one-second index requirement with about a millisecond to spare — no margin for the scan to grow. If the move must land clearly under 1.0 s, or the program's scan can drift past 10 ms when the machine is busy, clock the train on the controller's dedicated pulse output instead, where the scan no longer sets the rate. Converting an angle to a pulse count is the same scaling arithmetic as the step-and-direction pulse scaling calculation. A microstepping setting multiplies the pulse count by its ratio and leaves the scan-limited rate unchanged, so the move time scales with it — the drive's pulse frequency limit versus microstep demand shows how fast that demand grows.
Why a flasher faster than the scan loses count #
A flasher or toggle instruction looks tempting: set a rate, let it run, stop at the count. The instruction toggles its bit inside the same scan, though, and the physical output still updates once per scan. Command more than one transition per scan and the extra transitions never reach the wire — the output image holds only the last state each scan wrote. If the ladder, or the instruction's own accumulator, counts commanded toggles, the count says 50 while the driver received fewer edges, and the shaft stops short of position.
Decision: for a counted move, generate one pulse per on-scan/off-scan pair in the ladder and count completed pulses in the same scan-controlled sequence, so every commanded edge appears on the wire and the count matches the driver's input exactly. A faster flasher is only acceptable for an open-loop jog whose endpoint you verify at the machine, never for stopping at an exact pulse count.
Matching a sourcing output to a sinking driver input #
Sourcing and sinking describe which side of the circuit the switching element supplies: a sourcing output provides the voltage and the load returns to ground, while a sinking output provides the ground path and the load is fed from a supply. The pairing rule is absolute — a sourcing output drives a sinking input and a sinking output drives a sourcing input. Connect two of the same kind and the optocoupler never conducts.
A stepper driver's step and direction inputs are optocouplers, and they need a defined forward current to turn on, commonly specified somewhere between about 5 and 15 mA; take the exact figure, and the voltage it applies at, from the driver's specification sheet. Many drivers expose both sides of the input LED so either polarity can be wired; others tie one side to an internal common and expect the controller to sink. Documentation for the same drive family can disagree with itself — product pages and schematics are not always in step — so read the input circuit, not the terminal names.
Decision: if the module output is sourcing and the driver input needs sinking, fit a small interface stage — one NPN transistor per signal, with a series resistor sized for the driver's input current — rather than adapting the wiring until it works. The same interface sets the voltage and current the optocoupler sees, which matters when the module's logic voltage differs from the driver's input rating. Do not put a mechanical relay in a step or direction line: it switches in milliseconds and its contacts bounce, slower than the scan itself.
One safety note: the output module and the driver often run from separate supplies, so tie the optocoupler circuit to a single reference and, with the power off, confirm nothing connects the two supplies before energizing — a common tied across both is the classic way to destroy the input stage.
The decision for each case #
Case 1 — a short indexed move where about a second of motion is acceptable. The discrete output works: drive one pulse per on-scan/off-scan pair, count completed pulses in the same sequence, stop at the count, and check the delivered edges at the driver input before coupling the load.
Case 2 — the move must be faster than the example delivers, must repeat rapidly, or needs microstepping. Move the train to the controller's dedicated pulse output or a motion instruction, which clock pulses outside the scan; the pattern in running a stepper conveyor from a PLC pulse output is the one to follow.
Case 3 — the polarities do not match, or the only spare points are relay contacts. Add the transistor interface for polarity and input current; a relay is not a step-pulse interface, because it is slower than the scan and its contacts bounce.
The discrete-output path is an indexer: exactly counted, deliberately slow, and never faster than one pulse per two scans. Decide which of those your axis needs, and put the pulses where they belong.
Questions asked
How many pulses does a 90-degree stepper move need at full step?
A 90-degree move is one quarter of a revolution, so it needs one quarter of the pulses-per-revolution setting; the worked example above carries the arithmetic. Microstepping multiplies that setting: at 8 microsteps the setting becomes 1,600 pulses per revolution, the quarter turn needs 400 pulses, and at the same scan-limited rate the move takes four times as long.
Can a relay output generate step pulses for a stepper driver?
No. A mechanical relay needs several milliseconds to operate and again to release, which is the same order as the entire scan period, and its contacts bounce for a few milliseconds when they close. The driver's optocoupler therefore sees edges that are stretched, doubled or missing, and a counted move can land at the wrong position. Use a transistor output point, or a small transistor interface stage, for every step and direction signal.
How can I tell whether a stepper driver input needs sinking or sourcing?
Read the input circuit, not the terminal names. If one side of the input is a common meant to be tied to the positive supply and the controller must pull the signal side toward ground, the input needs a sinking signal. If the common sits at ground potential and the signal terminal must receive the positive voltage, it needs a sourcing signal. When the product page and the schematic disagree, trust the schematic, and add an interface when the polarities do not match.
What scan time does a target speed need from a discrete output?
Invert the timing rule: the scan must run at 1 divided by twice the pulse rate or faster. A full-step speed of 60 rpm needs 200 pulses per second on the example's motor, so the scan must be 2.5 ms or faster, because 1 divided by (2 x 200 pulses per second) = 2.5 ms. That is why continuous motion belongs on a dedicated pulse output and short indexed moves stay practical on a discrete point.
