Branches and OR Logic

Use parallel branches in Ladder Logic to express OR conditions in rungs.dev. Series contacts AND together; parallel branches OR — combine them for any boolean rule.

A branch is a parallel path on a rung. Power flows through the rung if any one of the parallel paths is true. Branches are how Ladder Logic expresses OR.

Series = AND

Contacts placed in series on the same horizontal line are ANDed:

0

A

B

Out

Out is energized when A AND B are both true.

Parallel = OR

Contacts placed in parallel branches are ORed:

0

A

B

Out

Out is energized when A OR B is true.

Practice

Try both in Learn: Either-Button Lamp for OR logic, and Two-Button Lamp for AND.

Combining Series and Parallel

You can mix both on one rung. This is the classic start/stop seal-in:

0

Fault

Alarm

Reset

/

Alarm

  • When Fault goes true, Alarm energizes.
  • The Alarm contact in the lower branch keeps the rung true even after Fault clears — the alarm is now "sealed in".
  • Pressing Reset breaks the series path and drops Alarm back to 0.

Multi-Level Branches

A single branch can have more than two parallel paths — each path is another level:

0

A

B

C

Out

Out is energized when A OR B OR C is true. Add as many levels as you need; the rung stays flat and readable.

Nested Branches

Branches can contain further branches. Keep nesting shallow — two or three levels. Deeply nested rungs become unreadable; split them into multiple rungs instead.

0

A

B

C

D

Out

Out is energized when ((A OR B) AND C) OR D is true — the inner branch (A OR B) sits inside a path of the outer branch.

Adding a Branch in Rungs Studio

The Ladder Logic toolbar sits at the top of the editor. Use the branch tool in the toolbar to insert a parallel path on a rung. To add another parallel path to an existing branch, select a circuit and click the branch-level tool . Drop contacts into the new branch like any other instruction.

Tips

  • Each branch should do one thing. If a branch gets long, promote it to its own rung.

On this page