MC_MoveContinuousRelative

MC_MoveContinuousRelative 1:

MC_MoveContinuousRelative starts positioning by a relative distance and monitors the axis movement over the whole travel path. At the target position a constant end velocity is reached, which is maintained. The InEndVelocity output is set once the target position was reached. Otherwise the CommandAborted or, on error, the Error output is set.

Once the target position has been reached, the block function is complete and the axis is no longer monitored.

Inputs


VAR_INPUT
Execute : BOOL;
Distance : LREAL;
Velocity : LREAL;
EndVelocity : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk : LREAL;
BufferMode : MC_BufferMode;
Options : ST_MoveOptions;
END_VAR

MC_BufferMode

Execute

The command is executed with a rising edge at input Execute.

Distance

Relative distance to be used for positioning.

Velocity

Maximum velocity for the movement over the distance (>0).

EndVelocity

End velocity to be maintained after the relative distance

Acceleration

Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.

Deceleration

Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.

Jerk

Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

BufferMode

The BufferMode is analyzed, if the axis is already executing another command. The running command can be aborted, or the new command becomes active after the running command. The BufferMode also determines the transition condition from the current to the next command.
A second function block is required to use the buffer mode. It is not possible to trigger a move block with new parameters while it is active.

Options

The data structure option includes additional, rarely required parameters. The input can normally remain open.

General rules for MC function blocks

Outputs

VAR_OUTPUT
InEndVelocity : BOOL;
Busy : BOOL;
Active : BOOL;
CommandAborted : BOOL;
Error : BOOL;
ErrorID : UDINT;
END_VAR

InEndVelocity

The InEndVelocity output becomes TRUE once the target position was reached.

The function block remains Busy and Active until a new command is issued.

Busy

The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the movement command is processed. If Busy becomes FALSE again, the function block is ready for a new order. At the same time one of the outputs, Done, CommandAborted or Error, is set.

Active

Active indicates that the command is executed. If the command was buffered, it becomes active once a running command is completed.

CommandAborted

Becomes TRUE, if the command could not be fully executed. The axis may have been stopped, or the running command may have been followed by a further Move command.

Error

Becomes TRUE if an error occurs.

ErrorID

If the error output is set, this parameter supplies the error number.

General rules for MC function blocks

Inputs/outputs


VAR_IN_OUT
Axis : AXIS_REF;
END_VAR

AXIS_REF

Axis

Axis data structure

The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.

MC_MoveContinuousRelative 2:

MC_MoveContinuousRelative is not implemented for fast/slow axes.