FB_ReadDriveParameter

FB_ReadDriveParameter 1:

The FB_ReadDriveParameter function block can be used to read various parameters of the Beckhoff servo hardware asynchronously.

Supported Beckhoff hardware

AX5xxx

AX8xxx / AMP8xxx / MD8xxx

Compact drive technology (servo)

FB_ReadDriveParameter 2: from FW v2.11 b0001

FB_ReadDriveParameter 3: from FW v1.04 b0001

FB_ReadDriveParameter 4: from FW v01
(AMI8xxx only Drive)

FB_ReadDriveParameter 5: Inputs

VAR_INPUT
   Execute         : BOOL;
   ParameterNumber : E_DriveParameterNumber;
   Mode            : E_ReadWriteMode;
   Interval        : TIME;
   Value           : ANY;
END_VAR

Name

Type

Description

Execute

BOOL

The function block is activated by a positive edge at this input.

ParameterNumber 

E_DriveParameterNumber

Specifies which parameter is to be read.

Mode

E_ReadWriteMode

Specifies whether the parameter is to be read once or cyclically (as quickly as possible).

Interval

TIME

In addition to E_ReadWriteMode.Cyclic, an interval time can be specified here in which the parameter is to be read.

Value

ANY

A variable of the correct type must be passed for the parameter. The required type is specified as a comment after the entry in the E_DriveParameterNumber structure.

FB_ReadDriveParameter 6: 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.

FB_ReadDriveParameter 7: Outputs

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

Name

Type

Description

Valid

BOOL

This output is set if valid information has been written to the "Value" variable.

Busy

BOOL

This output is set when the function block is activated, and remains set until feedback is received.

Error

BOOL

This output is set after the Busy output has been reset when an error occurs in the transmission of the command.

ErrorID

UDINT

In the event of a set error output returns the ADS error code.

Requirements

Development environment

Target platform type

PLC libraries to include

Firmware version

Revision

TwinCAT ≥4024.67

PC or CX (x86 or x64)

Tc2_MC2_Drive ≥V3.3.51.0

 

≥0032