Relative Positioning that ends with a velocity move using MC_MoveContinuousRelative
MC_MoveContinuousRelative will perform a relative move and transition to a velocity move when relative positioning is complete. The value in the input EndVelocity will be the final speed for the continuous speed portion of the movement. If the function block is executed again while performing a previous MC_MoveContinuousRelative operation, the changes in parameters will be applied. This function block will cause the axis to transition to ContinuousMotion state.
-
The sign of Distance will determine the direction of movement during the relative move portion.
-
A negative Distance value will move in reverse direction and a positive distance value will move in the forward direction.
-
The sign of the EndVelocity value will determine the direction of the speed move portion.
-
A negative EndVelocity value will move in the reverse direction and a positive EndVelocity value will move 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. |
Distance | Input | Specify the relative distance to move. |
EndVelocity | Input | Specify the speed of the continuous movement portion. |
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. |
BufferMode | Input | Specify the sequential operation setting. See the Buffer Mode table below. |
InEndVelocity | Output | Indicates the axis has transitioned to continuous speed movement. |
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_MoveContinuousRelative fb
INST_MOVECONTINUOUSRELATIVE(Execute:=Execute_MoveContRel, Axis:=Axis1,
ContinuousUpdate:=0, Distance:=INST_MOVECONTINUOUSRELATIVE.Distance,
EndVelocity:=INST_MOVECONTINUOUSRELATIVE.EndVelocity,
Velocity:=INST_MOVECONTINUOUSRELATIVE.Velocity,
Acceleration:=INST_MOVECONTINUOUSRELATIVE.Acceleration,
Deceleration:=INST_MOVECONTINUOUSRELATIVE.Deceleration,
Jerk:=INST_MOVECONTINUOUSRELATIVE.Jerk, BufferMode:=0, ErrorID=>INST_MOVECONTINUOUSRELATIVE.ErrorID);
END_IF;
LM514