OR block
Short summary
Name |
OR |
→POU type |
|
Category |
|
Conform to →IEC-standard |
no restrictions |
Graphical interface |
|
Available since |
version 1.0.0 (for logi.CAD 3) |
Functionality
The block returns the result of a bitwise OR operation of all values connected to the inputs of ANY_BIT.
Compare: "IOR block" for OR operation for values of ANY_INT.
Inputs, return value
|
Identifier |
Description |
|
Inputs: |
IN1 |
BOOL, BYTE, WORD, DWORD or LWORD(corresponds to →generic data type ANY_BIT) |
1st value |
IN2 |
BOOL, BYTE, WORD, DWORD or LWORD(corresponds to →generic data type ANY_BIT) |
2nd value |
|
... (extensible until) |
|||
IN16 |
BOOL, BYTE, WORD, DWORD or LWORD(corresponds to →generic data type ANY_BIT) |
16th value |
|
Return value: |
– |
BOOL, BYTE, WORD, DWORD or LWORD(corresponds to →generic data type ANY_BIT) |
|
Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.
See:
"Blocks for safe logic" whether this block is supported for developing safety-relevant applications.
"Highlighting safe logic in the FBD-editor" for the effects when using the block as a block for safe logic .
Example for usage within ST-editor
PROGRAM Test
VAR
resultB1, resultB2, resultB3, resultB4 : BOOL;
resultW1, resultW2, resultW3, resultW4 : WORD;
END_VAR
resultB1 := OR(IN1 := FALSE, IN2 := FALSE); (* The variable
'resultB1'
evaluates to
'FALSE'
. *)
resultB2 := OR(IN1 := FALSE, IN2 := TRUE ); (* The variable
'resultB2'
evaluates to
'TRUE'
. *)
resultB3 := OR(IN1 := TRUE, IN2 := FALSE); (* The variable
'resultB3'
evaluates to
'TRUE'
. *)
resultB4 := OR(IN1 := TRUE, IN2 := TRUE ); (* The variable
'resultB4'
evaluates to
'TRUE'
. *)
resultW1 := OR(IN1 :=
16
#
0001
, IN2 :=
16
#
0001
); (* The variable
'resultW1'
evaluates to
'16#0001'
. *)
resultW2 := OR(IN1 :=
16
#
0001
, IN2 :=
16
#
0002
); (* The variable
'resultW1'
evaluates to
'16#0003'
. *)
resultW3 := OR(IN1 :=
16
#
0002
, IN2 :=
16
#
0001
); (* The variable
'resultW1'
evaluates to
'16#0003'
. *)
resultW4 := OR(IN1 :=
16
#
0002
, IN2 :=
16
#
0002
); (* The variable
'resultW1'
evaluates to
'16#0002'
. *)
END_PROGRAM
When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.