Bit Manipulation
Pack, mask and modify integer words
Read and build packed device registers, then use masks to keep, force, replace or remember selected bits without disturbing the rest of the word.
- 0
Word Invert
EXERCISEDifficultyeasyStatus—unknown - 1
// Outputs a word whose bits are set only where the command and feedback words disagree.
Bit Difference
EXERCISEDifficultyeasyStatus—unknown - 2
// Packs eight BOOL inputs into the low eight bits of one DINT word.
Bit Pack
EXERCISEDifficultyeasyStatus—unknown - 3
// Unpacks the low eight bits of a DINT word into eight BOOL outputs.
Bit Unpack
EXERCISEDifficultyeasyStatus—unknown - 4
// Combines two 16-bit device registers into one 32-bit word.
Combine Two Registers
EXERCISEDifficultymediumStatus—unknown - 5
// Reads a 16-bit register from a device that sends its high byte first.
Swap Register Bytes
EXERCISEDifficultyeasyStatus—unknown - 6
// Reads a REAL that a Modbus device sends in two registers, high word first.
REAL From Two Registers
EXERCISEDifficultymediumStatus—unknown - 7
// Sends a REAL to a device that reads 32-bit values highest byte first.
REAL in Network Byte Order
EXERCISEDifficultymediumStatus—unknown - 8
// Passes only the input bits selected by a mask; every unselected output bit is zero.
Apply Bit Mask
EXERCISEDifficultyeasyStatus—unknown - 9
// Forces selected bits of a word on while preserving every other input bit.
Set Selected Bits
EXERCISEDifficultyeasyStatus—unknown - 10
// Replaces selected bits in an existing word while preserving every unselected bit.
Replace Selected Bits
EXERCISEDifficultymediumStatus—unknown - 11
// Copies selected source bits into a retained word while preserving its previous unselected bits.
Stateful Masked Move
EXERCISEDifficultymediumStatus—unknown - 12
// Flips the masked bits of a retained word on each rising edge of the toggle command.
Bit Toggle
EXERCISEDifficultymediumStatus—unknown - 13
// Works out which byte order a device uses from a value it is known to report.
Detect the Byte Order
EXERCISEDifficultyhardStatus—unknown - End
// Outputs the bitwise complement of an integer input — every bit flipped.