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.
MOVE / MVM — Copy a Value
MOVE copies a literal or tag into a destination tag every scan in rungs.dev, converting between DINT and REAL when the types differ. MVM is a masked move that copies only selected bits.
Compare — EQ / NE / GT / GE / LT / LE
Reference for Ladder Logic compare instructions in rungs.dev — EQ, NE, GT, GE, LT, LE — that pass power along a rung when the numeric relationship holds.