NOP / AFI — No Operation and Always False
Most instructions read or write tags. These two exist for a different reason: they help you build and debug a program. Neither takes any operands — you place them on a rung from the Program tab of the ladder toolbar, and there is nothing to fill in.
NOP — No Operation
Does nothing. Power flows through it unchanged.
Two everyday uses:
- Placeholder — when you know a rung will be needed but haven't written its logic yet,
a rung containing just a
NOPkeeps the routine valid so everything else can compile and run. - Documentation rung — a
NOPrung exists only to carry a rung comment. Programmers use these as headers between sections of a routine: the comment explains what the next rungs do, and theNOPgives the comment a rung to live on without affecting the machine.
NOP()
AFI — Always False
Forces the rest of the rung false, every scan, no matter what comes before it.
Use it to temporarily disable a rung without deleting anything: place an AFI at the start
of the rung, and every instruction after it sees no power. Remove it and the rung works
exactly as before. This is a standard trick when testing a machine — modeled on the Always
False instruction in Logix 5000® controllers.
XIC(StartButton)AFI()OTE(Motor)
Here Motor stays off even while StartButton is pressed, because the AFI blocks the
power before it reaches the coil.
Placed inside a branch, an AFI only kills its own path — parallel paths still work:
[AFI(),XIC(Override)]OTE(Motor)
Motor still follows Override, because only the first path is forced false.
AFI is an input instruction — it conditions a rung, it doesn't complete one. A rung
containing only an AFI is an error, because every rung still needs an output instruction.
If you want a rung that exists only to hold a comment, that's NOP's job.
How They Differ
| Power in → power out | Typical use | |
|---|---|---|
NOP | unchanged | stub out a rung, or carry a rung comment as a section header |
AFI | always 0 | temporarily disable a rung while testing |
Common Mistakes
- Leaving an
AFIin finished logic — the rung silently never runs. Search your routine forAFIbefore you call a program done. - Putting an
AFIalone on a rung — it is an input instruction, so the rung still needs an output and reports an error. A comment-only rung is whatNOPis for. - Keeping dead logic disabled with an
AFIforever. If the logic is dead, delete it.