Description
You can use the instruction "AND logic operation" to query the signal states of two or more specified operands and evaluate them according to the AND truth table.
If the signal state of all the operands is "1", then the condition is fulfilled and the instruction returns the result "1". If the signal state of one of 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 "TRUE". CMP == is shown as "active". Operand 2: CMP == (data type INT) returns the signal state "TRUE". CMP == is shown as "active". Operand 3: CMP == (data type String) returns the signal state "FALSE". CMP == is shown as "active". Operand 4: CMP == (data type String) returns the signal state "TRUE". CMP == is shown as "inactive". Result of the "AND logic operation": Signal state "FALSE". |
Parameters
The following table shows the parameters of the instruction "AND 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" and "TagIn_2" is "1" and reset when the state of the operands "TagIn_1" and "TagIn_2" is "0".
See also
AND truth table (S7-1200, S7-1500)
Overview of the valid data types
Adding additional inputs and outputs to FBD elements (S7-1200, S7-1500)
System memory areas (S7-1200)
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 detecting the direction of a conveyor belt
Example of controlling room temperature
Example of detecting the fill level of a storage area