AND
Function Name |
AND |
---|---|
Description |
Outputs a Boolean value. The output is True if both inputs are true; if either input is False, the AND function has a False output. |
Arguments |
Input 1 to Input n {ANY_BIT} For more information on the data types for the inputs and outputs, see Data Type Hierarchy. |
Returns |
Output {Same data type as input} If any of the inputs is False, the output is False. The output is only True if each of the inputs is True. |
Example:
Function Block Diagram - AND:
A Function Block Diagram has two Boolean inputs: FlowPresent and StopPump. The AND function only outputs a True value if both the FlowPresent and StopPump values are True. If either of the input values are False, the AND function outputs a False value.
ST Program - AND:
The AND function is used to provide a Boolean value that is only True if both inputs are True. The syntax for an AND function in an ST Program is:
- Output := AND (Input 1, Input 2);
Where Output, Input 1 and Input 2 are defined as variables earlier in the ST program. Both Input 1 and Input 2 are Boolean inputs.