OR Connection
The content of the accumulator is connected with the operand defined in the operand field by a logical OR operation. The result is transferred to the accumulator.
Input
1st input: element 1 of logical OR operation
2nd input: element compared to input 1
Output
Output as input: result
Input 1 |
Input 2 |
Output |
|
---|---|---|---|
Signal |
0 |
0 |
0 |
1 |
0 |
1 |
|
0 |
1 |
1 |
|
1 |
1 |
1 |
All input and output variables used for programming this function have been declared in the POU header.The same POU header is used for all programming languages.
VAR
bvar_1: BOOL:=FALSE;
(*Input_1*)
bvar_2: BOOL:=FALSE;
(*Input_2*)
bvar_3: BOOL:=FALSE;
(*Input_3*)
bvar_4: BOOL:=FALSE;
(*Output*)
END_VAR
bvar_3:= var_1 OR bvar_2;
LD |
bvar_1 |
(* Load bvar_1 in accu *) |
OR |
bvar_2 |
(* Perform an OR of accu with bvar_2; store result in accu *) |
ST |
bvar_3 |
(* Store accu in bvar_3 *) |