UPC logic example
Logic operators can be used to combine the results from two ranges to give a TRUE or FALSE result.
The following example shows a scenario for controlling the status of a pump depending on the depth in the controlling reservoir and the time of day.Under this scenario, the pump will be switched Off between 16:00 and 19:00 hours. At other times, the pump will be switched on when the pressure at RHighL (depth in reservoir RHighL) drops below the trigger level of 2m. When the level in the reservoir rises to 2m the pump will be switched off by default.
The scenario is defined by adding components to a pump regulator in the UPC window.
Component | Parameters | Effect |
---|---|---|
RANGE 1 | Range type: Time Minimum: 16:00 | TRUE if time is between 16:00 and 19:00 hours |
RANGE 2 | Range type: Pressure Location node: RHighL Minimum: Maximum: 2m | TRUE if depth at Reservoir node RHighL is less than 2m |
LOGIC 1 | Operator: NOT Condition 1: RANGE 1 | TRUE if RANGE 1 is FALSE |
LOGIC 2 | Operator: AND Condition 1: LOGIC 1 Condition 2: RANGE 2 | TRUE if both LOGIC 1 and RANGE 2 are TRUE |
RULE 1 | Condition: _default_ | Default status of pump is OFF |
RULE 2 | Condition: LOGIC 2 | Switch pump ON if LOGIC 2 is TRUE |
- Range 1: Defines time as a control with a range between 16:00 and 19:00 hours Show image
- Range 2: Defines Reservoir RHighL as a control point with a maximum value of 2m Show image
- Logic 1: If the time is not between 16:00 and 19:00 hours, this logic statement it TRUE Show image
- Logic 2: If the time is not between 16:00 and 19:00 hours AND the level in Reservoir RHighL is less than 2m, this logic statement is TRUE Show image
- Rule 1: Unless subsequent rules are true, the pump will be set to the default status of OFF Show image
- Rule 2: Switches the pump ON if the level in Reservoir RHighL is less than 2m and the time is not between 16:00 and 19:00 hours Show image
For a further example including logics and other dependents, see About user programmable control (UPC).