MC_MoveJoySticked_BkPlcMc (from V3.0)
This function block starts and monitors the movement of an axis.
This function is currently only supported by axes, which are controlled by a function block of type MC_AxRuntimeCtrlBased_BkPlcMc (in preparation: MC_AxRunTimeTimeRamp_BkPlcMc). Such a function block is selected by specifying the corresponding constant from E_TcMcProfileType under nProfileType in ST_TcHydAxParam. |
Inputs
VAR_INPUT
Execute: BOOL;
JoyStick: LREAL;
Acceleration: LREAL;
Deceleration: LREAL;
Jerk: LREAL;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | The movement is initiated by a rising edge at this input. |
JoyStick | LREAL | [1] The velocity specified via the control unit, normalized to the range ±1.0. |
Acceleration | LREAL | [mm/s2] The required acceleration in actual value units of the axis per square second. |
Deceleration | LREAL | [mm/s2] The required deceleration in actual value units of the axis per square second. |
Jerk | LREAL | [mm/s3] reserved. |
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;
CommandAborted: BOOL;
Error: BOOL;
ErrorID: UDINT;
END_VAR
Name | Type | Description |
---|---|---|
Busy | BOOL | Indicates that a command is being processed. |
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:
- 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 the motion algorithm is already indicating an error code, the system responds with Error and ErrorID:= the motion algorithm's error code.
- Next, the system checks whether the generator of the axis supports the required function. If this is not the case, the system responds with is Error and ErrorID:=dwTcHydErrCdNotCompatible.
The movement begins if these checks can be carried out without problems. To this end the motion algorithm is set to state iTcHydStateExtGenerated and the axis to state McState_Synchronizedmotion. The axis velocity is specified through JoyStick and ST_TcHydAxParam.fRefVelo. Changes in velocity are accompanied by ramp limitation to ST_TcHydAxParam.fMaxAcc. If the axis moves towards an active software limit switch, the velocity is limited, depending on the remaining distance, such that the limit switch is approached correctly.
A falling edge at Execute offset puts motion algorithm in state iTcHydStateTcDecP or iTcHydStateTcDecM and the axis in state McState_Standstill. If the axis is in motion at this point in time, it is decelerated with a stop ramp and assumes state iTcHydStateIdle.