MC_AxUtiOffsetLatch_BkPlcMc (ab V3.0.40)
The function block updates the offset compensation.
Inputs
VAR_INPUT
Execute: BOOL;
OffsetLimit: LREAL:=0.5;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | A rising edge triggers the update. |
OffsetLimit | LREAL | [V] The maximum permissible value range for the offset compensation. |
Inputs/outputs
VAR_IN_OUT
Axis: AXIS_REF_BkPlcMc;
END_VAR
Name | Type | Description |
---|---|---|
Axis | AXIS_REF_BkPlcMc | Here, the address of a variable of type Axis_Ref_BkPlcMc should be transferred. |
Outputs
VAR_OUTPUT
Done: BOOL;
Error: BOOL;
ErrorId: UDINT;
Latched: BOOL;
Offset: LREAL;
END_VAR
Name | Type | Description |
---|---|---|
Done | BOOL | A successful update is indicated here. |
Error | BOOL | This output indicates any problems that may have occurred. |
ErrorId | UDINT | In the event of an error, coded information about the type of problem is reported here. |
Latched | BOOL | This output signals that the update was successfully completed. |
Offset | LREAL | [V] This output reports the offset value. It is only accepted as a new compensation when Done. |
Behavior of the function block
With a rising edge at Execute, Offset is updated with the current output of the position controller.
Before accepting this value as compensation, the function block checks for several possible errors:
- The axis must have a controller enable and must not be in an active motion state or error state (Axis.stAxRtData.iCurrentStep=iTcHydStateIdle). (error code dwTcHydAdsErrBusy)
- The detected controller output must not be outside ±OffsetLimit. (error code dwTcHydAdsErrIllegalValue)
If one of the errors has occurred, Error is reported and ErrorId is assigned the specified error code. In this case, the compensation remains unchanged.
Otherwise, offset is applied as the new compensation value. Since from this point in time the part of the output value previously provided by the position controller is taken over by the compensation, the output of the controller must be canceled. The following steps are carried out once only:
- The set and current target positions are updated with the actual position.
- The position error (lag error) is set to zero.
- The position controller output is set to zero.
- The I part of the default position controller is wiped.
- If a position controller other than the default position controller is used, its I part must be deleted by the application.
All outputs are set to the idle state with a falling edge at Execute.