Overview

Overview 1:

The Tc2_Drive library should no longer be used in newer projects. Please use the Tc2_MC2_Drive library instead (see documentation TwinCAT 3 PLC Lib Tc2_MC2_Drive).

The Tc2_Drive library includes functions and function blocks for SoE drives that access the drive via a drive reference.

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

Note

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 2:

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

Functions

Name

Description

F_GetVersionTcDrive

Reads version information from the PLC library. The function will be replaced by the global structure stLibVersion_Tc2_Drive.

F_ConvWordToSTAX5000C1D

Converts the C1D word (S-0-0011) of the AX5000 to a structure ST_AX5000_C1D for Class 1 diagnosis

F_ConvWordToSTAX5000DriveStatus

Converts the Drive status word (S-0-0135) of the AX5000 into the structure ST_AX5000DriveStatus

F_ConvWordToSTIndraDriveCsC1D

Converts the C1D word (S-0-0011) of the IndraDrive Cs into the structure ST_IndraDriveCs_C1D for Class 1 diagnosis

F_ConvWordToSTIndraDriveCsDriveStatus

Converts the drive status word (S-0-0135) of the IndraDrive Cs into a structure ST_IndraDriveCsDriveStatus

Function blocks

Name

Description

FB_SoEReset_ByDriveRef

Resets the drive (S-0-0099).

FB_SoEWritePassword_ByDriveRef

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

FB_SoEExecuteCommand_ByDriveRef

Executes a command.

 

 

FB_SoEReadDiagMessage_ByDriveRef

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

FB_SoEReadDiagNumber_ByDriveRef

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

FB_SoEReadDiagNumberList_ByDriveRef

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

FB_SoEReadClassXDiag_ByDriveRef

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

 

 

FB_SoEWriteCommandControl_ByDriveRef

Sets the Command Control.

FB_SoEReadCommandState_ByDriveRef

Checks the command status.

 

 

FB_SoERead_ByDriveRef

Reads a parameter (see PLC Lib Tc2_EtherCAT).

FB_SoEWrite_ByDriveRef

Writes a parameter (see PLC Lib Tc2_EtherCAT).

 

 

FB_SoEReadAmplifierTemperature_ByDriveRef

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

FB_SoEReadMotorTemperature_ByDriveRef

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

FB_SoEReadDcBusCurrent_ByDriveRef

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

FB_SoEReadDcBusVoltage_ByDriveRef

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

 

 

FB_SoEAX5000ReadActMainVoltage_ByDriveRef

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

FB_SoEAX5000SetMotorCtrlWord_ByDriveRef

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

FB_SoEAX5000FirmwareUpdate_ByDriveRef

Executes an automatic firmware update for the AX5000.

 

 

FB_CoEDriveEnable

Enables a CoE drive.

FB_CoEDriveMoveVelocity

Generates a simple three-phase velocity profile that can be used to supply a CoE drive directly.

FB_SoEDriveEnable

Enables a SoE drive.

FB_SoEDriveMoveVelocity

Generates a simple three-phase velocity profile that can be used to supply a SoE drive directly.

Requirements

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