MC_ExtSetPointGenEnable

MC_ExtSetPointGenEnable 1:

The external setpoint generator of an axis can be switched on with the MC_ExtSetPointGenEnable function block. The axis then adopts the set value specifications from its cyclic axis interface (Axis.PlcToNc.ExtSetPos, ExtSetVelo, ExtSetAcc, and ExtSetDirection).

An external setpoint generator is usually a PLC function block that calculates cyclic set values for an axis and can therefore substitute the internal setpoint generator in an NC axis.

Additional information can be found under MC_ExtSetPointGenDisable and MC_ExtSetPointGenFeed.

MC_ExtSetPointGenEnable 2: Inputs

VAR_INPUT
    Execute      : BOOL;
    Position     : LREAL;
    PositionType : E_PositionType;
    Options      : ST_ExtSetPointEnableOptions;
END_VAR

Name

Type

Description

Execute

BOOL

The command is executed with a rising edge.

Position

LREAL

Position for target position monitoring. Setting this position does not mean that the axis moves to this position, only the external setpoint generator is responsible for this movement. Instead, setting this position activates the target position monitoring. The InTargetPosition flag becomes TRUE when this position is reached.

PositionType

E_PositionType

Position type: POSITION TYPE_ABSOLUTE or POSITION TYPE_RELATIVE

Options

ST_ExtSetPointEnableOptions

UseTorqueOffset: Must be set to TRUE so that the TorqueOffset is also transmitted to the drive controller cyclically when the MC_ExtSetPointGenFeedWithTorque is used.

MC_ExtSetPointGenEnable 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_ExtSetPointGenEnable 4: Outputs

VAR_OUTPUT
    Done    : BOOL;
    Busy    : BOOL;
    Error   : BOOL;
    ErrorID : UDINT;
    Enabled : BOOL;
END_VAR

Name

Type

Description

Done

BOOL

TRUE if the command was executed successfully.

Busy

BOOL

TRUE as soon as the function block is active. FALSE if it is in the default state.

Error

BOOL

TRUE, if an error occurs.

ErrorID

UDINT

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

Enabled

BOOL

Shows the current state of the external setpoint generator, regardless of the function execution.

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v3.0.0

PC or CX (x86 or x64)

Tc2_MC2