Bitwise Boolean instructions
513
Part III FP Instructions
For Relay T/C Register Constant
s WX WY WR WL SV EV DT LD FL dec. or hex.
d - WY WR WL SV EV DT LD FL -
Explanation with example value 16#8888 and bit at position 2 moves to destination value at bit
position 15
15 . . 12 11 . .
. . 0
0
15 . . 12 11 . .
8 7 4 5
1 1 1 1 1
15 . . 12 11 . . 8 7 .
0 1 1 1
1 1 1
1 1 1 1
1 1 1 1
1 0 0 0 1 0 0 0 1 0 0 0 1 0 0
. .
. . 0 8 7 4 5 . .
. 0 4 5 . .
. . . .
bit pos
source
bit pos
bit pos
target
result
Bit at position 15 is exchanged, destination value in this example: 16#7FFF
Operands
Example
In this example, the same POU header is used for all programming languages. For an example
using IL (instruction list), please refer to the online help.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
Body
When the variable start is set to TRUE, the function is carried out.
LD
ST
When programming with structured text, enter the following:
IF start THEN
F5_BTM( s:= input_value,
n:= copy_operand,
d=> output_value);
END_IF;