Learn Automation with MINATA #63: Sequential Programming — From the Process Flow to Steps, Conditions and Timeouts
Sequential Programming: From the Process Flow to Steps, Conditions and Timeouts
A good automatic cycle reads like an operating procedure: which step it is on, what condition it is waiting for, how long before it stops, and what it reports when it does. Sequential programming starts from the process flow, not from extending a ladder rung by rung.
Break the cycle into atomic steps
Instead of one large block of logic held together by intermediate flags, break the cycle into steps with a single objective each: wait for a condition, clamp the part, confirm the clamp, perform the operation, confirm completion, release the part. Each step knows what it is doing and which step follows, which makes online tracing and handover far easier.
The three parts of a transition
Every transition between steps needs three things:
- A valid condition: which signal permits the move to the next step.
- A maximum waiting time: what happens when the condition is not satisfied within it.
- A failure response: lock out the necessary energy, raise an alarm, and keep a trace of the step that failed.
Missing timeouts are the source of "the machine just stands there saying nothing". A missing failure response is the source of wrong motion when a step never completed.
SFC and thinking in steps
This organisation is close to the Sequential Function Chart of IEC 61131-3: steps and transitions in series, with branches and parallel paths where needed. Whether you write it in SFC or in structured text, the thinking is the same — a step with a defined action and a transition with a defined condition, rather than a tangle of interlocking flags.
A worked engineering situation
On a pick-and-place station, if the clamp sensor does not confirm within the timeout, the PLC does not advance to the next step. It locks out the necessary energy, raises an alarm naming the failing step — "step 3: timeout waiting for clamp confirmation" — and holds the state so a technician can trace it. The operator sees exactly which step is stuck, instead of a machine standing silent.
The number of steps, the conditions and the timeouts all follow the process, the mechanism and the real risk assessment.
Common mistakes
- Extending a ladder with more and more flags, with no clear steps.
- Transitions with no timeout, so the machine stalls and reports nothing.
- No failure response, so the sequence advances before a step completed.
- One step carrying several objectives, hard to trace when it fails.
- Keeping no trace of the failing step for fault-finding.
Sequential programming checklist
- [ ] The cycle is divided into atomic steps with one objective each.
- [ ] Every transition has a valid condition and a timeout.
- [ ] There is a failure response: energy locked out, alarm raised, trace kept.
- [ ] The current step and the failing step are both visible on the HMI.
- [ ] The logic reads like a procedure and can be traced and handed over.
A clearly stepped sequence is the foundation of a machine that is easy to operate and easy to diagnose. #64 separates interlocks from permissives, two ideas that are often merged into one.
Read more automation knowledge at MINATA: https://minatavn.com/en/blog/industrial-automation
Previous — #62: PackML machine states: https://minatavn.com/en/blog/automation-62-packml-machine-states
Next — #64: Interlocks and permissives: https://minatavn.com/en/blog/automation-64-interlock-permissive
View all MINATA technical articles