FB_CoEDriveMoveVelocity

FB_CoEDriveMoveVelocity 1:

The FB_CoEDriveMoveVelocity function block generates a simple three-phase velocity profile (without jerk limitation) that can be used to supply a CoE drive directly. Different accelerations or decelerations can be used below and above a parameterizable velocity threshold. The target velocity can be changed during operation.

The CoE drive must first be enabled via the function block FB_CoEDriveEnable.

FB_CoEDriveMoveVelocity 2: Inputs

VAR_INPUT
    bEnable            : BOOL;
    fVelocity          : LREAL;
    fAcceleration1     : LREAL;
    fAccelaration2     : LREAL;
    fDeceleration1     : LREAL;
    fDeceleration2     : LREAL;
    bNegativeDirection : BOOL;
    stOptions          : ST_DriveMoveVelocityOptions;
END_VAR

Name

Type

Description

bEnable

BOOL

Activates the setpoint generation.

fVelocity

LREAL

Target velocity. fVelocity can be changed during operation.

fAcceleration1

LREAL

Acceleration 1 is used below the parameterized velocity threshold stOptions. fVelocityThreshold.

fAcceleration2

LREAL

Acceleration 2 is used above the parameterized velocity threshold stOptions. fVelocityThreshold.

fDeceleration1

LREAL

Deceleration 1 is used below the parameterized velocity threshold stOptions. fVelocityThreshold.

fDeceleration2

LREAL

Deceleration 2 is used above the parameterized velocity threshold stOptions. fVelocityThreshold.

bNegativeDirection

BOOL

bNegativeDirection reverses the direction of travel.

stOptions

ST_DriveMoveVelocityOptions

Data structure with additional parameters.

FB_CoEDriveMoveVelocity 3: / FB_CoEDriveMoveVelocity 4: Inputs/Outputs

VAR_IN_OUT
    stCoEDriveIoInterface : ST_CoeDriveIoInterface;
END_VAR

Name

Type

Description

stCoEDriveIoInterface

ST_CoeDriveIoInterface

Process image of the CoE drive

FB_CoEDriveMoveVelocity 5: Outputs

VAR_OUTPUT
    bInVelocity     : BOOL;
    bBusy           : BOOL;
    bError          : BOOL;
    iErrorID        : UDINT;
    fActualVelocity : LREAL;
END_VAR

Name

Type

Description

bInVelocity

BOOL

Target velocity is reached.

bBusy

BOOL

bBusy is TRUE as long as the function block is active and a setpoint profile is being calculated.

bError

BOOL

bError becomes TRUE if an error occurs.

iErrorID

UDINT

Error number

fActualVelocity

LREAL

Currently reached velocity of the drive.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT 3.1.4024.22

PC or CX (x86 or x64)

Tc2_Drive