MC_ReadParameter

MC_ReadParameter 1:

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

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

Inputs

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

Enable: TRUE as long as the command is executed.

ParameterNumber: Number of the parameter to be read. (Type MC_AxisParameter)

ReadMode: Read mode of the parameter to be read (once or cyclic). (Type: E_ReadMode)

Outputs

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

Valid: TRUE if the value signaled at output "Value" is valid.

Busy: 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: TRUE, if an error occurs.

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

Value: Shows the read value.

Inputs/outputs

VAR_IN_OUT
    Axis : AXIS_REF;
END_VAR

Axis: 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. (Type: AXIS_REF)

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v3.0.0

PC or CX (x86 or x64)

Tc2_MC2