USER MANUAL – Z-GPRS2-SEAL / Z-LOGGER-SEAL
119
= this bit must be False (0)
For example if you want to test if the second bits of the input variable is 1 you can prepare the BIT_MASK:
So, if the input value is (in binary) 1001 0101 0010 10
1
0
The Output function is TRUE because the second bit is 1.
Similarly you can test if the NR 0, 1, 2 and 4 bits are 1 but the 3,5 and 6 are 0 use this BIT_MASK:
So, if the input is (in binary) 1001 0101 0
001 0111
the output function is TRUE
But if the input is (in binary) 1001 0101 0
001 0110
the output function is FALSE
15.2.
Function Block BIT_AND: AND REGISTERS STATE BITS TEST FUNCTION
This block perform a bit test between the two inputs variables connected, only if the test is true for input1
and for input2 the output is true.
The output boolean (True/False) value is obtained by the relation:
OUTPUT = (INPUT1 & BIT_MASK1) AND (INPUT2 & BIT_MASK2)
Where & is the boolean and bit to bit operator, AND is the boolean and operator.
For create the BIT_MASK click on the block:
Where:
= don’t care, this bit is not tested