Supported platforms: CODESYS 3.5, CODESYS 3.5 SAFETY, CODESYS 3.5 SP19 SAFETY
This function block scales the input control signal -10000 - (+)10000 to current request.
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_MinimumCurrent |
SAFEUINT |
mA |
0-5000 |
Minimum current value which is used in scaling. |
S_i_MaximumCurrent |
SAFEUINT |
mA |
0-5000 |
Maximum current value which is used in scaling. |
S_i_PositiveControlDir |
SAFEBOOL |
- |
- |
True = Positive control signals are scaled to current request. False = Negative control signals are scaled to current request. |
i_pEventCode |
POINTER TO EventCode |
- |
≠0 |
Pointer to application variable which is type EventCode. |
TRUE: All initialization parameters ok. |
FALSE: Error in initialization parameter(s). |
POU scales the input control value S_i_Control to output current request S_o_CurrentRequest based on the given minimum and maximum current request parameters and S_i_PositiveControlDir flag. If S_i_PositiveControlDir is true then positive input control signals are scaled to output current request and negative input signal sets the output S_o_CurrentRequest to 0.
If S_i_PositiveControlDir is false then negative input control signals are scaled to output current request and positive input signal sets the output S_o_CurrentRequest to 0
The block sets o_Status.OutputValid state TRUE if signals are valid and operation is enabled, i.e. i_Enable is TRUE.
Input variable name |
Data type |
Unit |
Range |
Description |
i_Enable |
BOOL |
- |
- |
Enable POU operation |
S_i_Control |
SAFEINT |
- |
-10000 - (+) 10000 |
Control value |
Output variable name |
Data type |
Unit |
Range |
Description |
S_o_CurrentRequest |
SAFEUINT |
mA |
0-5000 |
Current request |
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_Output value |
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 |
CURRENT_REQUEST |
PARAMETER_ERROR |
i_Enable TRUE AND init parameter error AND |
0 |
FALSE |
ParameterError |
- |
- |
i_Enable TRUE AND init parameters ok |
scaled current request value |
TRUE |
- |
NO_FUNC |
NO_ERROR |
i_Enable TRUE AND init parameters ok AND S_i_Control > 10000 |
0 |
FALSE |
InputHigh |
CURRENT_REQUEST |
INPUT_TOO_HIGH |
i_Enable TRUE AND parameters ok AND S_i_Control < -10000 |
0 |
FALSE |
InputLow |
CURRENT_REQUEST |
INPUT_TOO_LOW |
Source file topic100406.htm
Last updated 21-Feb-2025