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
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_00 | Input | BOOL | 0 | — |
| In_01 | Input | BOOL | 0 | — |
| In_02 | Input | BOOL | 0 | — |
| In_03 | Input | BOOL | 0 | — |
| In_04 | Input | BOOL | 0 | — |
| In_05 | Input | BOOL | 0 | — |
| In_06 | Input | BOOL | 0 | — |
| In_07 | Input | BOOL | 0 | — |
| Out_Word | Output | DINT | 0 | 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.