MC_ReadParameter

MC_ReadParameter 1:

The function block MC_ReadParameter is used to read an axis parameter.

MC_ReadParameter 2:

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

MC_ReadParameter 3: Inputs

VAR_INPUT
    Enable          : BOOL;      (* B *)
    ParameterNumber : MC_AxisParameter;       (* B *)
    ReadMode        : E_ReadMode (* V *)
END_VAR

Name

Type

Description

Enable

BOOL

Reads the parameter once or cyclically depending on the ReadMode.

ParameterNumber

MC_AxisParameter

Number of the parameter to be read

ReadMode

E_ReadMode

Read mode of the parameter to be read (once or cyclic)

MC_ReadParameter 4: 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_ReadParameter 5: Outputs

VAR_OUTPUT
    Valid   : BOOL;  (* B *)
    Busy    : BOOL;  (* E *)
    Error   : BOOL;  (* B *)
    ErrorID : DWORD; (* E *)
    Value   : LREAL; (* B *)
END_VAR

Name

Type

Description

Valid

BOOL

Signals with TRUE that the value read at output Value is valid.

Busy

BOOL

TRUE as soon as the command is started with Enable and as long as the command is processed. If Busy is FALSE, the function block is ready for a new order.

Error

BOOL

TRUE, if an error occurs.

ErrorID

DWORD

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

Value

LREAL

Shows the read value.

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v3.0.0

PC or CX (x86 or x64)

Tc2_MC2