Supported platforms: CODESYS 2.3, CODESYS 3.5
The function block converts current request to PWM value. PWM output is controlled with PVC_PI_Controller.
PVC_ValveDiagnostic is called for broken and short circuit diagnostics. It also detects if feedback current is over the maximum
allowed leakage current when no current is requested.
|
This function block is primarily intended for ProportionalValveControl library's internal use. |
Input variable name |
Data type |
Range |
Description |
i_Enable |
BOOL |
TRUE/FALSE |
Enables the outputs |
i_CurrentRequest |
UINT |
0..2500mA |
Requested current in mA |
i_FeedbackCurrent |
UINT |
0..2500mA |
Measured current (mA) from feedback. |
i_FBType |
BYTE |
0.. G_ADScaleArrMax |
Hardware specific feedback pin type |
i_Fast |
BOOL |
TRUE/FALSE |
Use fast PI curve pre-scaled parameters by default. Pre-scaled P and I are used if either of given (i_P_Gain or i_I_Gain) is zero. |
i_P_Gain |
UINT |
0..65535 |
Proportional gain value of PI controller, 1000 = 1 |
i_I_Gain |
UINT |
0..65535 |
Integration gain value of PI controller, 1000 = 1 |
i_CoilResistance |
UINT |
3..200 Ohm |
Nominal coil resistance |
i_ErrorDelay |
UINT |
0..65535 ms |
Error activation delay in ms. |
Input variable name |
Data type |
Range |
Description |
i_Enable |
BOOL |
TRUE/FALSE |
Enables the outputs |
i_CurrentRequest |
UINT |
0..2500mA |
Requested current in mA |
i_FeedbackCurrent |
UINT |
0..2500mA |
Measured current (mA) from feedback. |
i_PWM_Maximum |
DINT |
|
PWM maximum value for scaling |
i_Fast |
BOOL |
TRUE/FALSE |
Use fast PI curve pre-scaled parameters by default. Pre-scaled P and I are used if either of given (i_P_Gain or i_I_Gain) is zero. |
i_P_Gain |
UINT |
0..65535 |
Proportional gain value of PI controller, 1000 = 1 |
i_I_Gain |
UINT |
0..65535 |
Integration gain value of PI controller, 1000 = 1 |
i_CoilResistance |
UINT |
3..200 Ohm |
Nominal coil resistance |
i_ErrorDelay |
UINT |
0..65535 ms |
Error activation delay in ms. |
Output variable name |
Data type |
Range |
Description |
o_PwmReq |
UINT |
Hardware specific |
PWM control for valve. |
o_ValveSupply |
BOOL |
TRUE/FALSE |
Control condition for valve supply volt output. |
o_ShortCircuit |
BOOL |
TRUE/FALSE |
Short circuit in valve’s circuit. |
o_BrokenCircuit |
BOOL |
TRUE/FALSE |
Valve’s circuit is broken |
o_FeedbackWithoutControl |
BOOL |
TRUE/FALSE |
There is current without control |

Source file Topic000457.htm
Last updated 4-Sep-2025