← Bit Manipulation

Bit Pack

easy

Packs eight BOOL inputs into the low eight bits of one DINT word.

What it teaches

Build a packed word by clearing it, then writing each BOOL directly to its matching bit address: In_00 controls bit 0 through In_07 controlling bit 7. Clearing first guarantees bits 8-31 are 0 instead of retaining stale data.

Parameters

TagDirectionTypeDefaultDescription
In_00InputBOOL0—
In_01InputBOOL0—
In_02InputBOOL0—
In_03InputBOOL0—
In_04InputBOOL0—
In_05InputBOOL0—
In_06InputBOOL0—
In_07InputBOOL0—
Out_WordOutputDINT0Packed input bits; bits 8-31 are 0

Required behavior