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.
Inputs and outputs
| Tag | Type | Default | Description |
|---|---|---|---|
| In_00 | BOOL | — | — |
| In_01 | BOOL | — | — |
| In_02 | BOOL | — | — |
| In_03 | BOOL | — | — |
| In_04 | BOOL | — | — |
| In_05 | BOOL | — | — |
| In_06 | BOOL | — | — |
| In_07 | BOOL | — | — |
| Out_Word | DINT | — | Packed input bits; bits 8-31 are 0 |
Required behavior
- Each input maps to one bit of Out_Word: In_00 drives bit 0 through In_07 driving bit 7.
- Out_Word is cleared and bits 0-7 are rebuilt from the inputs every scan.
- Bits 8-31 of Out_Word are always 0.