Description
You can use the instruction "OR logic operation" to query the signal states of two or more specified operands and evaluate them according to the OR truth table.
If the signal state of one of the operands is "1", then the condition is fulfilled and the instruction returns the result "1". If the signal state of all the operands is "0", then the condition is not fulfilled and the instruction generates the result "0".
|
Note Instructions displayed as "inactive" at the operands Under the following conditions:
Result: In online mode, the following comparator operations (data type String, WString or Variant) of the interconnection is shown as "inactive". Example: Operand 1: CMP == (data type String) returns the signal state "FALSE". CMP == is shown as "active". Operand 2: CMP == (data type String) returns the signal state "TRUE". CMP == is shown as "active". Operand 3: CMP == (data type String) returns the signal state "TRUE". CMP == is shown as "inactive". Operand 4: CMP == (data type INT) returns the signal state "TRUE". CMP == is shown as "active". Result of the "OR logic operation": Signal state "TRUE". |
Parameters
The following table shows the parameters of the instruction "OR logic operation":
|
Parameters |
Declaration |
Data type |
Memory area |
Description |
|
|---|---|---|---|---|---|
|
S7-1200 |
S7-1500 |
||||
|
<Operand> |
Input |
BOOL |
I, Q, M, D, L or constant |
I, Q, M, D, L, T, C or constant |
The operand indicates the bit whose signal state will be queried. |
Example
The following example shows how the instruction works:
Output "TagOut" is set, when the signal state of the operands "TagIn_1" or "TagIn_2" is "1".
See also
OR truth table (S7-1200, S7-1500)
Adding additional inputs and outputs to FBD elements (S7-1200, S7-1500)
System memory areas (S7-1200)
Overview of the valid data types
Insert input (S7-1200, S7-1500)
Inserting FBD elements
Editing FBD elements
Inserting operands in FBD instructions
Memory areas (S7-1500)
FBD programming examples
Example of controlling a conveyor belt