← All exercises

Word Invert

easy

Outputs the bitwise complement of an integer input — every bit flipped.

What it teaches

Bitwise NOT flips all 32 bits of a DINT at once. Unlike Lamp Inverted, the input is a packed word rather than one BOOL. The everyday uses: flip a mask so AND clears bits instead of keeping them, and turn an active-low status word — where 0 means fault — back into readable logic.

Inputs and outputs

TagTypeDefaultDescription
In_WordDINT5Word to complement
Out_WordDINTBitwise complement of the input

Required behavior