Lib.Mervis.v1_4.ThreePointValve
The block is used for controlling a three-point valve by generating commands for opening and closing.
program test var valve: lib.mervis.v1_4.ThreePointValve; end_var valve(); end_program
Inputs | Name | Data Type | Retain | Mandatory Connection | Meaning |
x | real | No | Yes | Desired valve position | |
CalibrateMin | bool | No | No | Performs calibration to the closed state | |
CalibrateMax | bool | No | No | Performs calibration to the open state | |
Tmin | time | No | No | Minimum duration of generated pulse | |
Trunopen | time | No | No | Time needed to fully open the valve | |
Trunclose | time | No | No | Time needed to fully close the valve | |
Overrun | real | No | No | Time correction when reaching end positions, allowed range from 0 to 1 | |
EnableEdgePulsing | bool | No | No | Enables generation of periodic opening and closing pulses |
Outputs | Name | Data Type | Meaning | |||||||||||||||||||
Open | bool | Command for opening | ||||||||||||||||||||
Close | bool | Command for closing | ||||||||||||||||||||
Position | real | Current calculated valve position | ||||||||||||||||||||
ValveState | Lib.Mervis.v1_3.ValveStateType | Current state of the block | ||||||||||||||||||||
CompositeState | uint | Bit field describing overall state | Bit | Number | Meaning | 0 | 1 | Fully closed | 1 | 2 | Fully open | 2 | 4 | Valve in motion | 3 | 8 | Active calibration |
The block generates impulses for opening and closing the three-point valve based on defined parameters and position request. Pulse generation is based on the calculated position. Position is calculated based on the lengths of generated pulses. For further explanation, the transition time is understood as the greater value between Trunopen and Trunclose.
If the requested position does not change, the block is in the Idle state. The block considers the minimum step of the requested position according to the minimum pulse duration and the total transition time. If the requested position changes by more than this step, the block transitions to the Moving state and generates pulses on Open and Close until the desired position is reached. If the desired position is fully open or fully closed, a protective pulse of length (the block is in the MovingOverrun state) calculated as a multiple of the transition time and the Overrun parameter is generated.
When requesting end positions, if the EnableEdgePulsing parameter is set to true, additional opening and closing pulses are generated with an on-time equal to four times Tmin (at least 10s) and an off-time equal to one-quarter of the transition time (maximum 20s). During the on-time generation, the block is in the Safe state.
Besides safety pulses, position calibration can be requested using the CalibrateMin and CalibrateMax inputs. Starting calibration causes a pulse to be generated on Close (for CalibrateMin) or Open (for CalibrateMax) with a length equal to the transition time plus 20s, and the corresponding calculated position is set. During this calibration, the block is in the CalibrationMin or CalibrationMax state and does not respond to changes in the requested position until the calibration is complete. It then returns to normal function and states Idle or Moving.