MC_MoveVelocity

MC_MoveVelocity 1:

The function block MC_MoveVelocity is used to start an endless travel with a specified velocity and direction. The movement can be stopped through a Stop command.

The InVelocity output is set once the constant velocity is reached. Once constant velocity has been reached, the block function is complete, and no further monitoring of the movement takes place. If the command is aborted during the acceleration phase, the output "CommandAborted" or, in the event of an error, the output "Error" is set.

Motion commands can be applied to coupled slave axes, if this option was explicitly activated in the axis parameters. A motion command such as MC_MoveAbsolute then automatically leads to decoupling of the axis, after which the command is executed. In this case the only available BufferMode is "Aborting".

MC_MoveVelocity 2: Inputs

VAR_INPUT
    Execute      : BOOL; (* B *)
    Velocity     : LREAL; (* E *)
    Acceleration : LREAL; (* E *)
    Deceleration : LREAL; (* E *)
    Jerk         : LREAL; (* E *)
    Direction    : MC_Direction := MC_Positive_Direction; (* E *)
    BufferMode   : MC_BufferMode; (* E *)
    Options      : ST_MoveOptions; (* V *)
END_VAR

Name

Type

Description

Execute

BOOL

The command is executed with a rising edge.

Velocity

LREAL

Maximum travel velocity (>0).

Acceleration

LREAL

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

Deceleration

LREAL

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

Jerk

LREAL

Jerk (≥0)
At a value of 0, the standard jerk from the axis configuration in the System Manager is applied.

Direction

MC_Direction

Positive or negative direction of travel.

BufferMode

MC_BufferMode

Is evaluated if the axis is already executing another command. MC_MoveVelocity becomes active after the current command or aborts it. Transition conditions from the current to the next command are also determined by the BufferMode. If the command is applied to a coupled slave axis, the only available BufferMode is "Aborting". A second function block is always required to use the BufferMode. It is not possible to trigger a move function block with new parameters while it is active.

Options

ST_MoveOptions

Data structure containing additional, rarely used parameters. The input can normally remain open.

See also: General rules for MC function blocks

MC_MoveVelocity 3: Inputs/outputs

VAR_IN_OUT
    Axis : AXIS_REF;
END_VAR

Name

Type

Description

Axis

AXIS_REF

Axis data structure that unambiguously addresses an axis in the system. Among other parameters it contains the current axis status, including position, velocity or error state.

MC_MoveVelocity 4: Outputs

VAR_OUTPUT
    InVelocity     : BOOL; (* B *)
    Busy           : BOOL; (* E *)
    Active         : BOOL; (* E *)
    CommandAborted : BOOL; (* E *)
    Error          : BOOL; (* B *)
    ErrorID        : UDINT; (* E *)
END_VAR

Name

Type

Description

InVelocity

BOOL

After the axis acceleration, the InVelocity output assumes the value TRUE once the requested target velocity has been reached. The InVelocity output remains TRUE until the axis velocity is changed by another command. As soon as a velocity deviation is determined, the output signals FALSE.

Busy

BOOL

TRUE as soon as the command is started with "Execute" and as long as the function block is active. If "Busy" is FALSE, the function block is ready for a new order. At the same time one of the outputs "CommandAborted" or "Error" is set.

Active

BOOL

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

CommandAborted

BOOL

TRUE if the command could not be executed completely. The axis was stopped or the current command was replaced by another Move command.

Error

BOOL

TRUE, if an error occurs.

ErrorID

UDINT

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

MC_MoveVelocity 5:

InVelocity and Override

If the override value is changed, the InVelocity output signals the value FALSE. At the same time, after a change in velocity, the CommandAborted output assumes the value TRUE and the function block no longer displays the status "busy".

MC_MoveVelocity 6:

InVelocity during a velocity overlay with MC_MoveSuperImposed

A change in velocity due to the function block MC_MoveSuperImposed is permitted and does not lead to a cancellation of the activity of the function block. Although the velocity changes, the InVelocity output remains TRUE because the total velocity is made up of the basic velocity, which has not changed, and a velocity superimposed on this basic velocity (Superposition).

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

See also: General rules for MC function blocks

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v3.0.0

PC or CX (x86 or x64)

Tc2_MC2