MC_LoadControl

MC_LoadControl 1:

This function block continuously exerts a torque, force or pressure of the specified value.
Positive torque, force and differential pressure is in the positive direction of velocity, pressure is physically unsigned. LoadUnit must match the unit of the value measured by the corresponding sensor.

Syntax

Definition:

FUNCTION_BLOCK MC_LoadControl
VAR_IN_OUT
    Axis               : Reference To AXIS_REF;
END_VAR
VAR_INPUT
    Execute            : BOOL;
    Load               : LREAL;
    LoadRamp           : LREAL;
    LoadRampDerivative : LREAL;
    BufferMode         : EBufferMode;
END_VAR
VAR_OUTPUT
    InLoad             : BOOL;
    Busy               : BOOL;
    Active             : BOOL;
    CommandAborted     : BOOL;
    Error              : BOOL;
    ErrorId            : UDINT;
END_VAR

MC_LoadControl 2: Inputs

Name

Type

Default

Description

Execute

BOOL

 

Start the motion at rising edge.

Load

LREAL

#Invalid

Commanded load value ([LoadUnit]). It is approached using a defined ramp (LoadRamp).

LoadRamp

LREAL

#Invalid

Maximum load derivative ([LoadUnit/s], positive)

LoadRampDerivative

LREAL

#Ignore

Maximum load ramp derivative ([LoadUnit/s^2], positive). It can be left as 'Ignore' if no ramp derivative limit is desired.

BufferMode

EBufferMode

Aborting

Chronological sequence of the command

MC_LoadControl 3: In/Outputs

Name

Type

Description

Axis

Reference To AXIS_REF

Reference to the axis

MC_LoadControl 4: Outputs

Name

Type

Description

InLoad

BOOL

Commanded load value reached

Busy

BOOL

Function block is not finished and new output values are to be expected.

Active

BOOL

Function block has active control on the axis.

CommandAborted

BOOL

Command is aborted by another command.

Error

BOOL

Error occurred within function block.

ErrorId

UDINT

Error identifier

Possible error codes

For this function block, the following values, among others, are possible for the ErrorId output:

Error(Hex)

Error(Dec)

Error type

Description

0x813c

33084

Parameter

BufferMode is invalid. The BufferMode passed to the function block is unknown or not supported by the command (some commands accept only Aborting, others only Buffered).

0x8145

33093

Function Block

Mapping of cyclic interface between NC and PLC is missing (e.g., AXIS_REF, AXES_GROUP_REF, ...). A reference used by the function block (e.g., to an axis, group, mover or other motion object) is not linked to the corresponding NC object, or its cyclic mapping is incomplete.

0x81ac

33196

Parameter

Invalid load value. The load value specified for a pressure or force command is invalid (e.g., NaN or outside the permitted range).

0x81ad

33197

Parameter

Invalid load ramp value. The load ramp value (rate of load build-up) is invalid (e.g., less than or equal to zero or NaN).

0x81ae

33198

Parameter

Invalid load ramp derivative value. The load ramp derivative (rate of change of the load build-up) is invalid (e.g., less than or equal to zero or NaN). The value is optional and may be left unused.

An overview of all NC error codes can be found here:

Version information

  • TwinCAT Standard >= v3.1.4026.23.1
  • TF5500 MC3 Base >= v4.0.6