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 not the drive.

Inputs


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

E_ReadMode MC_AxisParameter

Enable

The command is executed as long as Enable is active.

ParameterNumber

Number of the parameter to be read.

ReadMode

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

Outputs


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

Valid

The value signaled at the Value output is valid

Busy

The Busy output becomes TRUE when the command is started with Enable and remains TRUE as long as the command is processed. If Busy becomes FALSE again, the function block is ready for a new order.

Error

Becomes TRUE if an error occurs.

ErrorID

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

Value

Displays the read value.

Inputs/outputs


VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR

Axis

Axis data structure

The axis data structure of type AXIS_REF addresses an axis unambiguously within the system. Among other parameters it contains the current axis status, including position, velocity or error state.