← 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.

Parameters

TagDirectionTypeDefaultDescription
In_ToggleInputBOOL0Toggle command; the rising edge flips the masked bits
Cfg_MaskInputDINT51 bits select which bits flip on each command
Out_WordOutputDINT0Retained word whose masked bits flip on each command

Required behavior