Supported platforms: CODESYS 3.5, CODESYS 3.5 SAFETY, CODESYS 3.5 SP19 SAFETY
This function block limits proportional control value when movement is near the end position.
Init method is used to initialize the necessary static calculation parameters for the function block instance.
The method shall be called at least once before the actual function block can be called, i.e. at the application initialization phase.
The method checks the validity of input parameters. However, none of the function block outputs are affected by the initialization.
|
A parameter error is diagnosed if:
|
Parameter |
Data type |
Unit |
Range |
Description |
S_i_PosDirAttenuationLimit |
SAFEUINT |
% |
0-100 |
Attenuated positive direction maximum control value. Percent from value 10000. |
S_i_NegDirAttenuationLimit |
SAFEUINT |
% |
0-100 |
Attenuated negative direction minimum control value. Percent from value -10000. |
i_pEventCode |
POINTER TO EventCode |
- |
≠0 |
Pointer to application variable which is type EventCode. |
i_pEventCodePosDirAtt |
POINTER TO EventCode |
- |
≠0 |
Pointer to application variable which is type EventCode. |
i_pEventCodeNegDirAtt |
POINTER TO EventCode |
- |
≠0 |
Pointer to application variable which is type EventCode. |
TRUE: All initialization parameters ok. |
FALSE: Error in initialization parameter(s). |
The output value S_o_Control is limited to the given percentage (S_i_PosDirAttenuationLimit) of the positive max control value if the S_i_Control value is higher than limited value and the corresponding end attenuation flag S_i_PosDirAttenuationOn is true. S_o_Control is limited to given percentage (S_i_NegDirAttenuationLimit) of negative min control value if the S_i_Control value is lower than limited value and the corresponding end attenuation flag S_i_NegDirAttenuationOn is true. Otherwise S_o_Control follows the input value S_i_Control.
See figure below where S_i_PosDirAttenuationLimit = 70 and S_i_NegDirAttenuationLimit = 60 and the corresponding end attenuation input is true when end attenuation limit is reached.
Input variable name |
Data type |
Unit |
Range |
Description |
i_Enable |
BOOL |
- |
- |
Enable POU operation |
S_i_Control |
SAFEINT |
- |
-10000 - (+)10000 |
Control value |
S_i_PosDirAttenuationOn |
SAFEBOOL |
- |
- |
Positive direction end attenuation is active |
S_i_PosDirAttenuationOn |
SAFEBOOL |
- |
- |
Negative direction end attenuation is active |
Output variable name |
Data type |
Unit |
Range |
Description |
S_o_Control |
SAFEINT |
- |
-10000 - (+)10000 |
Attenuated control value |
o_Status |
Status |
- |
|
Status of output value. See Status structure. |
See Diagnostic Interface library description of error status and event code functionality.
Conditions |
S_o_ Control |
o_Status. OutputValid |
o_Status error status |
Event code FunctionID |
Event code EventID |
i_Enable TRUE AND init parameter error AND i_pEventCode valid |
0 |
FALSE |
ParameterError |
END_ATTENUATION |
PARAMETER_ERROR |
i_Enable TRUE AND init parameter error AND |
0 |
FALSE |
ParameterError |
- |
- |
i_Enable TRUE AND init parameters ok AND S_i_Control within range |
Attenuated control value |
TRUE |
- |
NO_FUNC |
NO_ERROR |
i_Enable TRUE AND init parameters ok AND S_i_Control > 10000 |
0 |
FALSE |
InputHigh |
END_ATTENUATION |
INPUT_TOO_HIGH |
i_Enable TRUE AND parameters ok AND S_i_Control < -10000 |
0 |
FALSE |
InputLow |
END_ATTENUATION |
INPUT_TOO_LOW |
Source file topic100405.htm
Last updated 21-Feb-2025