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 NOP keeps the routine valid so everything else can compile and run.
  • Documentation rung — a NOP rung 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 the NOP gives the comment a rung to live on without affecting the machine.

0

[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.

0

StartButton

[AFI]

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

[AFI]

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 outTypical use
NOPunchangedstub out a rung, or carry a rung comment as a section header
AFIalways 0temporarily disable a rung while testing

Common Mistakes

  • Leaving an AFI in finished logic — the rung silently never runs. Search your routine for AFI before you call a program done.
  • Putting an AFI alone on a rung — it is an input instruction, so the rung still needs an output and reports an error. A comment-only rung is what NOP is for.
  • Keeping dead logic disabled with an AFI forever. If the logic is dead, delete it.

On this page