NOP / AFI — No Operation and Always False
NOP and AFI in rungs.dev — NOP is a placeholder that does nothing, AFI forces the rest of its rung false. Both are used while building and debugging programs, not in finished logic.
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.
0
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.
0
StartButton
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:
0
Override
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.
FAL and FSC — Loop Over an Array
FAL and FSC in rungs.dev run one expression once per array element. FAL stores each answer; FSC stops at the first element that passes. Use them to scale a batch or find a value.
What is Structured Text?
Structured Text (ST) is a high-level text-based PLC language similar to Pascal or C. Learn the basics and run ST programs in the rungs.dev browser-based simulator.