Supported platforms: CODESYS 2.3, CODESYS 3.5
PVC_CurrentValvePair function block controls a current controlled proportional pair in products that have a controller built in at firmware, such as Epec 5050.
The function block calls PVC_Attenuation FB and one of the ramp FBs according to the user’s selection.
The FB uses PVC_To_CurrentReq function to scale the control signal to current requests.
The FB checks it’s own parameters to ensure their valid values. In case of an incorrect value in any of the parameters, o_ParameterError output is activated.
A value of -32768 in i_ControlValue will be limited (overwritten) internally to -32767.
In case of a parameter error or i_Enable is inactive, current request outputs are reset.
With i_EnableCounterControl input, the user can enable a counter control feature. The counter control feature allows both valves to be controlled simultaneously.
If i_Enable is inactive or in case of a parameter error or AI voltage error, the current request outputs are set to zero.
Use with hardware that has a built-in current controller (i.e. mA value is written to output) or with PVC_AdaptiveController. |
i_Control must be 0 on the rising edge of i_Enable status. Otherwise control is not enabled. |
When the linear ramp type is selected, the ramp speed changes when the current parameters are changed. |
Input variable name |
Data type |
Range |
Description |
i_Enable |
BOOL |
FALSE/TRUE |
Enables controlling of the current request outputs. |
i_Control |
INT |
-32767..32767 |
Control signal from e.g. joystick |
i_PosDirMaxCurrent |
UINT |
1..2500 mA |
Maximum current for valve that is controlled with positive control signal |
i_PosDirMinCurrent |
UINT |
1..2500 mA |
Minimum current for valve that is controlled with positive control signal |
i_NegDirMinCurrent |
UINT |
1..2500 mA |
Minimum current for valve that is controlled with negative control signal |
i_NegDirMaxCurrent |
UINT |
1..2500 mA |
Maximum current for valve that is controlled with negative control signal. |
i_RampType |
BYTE |
0..G_RampTypeMax |
Defines which one of the available ramp functions is used. |
i_PosDirAscendRamp |
UINT |
Depends on selected ramp type |
Ascending speed for valve that is controlled with positive control signal, range and unit depends on selected ramp type. |
i_PosDirDescendRamp |
UINT |
Depends on selected ramp type |
Descending speed for valve that is controlled with positive control signal, range and unit depends on selected ramp type. |
i_NegDirAscendRamp |
UINT |
Depends on selected ramp type |
Ascending speed for valve that is controlled with negative control signal, range and unit depends on selected ramp type. |
i_NegDirDescendRamp |
UINT |
Depends on selected ramp type |
Descending speed for valve that is controlled with negative control signal, range and unit depends on selected ramp type. |
i_PosDirAttenuationOn |
BOOL |
FALSE/TRUE |
If input is true, controlling of positive direction valve is limited to given percentage of max control. |
i_NegDirAttenuationOn |
BOOL |
FALSE/TRUE |
If input is true, controlling of negative direction valve is limited to given percentage of max control. |
i_PosDirAttenuationAmount |
BYTE |
0..100% |
Amount of attenuation for positive direction valve. |
i_NegDirAttenuationAmount |
BYTE |
0..100% |
Amount of attenuation for negative direction valve. |
i_EnableCounterControl |
BOOL |
FALSE/TRUE |
Both valves can be controlled at the same time. |
Output variable name |
Data type |
Range |
Description |
o_PosDirCurrentRequest |
UINT |
0..2500 mA |
Current request for valve controller that is controlled with positive control signal. |
o_NegDirCurrentRequest |
UINT |
0..2500 mA |
Current request for valve controller that is controlled with negative control signal. |
o_ParameterError |
BOOL |
FALSE/TRUE |
True if there is an incorrect parameter value in any of the FB’s inputs. |
Output variable name |
Data type |
Range |
Description |
o_PosDirCurrentRequest |
UINT |
0..2500 mA |
Current request for valve controller that is controlled with positive control signal. |
o_NegDirCurrentRequest |
UINT |
0..2500 mA |
Current request for valve controller that is controlled with negative control signal. |
o_ParameterError |
BOOL |
FALSE/TRUE |
True if there is an incorrect parameter value in any of the FB’s inputs. |
o_IllegalControlRequestInStartup |
BOOL |
FALSE/TRUE |
True if unexpected control request occurs. i_Control is not 0 when i_Enable is set to true. |
Source file Topic000332.htm
Last updated 21-Feb-2025