Supported platforms: CODESYS 2.3, CODESYS 3.5
PVC_VoltageValve FB controls voltage controlled proportional valves.
The FB calls PVC_Attenuation and Ramp_Linear. Note! Ramp speed changes when minimum or maximum PWM level parameters are changed.
The FB scales the control signal to the PWM request with PVC_To_PWMReq function.
The FB checks input parameters to ensure their valid values, In case of an incorrect value in any of the parameters, o_ParameterError output is activated.
o_ValveSupply is active and the PWM request is calculated when i_Enable is true and a parameter error is not active.
If i_ControlValue input gets a value of -32768, it will limited (overwritten) internally to -32767.
Output is used to control the supply voltage for a valve with a DO output. Note that this FB does not include diagnostics for the DO; it must be implemented in the application.
If i_Enable is inactive or in case of a parameter error or AI voltage error, the PWM request is set to zero and valve supply output is set FALSE.
For controlling PVG valves, it is recommended to use a PVEP Electrohydraulic Actuator. |
i_Control must be 0 on rising edge of i_Enable status. Otherwise control is not enabled. |
Input variable name |
Data type |
Range |
Description |
i_Enable |
BOOL |
FALSE/TRUE |
Enables controlling of the output |
i_Control |
INT |
-32767..32767 |
Control signal from e.g. joystick |
i_PosDirMaxPwmLevel |
UINT |
0..1000 (0,1%) |
Maximum PWM percent for positive direction |
i_PosDirMinPwmLevel |
UINT |
0..1000 (0,1%)
|
Minimum PWM percent for positive direction |
i_CenterPositionPwmLevel |
UINT |
0..1000 (0,1%)
|
PWM percent for center position (i.e. zero position) |
i_NegDirMinPwmLevel |
UINT |
0..1000 (0,1%)
|
Minimum PWM percent for negative direction |
i_NegDirMaxPwmLevel |
UINT |
0..1000 (0,1%)
|
Maximum PWM percent for negative direction |
i_PosDirAscendRamp |
UINT |
0…60000 ms |
Ascending speed for positive direction |
i_PosDirDescendRamp |
UINT |
0…60000 ms |
Descending speed for positive direction |
i_NegDirAscendRamp |
UINT |
0…60000 ms |
Ascending speed for negative direction |
i_NegDirDescendRamp |
UINT |
0…60000 ms |
Descending speed for negative direction |
i_PosDirAttenuationOn |
BOOL |
FALSE/TRUE |
If input is true, controlling of positive direction is limited to given percentage of maximum control |
i_NegDirAttenuationOn |
BOOL |
FALSE/TRUE |
If input is true, controlling of negative direction is limited to given percentage of maximum control |
i_PosDirAttenuationAmount |
BYTE |
0..100 % |
Amount of attenuation for positive direction. If value is 0 function is not used |
i_NegDirAttenuationAmount |
BYTE |
0..100 % |
Amount of attenuation for negative direction. If value is 0 function is not used |
Input variable name |
Data type |
Range |
Description |
i_Enable |
BOOL |
FALSE/TRUE |
Enables controlling of the output |
i_Control |
INT |
-32767..32767 |
Control signal from e.g. joystick |
i_PWMType |
ADData |
G_AIType struct |
Type of PWM output |
i_PosDirMaxPwmLevel |
UINT |
0..1000 (0,1%) |
Maximum PWM percent for positive direction |
i_PosDirMinPwmLevel |
UINT |
0..1000 (0,1%)
|
Minimum PWM percent for positive direction |
i_CenterPositionPwmLevel |
UINT |
0..1000 (0,1%)
|
PWM percent for center position (i.e. zero position) |
i_NegDirMinPwmLevel |
UINT |
0..1000 (0,1%)
|
Minimum PWM percent for negative direction |
i_NegDirMaxPwmLevel |
UINT |
0..1000 (0,1%)
|
Maximum PWM percent for negative direction |
i_PosDirAscendRamp |
UINT |
0…60000 ms |
Ascending speed for positive direction |
i_PosDirDescendRamp |
UINT |
0…60000 ms |
Descending speed for positive direction |
i_NegDirAscendRamp |
UINT |
0…60000 ms |
Ascending speed for negative direction |
i_NegDirDescendRamp |
UINT |
0…60000 ms |
Descending speed for negative direction |
i_PosDirAttenuationOn |
BOOL |
FALSE/TRUE |
If input is true, controlling of positive direction is limited to given percentage of maximum control |
i_NegDirAttenuationOn |
BOOL |
FALSE/TRUE |
If input is true, controlling of negative direction is limited to given percentage of maximum control |
i_PosDirAttenuationAmount |
BYTE |
0..100 % |
Amount of attenuation for positive direction. If value is 0 function is not used |
i_NegDirAttenuationAmount |
BYTE |
0..100 % |
Amount of attenuation for negative direction. If value is 0 function is not used |
Output variable name |
Data type |
Range |
Description |
o_ValveSupply |
BOOL |
FALSE/TRUE |
Supply voltage control condition for valve |
o_PwmRequest |
UINT |
0..1000 (0,1%) |
Pwm percent value for valve |
o_ParameterError |
BOOL |
FALSE/TRUE |
True when incorrect parameter value in any of the FB’s input. |
Output variable name |
Data type |
Range |
Description |
o_ValveSupply |
BOOL |
FALSE/TRUE |
Supply voltage control condition for valve |
o_PwmRequest |
UINT |
0..1000 (0,1%) |
Pwm percent value for valve |
o_ParameterError |
BOOL |
FALSE/TRUE |
True when incorrect parameter value in any of the FB’s input. |
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 Topic000336.htm
Last updated 24-Apr-2025