FB_WriteDriveParameter

FB_WriteDriveParameter 1:

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

Supported Beckhoff hardware

AX5xxx

AX8xxx / AMP8xxx / MD8xxx

Compact drive technology (servo)

FB_WriteDriveParameter 2: from FW v2.11 b0001

FB_WriteDriveParameter 3: from FW v1.04 b0001

FB_WriteDriveParameter 4: from FW v01
(AMI8xxx only Drive)

FB_WriteDriveParameter 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 written.

Mode

E_ReadWriteMode

Specifies whether the parameter is to be written 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 written.

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_WriteDriveParameter 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_WriteDriveParameter 7: Outputs

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

Name

Type

Description

Valid

BOOL

This output is set when valid information has been written to the drive.

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