MC_ReadAxisComponents

MC_ReadAxisComponents 1:

The function block can be used to read information about the subelements encoder, drive and controller of an axis.

MC_ReadAxisComponents 2:

In this case "axis" refers to the TwinCAT NC axis and its parameters, and not the drive.

MC_ReadAxisComponents 3: Inputs

VAR_INPUT
    Execute : BOOL;
END_VAR

Name

Type

Description

Execute

BOOL

The command is executed with a rising edge.

MC_ReadAxisComponents 4: Inputs/outputs

VAR_IN_OUT
    AxisComponents : ST_AxisComponents; 
    Axis           : AXIS_REF;
END_VAR

Name

Type

Description

AxisComponents

ST_AxisComponents

Data structure used to return the components (encoders, controllers and drives) of the axis.

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_ReadAxisComponents 5: Outputs

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

Name

Type

Description

Done

BOOL

TRUE if the components have been read successfully.

Busy

BOOL

TRUE as soon as the Execute input of the function block has been set to TRUE and component reading has not yet been completed. Afterwards either the output is Done or Error TRUE and Busy is set to FALSE again.

Error

BOOL

TRUE, if an error occurs.

ErrorID

UDINT

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

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v3.0.0

PC or CX (x86 or x64)

Tc2_MC2