MC_MoveAbsolute_BkPlcMc (from V3.0)
This function block starts and monitors the movement of an axis.
Inputs
VAR_INPUT
Execute: BOOL;
Position: LREAL;
Velocity: LREAL;
Acceleration: LREAL;
Deceleration: LREAL;
Jerk: LREAL;
Direction: MC_Direction_BkPlcMc:=MC_Shortest_Way_BkPlcMc; (ab/from V3.0.8)
BufferMode: MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc; (ab/from V3.0.8)
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | The movement is initiated by a rising edge at this input. |
Position | LREAL | [mm] The target position of the movement in actual value units of the axis. |
Velocity | LREAL | [mm/s] The required motion velocity in actual value units of the axis per second. |
Acceleration | LREAL | [mm/s2] The required acceleration in actual value units of the axis per square second. If this parameter is 0.0, it is replaced by a default value from the axis parameters. |
Deceleration | LREAL | [mm/s2] The required deceleration in actual value units of the axis per square second. If this parameter is 0.0, it is replaced by a default value from the axis parameters. |
Jerk | LREAL | [mm/s3] reserved. |
Direction | MC_Direction_BkPlcMc | reserved. This input was only amended for compatibility reasons and either should not be assigned, or the constant MC_Shortest_Way_BkPlcMc should be assigned to it. (from V3.0.8) |
BufferMode | MC_BufferMode_BkPlcMc | reserved. This input is provided in preparation for a future build. It should currently either not be assigned or assigned the constant Aborting_BkPlcMc. (from V3.0.8) |
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
Busy: BOOL;
Done: BOOL;
CommandAborted: BOOL;
Error: BOOL;
ErrorID: UDINT;
END_VAR
Name | Type | Description |
---|---|---|
Busy | BOOL | Indicates that a command is being processed. |
Done | BOOL | Successful processing of the movement is indicated here. |
CommandAborted | BOOL | Abortion of the movement is indicated here. |
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:
- The possibility that Position is located behind an active software limit switch is checked next. In this case the system responds with Error and ErrorID:=dwTcHydErrCdSoftEnd.
- Depending on the motion algorithm specified in Axis.pStAxParams^.nProfile the axis may either only be able to begin the movement initiated here when stationary, or may be able to begin from another movement that has not yet been completed. If it is unable at the present time to accept this new order, the system responds with Error and ErrorID:=dwTcHydErrCdNotStartable.
- If the axis is already in an error state, or if it is in the process of carrying out a stop operation, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.
- If Velocity is too small (less than 1% of the reference velocity) the system responds with Error and ErrorID:=dwTcHydErrCdSetVelo.
- If Acceleration is too small (the Velocity cannot be reached within 100 seconds) the system responds with Error and ErrorID:=dwTcHydErrCdAcc.
- If Deceleration is too small (the Velocity cannot be reduced within 100 seconds) the system responds with Error and ErrorID:=dwTcHydErrCdAcc.
- If the motion algorithm is already indicating an error code, the system responds with Error and ErrorID:= the motion algorithm's error code.
The movement begins if these checks can be carried out without problems. This is done by limiting the parameters Position, Velocity, Acceleration and Deceleration to the maximum permissible values and passing them to the motion algorithm. The axis is now in the McState_DiscreteMotion state, and the function block begins to monitor the movement.
If the motion algorithm reports an error code while the movement is being executed, the system responds with Error and ErrorID:=the motion algorithm's error code. If completion of the movement is prevented by the activity of another function block, the system responds with CommandAborted. If the motion algorithm achieves the target conditions for the axis, the system responds with Done.
A falling edge at Execute clears all the pending output signals. If, while the movement is still active, Execute is set to FALSE, execution of the movement that had started continues unaffected. The signals provided at the end of the movement (Error, ErrorID, CommandAborted, Done) are made available for one cycle.