Standard function blocks
340
Bitwise
BGET
(10034)
Illustration
Execution time 0.88 µs
Operation The output (O) is the value of the selected bit (BITNR) of the input (I).
BITNR: Bit number (0 = bit number 0, 31 = bit number 31)
If bit number is not in the range of 0…31 (for DINT) or 0…15 (for INT), the output is 0.
Inputs The input data type is selected by the user.
Number of the bit (BITNR): DINT
Input (I): DINT, INT
Outputs Output (O): Boolean
BITAND
(10035)
Illustration
Execution time 0.32 µs
Operation The output (O) bit value is 1 if the corresponding bit values of the inputs (I1 and I2)
are 1. Otherwise the output bit value is 0.
Example:
Inputs Input (I1, I2): DINT
Outputs Output (O): DINT
BGET
(DINT) 64
TLA1 1 msec (1)
BITNR
I
O
O(64)
BITAND
65
TLA1 1 msec (1)
I1
I2
O
O(65)
I1 11100000111001011101001100110101
I2 00000111001011101001100110101111
O 00000000001001001001000100100101