MC_MoveVelocity
The function block MC_MoveVelocity starts 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.
Inputs
VAR_INPUT
Execute : BOOL;
Velocity : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Direction : MC_Direction := MC_Positive_Direction;
Options : ST_MoveOptions;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | The command is executed with a rising edge. |
ContinuousUpdate | BOOL | If ContinuousUpdate is TRUE, the dynamics can be changed according to the Velocity, Acceleration and Deceleration inputs during the processing of the command with a rising edge at the Execute input and brought into effect as quickly as possible. |
Velocity | LREAL | Maximum travel velocity (>0). |
Acceleration | LREAL | Acceleration (≥0) |
Deceleration | LREAL | Deceleration (≥0) |
Direction | MC_Direction | Positive or negative direction of travel (type MC_Direction) |
Options | ST_MoveOptions | Data structure (ST_MoveOptions) containing additional, rarely used parameters. The input can normally remain unused. |
See also: General rules for MC function blocks. |
Inputs/outputs
VAR_IN_OUT
Axis : AXIS_REF;
END_VAR
Name | Type | Description |
---|---|---|
Axis | 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. |
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. |
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. |
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. |
See also: General rules for MC function blocks. |
Requirements
Development environment | PLC libraries to include |
---|---|
TwinCAT 3.1.4024.11 | Tc3_DriveMotionControl |