Bit Manipulation

Bit Toggle

medium

Flips the masked bits of a retained word on each rising edge of the toggle command.

What it teaches

Unlike Stateful Masked Move, this does not copy source values. Each command edge flips the selected destination bits to their opposites, while a one-shot ensures a held command acts only once. The everyday shape is one button toggling a chosen group of outputs at once — zone lights, annunciator lamp groups.

Inputs and outputs

TagTypeDefaultDescription
In_ToggleBOOLToggle command; the rising edge flips the masked bits
Cfg_MaskDINT51 bits select which bits flip on each command
Out_WordDINTRetained word whose masked bits flip on each command

Required behavior