Velocity Move with MC_MoveVelocity
MC_MoveVelocity is used to perform a velocity move for a single axis. This function block will cause the axis to transition to ContinuousMotion state. MC_MoveVelocity can be executed without the axis being homed. The direction can be specified by the value of the Velocity input and the Direction input.
-
Positive Velocity value will lead to movement in forward direction.
-
Negative Velocity value will lead to movement in the negative direction.
-
Be careful when changing the sign of the Velocity value, as using a negative Velocity value and reverse direction input will lead to movement in the forward direction.
-
LS_Connect and MC_Power must be executed before this function block can be used.
-
The examples in this topic can be found in the XMC_SingleAxis_FBs.zip downloadable from Example Applications.

Element Name | Element Type | Description |
---|---|---|
Execute | Input | Edge detected request to execute the function block. |
Axis | Input/Output | Axis reference variable. This can not be a constant. |
ContinuousUpdate | Input | Specify the update setting of the input value. This is explained in section 6.1.5 of the XMC user manual. |
Velocity | Input | Specify the maximum speed of the move. |
Acceleration | Input | Specify the acceleration of the move. |
Deceleration | Input | Specify the deceleration of the move. |
Jerk | Input | Specify the change rate of acceleration and deceleration. |
Direction | Input |
Specify the direction of the move.
|
BufferMode | Input | Specify the sequential operation setting. See Buffer Mode table below. |
InVelocity | Output | Indicates the axis has reached the inputted speed. |
Busy | Output | Indicates the function block is currently being executed. |
Active | Output | Indicates the function block is controlling the axis. |
CommandAborted | Output | Indicates the function block was aborted. |
Error | Output | Indicates whether an error occurs or not. |
ErrorID | Output | Error Identification number. |
BufferMode Table
Sections 6.1.4 and 8.2.10 of the XMC user manual provide more information about buffer modes.
Value | Buffer Mode | Description |
---|---|---|
0 | Aborting | Abort previous command and execute the command immediately. |
1 | Buffered | Execute the command after previous command is completed. |
2 | BlendingLow | The new command is blended into a previously executed command using the lower velocity value when comparing the previous command and new command. |
3 | BlendingPrevious | The new command is blended into a previous command using the velocity of the previous command. |
4 | BlendingNext | The new command is blended into a previous command using the velocity from the new command. |
5 | BlendingHigh | The new command is blended into a previous command using the higher velocity value when comparing the previous command and new command. |

//Set axis reference
Axis1 := 1;
IF (_AX01_RDY) AND (_AX01_SV_ON) THEN
//Example MC_MoveVelocity fb
INST_MOVEVELOCITY(Execute:=Execute_MoveVelocity, Axis:=Axis1,
ContinuousUpdate:=0, Velocity:=INST_MOVEVELOCITY.Velocity,
Acceleration:=INST_MOVEVELOCITY.Acceleration,
Deceleration:=INST_MOVEVELOCITY.Deceleration,
Jerk:=INST_MOVEVELOCITY.Jerk,
Direction:=INST_MOVEVELOCITY.Direction, BufferMode:=0, ErrorID=>INST_MOVEVELOCITY.ErrorID);
END_IF;
LM512