FB_CTRL_PI
The function block provides a PI transfer element in the functional diagram.
Behavior of the output

Step response
ARW
Inputs
VAR_INPUT
fSetpointValue : FLOAT;
fActualValue : FLOAT;
fManSyncValue : FLOAT;
bSync : BOOL;
eMode : E_CTRL_MODE;
bHold : BOOL;
END_VAR
Name | Type | Description |
---|---|---|
fSetpointValue | FLOAT | Setpoint of the controlled variable |
fActualValue | FLOAT | Actual value of the controlled variable |
fManSyncValue | FLOAT | Input with which the PI element can be set. |
bSync | BOOL | A rising edge at this input sets the PI-element to the value "fManSyncValue". |
eMode | E_CTRL_MODE | Input that specifies the operation mode of the function block. |
bHold | BOOL | A TRUE at this input will hold the internal state (and therefore also the output) constant at its current value, independently of the control deviation. |
Outputs
VAR_OUTPUT
fOut : FLOAT;
bARWactive : BOOL;
eState : E_CTRL_STATE;
eErrorId : E_CTRL_ERRORCODES;
bError : BOOL;
END_VAR
Name | Type | Description |
---|---|---|
fOut | FLOAT | Output of the PI element |
bARWactive | BOOL | A TRUE at this output indicates that the PI-element is being restricted. |
eState | E_CTRL_STATE | State of the function block |
eErrorId | E_CTRL_ | Supplies the error number when the output |
bError | BOOL | Becomes TRUE, as soon as an error occurs. |
Inputs/ outputs
VAR_IN_OUT
stParams : ST_CTRL_PI_PARAMS;
END_VAR
Name | Type | Description |
---|---|---|
stParams | ST_CTRL_PI_ | Parameter structure of the PI element |
stParams
consists of the following elements:
TYPE ST_CTRL_PI_PARAMS:
STRUCT
tCtrlCycleTime : TIME := T#0ms;
tTaskCycleTime : TIME := T#0ms;
tTn : TIME := T#0ms;
fKp : FLOAT := 0;
fOutMaxLimit : FLOAT := 1E38;
fOutMinLimit : FLOAT := -1E38;
bARWOnIPartOnly : BOOL := FALSE;
END_STRUCT
END_TYPE
Name | Type | Description |
---|---|---|
tCtrlCycleTime | TIME | Cycle time with which the control loop is processed. This must be greater than or equal to the TaskCycleTime. The function block uses this input value to calculate internally whether the state and the output values have to be updated in the current cycle. |
tTaskCycleTime | TIME | Cycle time with which the function block is called. If the function block is called in every cycle this corresponds to the task cycle time of the calling task. |
tTn | TIME | Integral action time |
fKp | FLOAT | Controller amplification / transfer coefficient |
fOutMaxLimit | FLOAT | Upper limit at which integration is halted and to which the output is limited (ARW measure). Reaching this limit is indicated by a TRUE at the |
fOutMinLimit | FLOAT | Lower limit at which integration is halted and to which the output is limited (ARW measure). Reaching this limit is indicated by a TRUE at the |
bARWOnIPartOnly | BOOL | If this parameter is FALSE (the standard setting), the integration of the I-component is halted if the complete controller output reaches the upper or lower limit. If it is TRUE, the integration is halted if the I-component (the output of the integrator) reaches some limit. (Cf. functional diagram.) |