Overview

The Tc2_MC2_Drive library includes functions and function blocks for
SoE drives that access the drive by MC2 axis structure (AXIS_REF).

Drive libraries

The three drive libraries Tc2_Drive, Tc2_NcDrive and Tc2_MC2_Drive were developed for different functional purposes, but are almost identical in their functionality. The function blocks of the libraries Tc2_NcDrive and Tc_MC2_Drive form wrapper function blocks around the function blocks of the Tc2_Drive library.

Drive library

Use

Access to the drive

Remarks

Tc2_Drive

See documentation TwinCAT 3 PLC Lib: Tc2_Drive

Use the Tc2_Drive library if you use the drive entirely from the PLC (i.e. without NC).

The drive is accessed via a drive reference. Within the library, the ST_DriveRef structure is used for this with the NetID as a string. For linking purposes, a structure called ST_PlcDriveRef is also provided with the NetID as a byte array.

(See Drive reference ST_DriveRef)

If you want to access parameters in the drive for which no special function block has been implemented, use the function blocks FB_SoERead_ByDriveRef and FB_SoEWrite_ByDriveRef. These function blocks are implemented in the PLC Lib Tc2_EtherCAT in the SoE Interface folder.

Tc2_NcDrive

See documentation TwinCAT 3 PLC Lib: Tc2_NcDrive

Use the Tc2_NcDrive library if you are using the drive via the NC with the Tc2_Nc libraries.

The drive is accessed via the NC axis structure (NC_TO_PLC). The function blocks of the Tc2_NcDrive library independently determine the access data to the drive (NetID, address and channel number) via the NC axis ID from the NC axis structure.

If you want to access parameters in the drive for which no special function block has been implemented, use the function blocks FB_SoERead and FB_SoEWrite.

Tc2_MC2_Drive

See: TwinCAT 3 PLC Lib Tc2_MC2_Drive documentation

Use the Tc2_MC2_Drive library if you are using the drive via the NC with the Tc2_MC2 library.

The drive is accessed via the MC2 axis reference (AXIS_REF). The function blocks of the Tc2_MC2_Drive library independently determine the access data to the drive (NetID, address and channel number) via the NC axis ID from the MC2 axis reference.

If you want to access parameters in the drive for which no special function block has been implemented, use the function blocks FB_SoERead and FB_SoEWrite.

Overview 1:

Note the differences when using the drive libraries with AX5000 and Bosch Rexroth IndraDrive CS (see Samples)

Functions

Name

Description

F_GetVersionTcMc2Drive

Reads version information from the PLC library. The function has been replaced by the global structure stLibVersion_Tc2_MC2_Drive.

F_ConvWordToSTAX5000C1D

Converts the C1D word (S-0-0011) of the AX5000 to an ST_AX5000_C1D structure.

See: TwinCAT3 PLC Lib:Tc2_Drive documentation.

Function blocks

Name

Description

FB_SoEReset

Resets the drive (S-0-0099).

FB_SoEWritePassword

Sets the drive password (S-0-0267).

 

 

FB_SoEReadDiagMessage

Reads the diagnostic message (S-0-0095).

FB_SoEReadDiagNumber

Reads the diagnostic number (S-0-0390).

FB_SoEReadDiagNumberList

Reads the diagnostic number list (up to 30 entries) (S-0-0375).

FB_SoEReadClassXDiag

Reads the Class 1 diagnosis (S-0-0011) and the Class 3 diagnosis (S-0-0013).

 

 

FB_SoEExecuteCommand

Executes a command.

FB_SoEWriteCommandControl

Sets the Command Control.

FB_SoEReadCommandState

Checks the command status.

 

 

FB_SoERead

Reads a parameter.

FB_SoEWrite

Writes a parameter.

 

 

FB_SoEReadAmplifierTemperature

Reads the drive temperature (S-0-0384).

FB_SoEReadMotorTemperature

Reads the motor temperature (S-0-0383).

FB_SoEReadDcBusCurrent

Reads the DC bus current (S-0-0381).

FB_SoEReadDcBusVoltage

Reads the DC bus voltage (S-0-0380).

 

 

FB_SoEAX5000ReadActMainVoltage

Reads the mains voltage (P-0-0200).

FB_SoEAX5000SetMotorCtrlWord

Sets the Motor Control Word (P-0-0096).

FB_SoEAX5000FirmwareUpdate

Executes an automatic firmware update for the AX5000.

FB_SoEAX5000SetPositionOffset

Saves a position offset.

FB_SoEAX5000DeletePositionOffset

Deletes a position offset.

 

 

FB_CoERead

Reads a parameter.

FB_CoEWrite

Writes a parameter.

 

 

FB_CoEAX80000SetPositionOffset

Saves a position offset.

FB_CoEAX80000DeletePositionOffset

Deletes a position offset.

Requests

Component

Version

TwinCAT on the development computer

3.1 Build 4016 or higher

TwinCAT on the Windows CE-Image

3.1 Build 4016 or higher

TwinCAT on the Windows XP-Image

3.1 Build 4016 or higher