MC_SetPosition_BkPlcMc (from V3.0)

The function block sets the actual position of an axis.
Inputs
VAR_INPUT
Execute: BOOL;
Position: LREAL;
Mode: BOOL;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | A rising edge at this input sets the actual position of the axis. |
Position | LREAL | [mm] The new actual position of the axis. |
Mode | BOOL | This parameter specifies the operating mode. If Mode = TRUE, the actual position is changed by Position, if Mode = FALSE, the actual position is set to Position. |
Inputs/outputs
VAR_INOUT
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;
Busy: BOOL;
Error: BOOL;
ErrorID: UDINT;
END_VAR
Name | Type | Description |
---|---|---|
Done | BOOL | This indicates successful processing of the command. |
Busy | BOOL | This output is TRUE while the command is being processed. |
Error | BOOL | The occurrence of an error is indicated here. |
ErrorID | UDINT | An encoded indication of the cause of the error is provided here. |
Behavior of the function block
On a rising edge at Execute the function block checks the transferred axis interface. A number of problems can be detected and reported during this process:
- Depending on the encoder type specified in Axis.pStAxParams^.nEnc_Type, either ST_TcHydAxRtData.fEnc_RefShift or ST_TcHydAxParam.fEnc_ZeroShift is updated such that the actual position of the axis assumes the required value. If the encoder type is unknown or the encoder does not permit the actual value to be set, the system responds with Error and ErrorID:=dwTcHydErrCdEncType.
- If ST_TcHydAxParam.fEnc_ZeroShift changes recognizable during this process, Axis_Ref_BkPlcMc.ST_TcHydAxRtData.bParamsUnsave is set.
![]() | This function block may cause the actual position and/or the target position of the currently processed motion to be moved after an active software limit switch. This is not monitored by the function block. |
If these checks could be performed without problem, all other affected elements in ST_TcHydAxRtData are automatically updated. This function block can therefore also be activated for axes, which perform an active motion. The successful execution of the function is indicated with Done. A falling edge at Execute clears all the pending output signals.