Bitwise AND AND

Dest gets the bits that are on in both A and B.

TagAfter two scans
Word112
Word210
WordOut8

How it works

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

How it's used

Use AND with a mask to keep only some bits of a word.

TagValue
Inputs182
Low46

Mask 15 keeps the lowest four bits: 182 becomes 6.

Operands

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

Common mistakes

  • Using BOOL tagsWord logic works on whole DINT words, 32 bits at once.