Bitwise OR OR

Dest gets the bits that are on in A or B.

TagAfter two scans
MaskA12
MaskB10
MaskOr14

How it works

While the rung is true, each bit of Dest is on where that bit is on in A, in B, or in both. A false rung changes nothing.

How it's used

Use OR to turn bits on without changing the others.

TagValue
Lamps5

Bit 2 turned on. Bit 0 stayed on: 1 became 5.

Operands

OperandData typeRead or write
ADINT or a numberReads
BDINT or a numberReads
DestDINTWrites

Common mistakes

  • Using it as a rung branchOR here writes a DINT word. For either-or logic on a rung, use a branch.