FB_SoEDriveMoveVelocity

FB_SoEDriveMoveVelocity 1:

The FB_SoEDriveMoveVelocity function block generates a simple three-phase velocity profile (without jerk limitation) that can be used to supply an SoE 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 SoE drive must first be enabled via the function block FB_SoEDriveEnable.

FB_SoEDriveMoveVelocity 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_SoEDriveMoveVelocity 3: / FB_SoEDriveMoveVelocity 4: Inputs/Outputs

VAR_IN_OUT
    stSoEDriveIoInterface : ST_SoeDriveIoInterface;
END_VAR

Name

Type

Description

stSoEDriveIoInterface

ST_SoeDriveIoInterface

Process image of the CoE drive

FB_SoEDriveMoveVelocity 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