Hi Bruce,
Welcome to the wonderful world of bit masking. Consider investigating the following function blocks under the Integer folder:
BwAnd = Integer AND mask
BwOR = Integer OR mask
BWRotateLeft = Bit-wise rotate left
BWRotateRight = Bit-wise rotate right
The idea is to use a bit-mask to compare one or more specific bits in a integer that is bit-packed. For example, an 8-bit integer contains the following bit pattern: 01001011. A second integer is used to extract a specific bit. To test the fourth bit from the right, a mask of 00001000 is used. The result of 01001011 AND 00001000 = 00001000. Compare this value with ODD to determine if the bit is true or false. Or, you may shift the result 3 places to the right with BWRotateRight for a result of 00000001. There are many ways to achieve similar results. A quick, untested example is given below:
In this example, a constant input value of 1 in the RotateLeft block is rotated left by the number of positions specified by the N input to create a MASK. This MASK is BwAND'd to a bit-packed integer to extract a specific bit of interest. And Odd function provides a digital output that is either TRUE or FALSE.
There are many schemes that will work to achieve the same result. Some solutions are more clever than others. Maybe someone on the forum will suggest a more eloquent scheme?
Integer bits can be manipulated on a bit by bit basis in a similar manner using a MASK and BWOr function.
Regards,
/Ron