TwinCAT PLC Library Hydraulics - Version 1.4 — 4.2.15 MC_MoveVelocity_BkPlcMc (from V3.0)

PLCopen Motion Control VAR_INPUT Execute: BOOL; Velocity: LREAL; Acceleration: LREAL; Deceleration: LREAL; Direction: MC_Direction_BkPlcMc; BufferMode: MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc; (ab/from V3.0.8) END_VAR VAR_OUTPUT Busy: BOOL; InVelocity: BOOL; CommandAborted: BOOL; Error: BOOL; ErrorID: UDINT; END_VAR VAR_INOUT Axis: Axis_Ref_BkPlcMc; END_VAR Execute : The movement is initiated by a positive edge at this input. Velocity : [mm/s] The required motion velocity in actual value units of the axis per second. Acceleration : [mm/s 2 ] The required acceleration in actual value units of the axis per square second. Deceleration :

[mm/s 2 ] The required deceleration in actual value units of the axis per square second. Direction : A direction specification, coded according to MC_Direction_BkPlcMc [ } 90] . BufferMode: Reserved. This input is provided in preparation for a future build. It should currently either not be assigned or assigned the constant Aborting_BkPlcMc. (from V3.0.8) Busy : Indicates that a command is being processed. InVelocity : This output becomes TRUE when the axis reaches the required velocity for the first time. CommandAborted : Abortion of the movement is indicated here. Error : The occurrence of an error is indicated here. ErrorID :

An encoded indication of the cause of the error is provided here. Axis : Here, the address of a variable of type Axis_Ref_BkPlcMc [ } 67] should be transferred. Behavior of the function block The function block is activated by a positive edge at Execute , and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process: Depending on the movement algorithm specified in Axis.pStAxParams^.nProfile the axis may either only be able to begin the movement initiated here when stationary, or may be able to begin from another movement that has not yet been completed.

If it is unable at the present time to accept this new order, the function block responds with Error and ErrorID :=dwTcHydErrCdNotStartable. If the axis is already in a fault state, or if it is in the process of carrying out a stop operation, it responds with Error and ErrorID :=dwTcHydErrCdNotReady. If Velocity is too small (less than 1% of the reference velocity) the function block reacts with Error and ErrorID :=dwTcHydErrCdSetVelo. If the movement algorithm is already indicating an error code, the function block responds with Error and ErrorID := the movement algorithm's error code. The movement begins if these checks can be carried out without problems.

This is done by selecting a value for the target position depending on Direction and the parameters for the software limit switches. The parameters Velocity, Acceleration and Deceleration are then limited to the maximum permissible values and are passed to the movement algorithm. The axis is now in the McState_Continuousmotion [ } 78] state, and the function block begins to monitor the movement. PLC Library Hydraulics 65 Version: 1.4