Table of Contents

Advertisement

Industrial Automation Headquarters
Delta Electronics, Inc.
Taoyuan Technology Center
No.18, Xinglong Rd., Taoyuan City,
Taoyuan County 33068, Taiwan
TEL: 886-3-362-6301 / FAX: 886-3-371-6301
Asia
Delta Electronics (Jiangsu) Ltd.
Wujiang Plant 3
1688 Jiangxing East Road,
Wujiang Economic Development Zone
Wujiang City, Jiang Su Province, P.R.C. 215200
TEL: 86-512-6340-3008 / FAX: 86-769-6340-7290
Delta Greentech (China) Co., Ltd.
238 Min-Xia Road, Pudong District,
ShangHai, P.R.C. 201209
TEL: 86-21-58635678 / FAX: 86-21-58630003
Delta Electronics (Japan), Inc.
Tokyo Office
2-1-14 Minato-ku Shibadaimon,
Tokyo 105-0012, Japan
TEL: 81-3-5733-1111 / FAX: 81-3-5733-1211
Delta Electronics (Korea), Inc.
1511, Byucksan Digital Valley 6-cha, Gasan-dong,
Geumcheon-gu, Seoul, Korea, 153-704
TEL: 82-2-515-5303 / FAX: 82-2-515-5302
Delta Electronics Int'l (S) Pte Ltd.
4 Kaki Bukit Ave 1, #05-05, Singapore 417939
TEL: 65-6747-5155 / FAX: 65-6744-9228
Delta Electronics (India) Pvt. Ltd.
Plot No 43 Sector 35, HSIIDC
Gurgaon, PIN 122001, Haryana, India
TEL : 91-124-4874900 / FAX : 91-124-4874945
Americas
Delta Products Corporation (USA)
Raleigh Office
P.O. Box 12173,5101 Davis Drive,
Research Triangle Park, NC 27709, U.S.A.
TEL: 1-919-767-3800 / FAX: 1-919-767-8080
Delta Greentech (Brasil) S.A.
Sao Paulo Office
Rua Itapeva, 26 - 3° andar Edificio Itapeva One-Bela Vista
01332-000-São Paulo-SP-Brazil
TEL: 55 11 3568-3855 / FAX: 55 11 3568-3865
Europe
Delta Electronics (Netherlands) B.V.
Eindhoven Office
De Witbogt 20, 5652 AG Eindhoven, The Netherlands
TEL : +31 (0)40-8003800 / FAX : +31 (0)40-8003898
*We reserve the right to change the information in this manual without prior notice.
Delta EtherCAT
Programming Guide
www.deltaww.com

Advertisement

Table of Contents
loading

Summary of Contents for Delta EtherCAT

  • Page 1 1511, Byucksan Digital Valley 6-cha, Gasan-dong, Geumcheon-gu, Seoul, Korea, 153-704 Delta EtherCAT TEL: 82-2-515-5303 / FAX: 82-2-515-5302 Delta Electronics Int’l (S) Pte Ltd. 4 Kaki Bukit Ave 1, #05-05, Singapore 417939 Programming Guide TEL: 65-6747-5155 / FAX: 65-6744-9228 Delta Electronics (India) Pvt. Ltd.
  • Page 2: Table Of Contents

    3.5 Motion control in PP mode ·················································································· 3-16 3.5.1 Function list ································································································ 3-16 3.5.2 Application examples ···················································································· 3-16 3.6 Motion control in CSP mode ··············································································· 3-20 3.6.1 Function list ································································································ 3-20 3.6.2 Application examples ···················································································· 3-21 3.7 EtherCAT Slave IO control (digital input) ································································ 3-38 March, 2017...
  • Page 3 3.10 Application of EtherCAT analog output module (R1-EC-9144) ··································· 3-44 3.10.1 Function list ······························································································· 3-44 3.10.2 Application examples··················································································· 3-44 3.11 Application of EtherCAT Compare function for PCI card (PCI-L221-B1) ······················· 3-47 3.11.1 Function list ······························································································· 3-47 3.11.2 Application examples ··················································································· 3-48 API List of Dynamic-Link Library 4.1 Data Type and Setting Range ···············································································...
  • Page 4 6.11 _ECAT_Master_Get_Cycle_SpendTime ······························································· 6-14 6.12 _ECAT_Master_Check_Initial_Done ··································································· 6-15 6.13 _ECAT_Master_Get_Initial_ErrorCode ································································ 6-16 6.14 _ECAT_Master_Check_Working_Counter ···························································· 6-17 6.15 _ECAT_Master_Get_Return_Code_Message ······················································· 6-18 EtherCAT CoE Standard Communication 7.1 _ECAT_Slave_SDO_Send_Message ····································································· 7-3 7.2 _ECAT_Slave_SDO_Read_Message ····································································· 7-4 7.3 _ECAT_Slave_SDO_Quick_Send_Message ···························································· 7-5 7.4 _ECAT_Slave_SDO_Quick_Read_Message ···························································· 7-6 7.5 _ECAT_Slave_SDO_Read_Response ····································································...
  • Page 5 8.11 _ECAT_Slave_Motion_Get_StatusWord ······························································ 8-14 8.12 _ECAT_Slave_Motion_Get_Mdone ···································································· 8-16 8.13 _ECAT_Slave_Motion_Get_Position ··································································· 8-17 8.14 _ECAT_Slave_Motion_Get_Command ································································ 8-18 8.15 _ECAT_Slave_Motion_Get_Target_Command ······················································ 8-19 8.16 _ECAT_Slave_Motion_Get_Actual_Position ························································· 8-20 8.17 _ECAT_Slave_Motion_Get_Actual_Command ······················································ 8-21 8.18 _ECAT_Slave_Motion_Get_Current_Speed ························································· 8-22 8.19 _ECAT_Slave_Motion_Get_Torque ···································································· 8-23 8.20 _ECAT_Slave_Motion_Get_Buffer_Length ··························································· 8-24 8.21 _ECAT_Slave_Motion_Set_TouchProbe_Config ····················································...
  • Page 6 11.2 _ECAT_Slave_CST_Multi_Start_Move ································································ 11-3 Homing 12.1 _ECAT_Slave_Home_Config ············································································ 12-3 12.2 _ECAT_Slave_Home_Move ············································································ 12-19 12.3 _ECAT_Slave_Home_Status ··········································································· 12-20 EtherCAT Profile Position Mode (PP) 13.1 _ECAT_Slave_PP_Start_Move ·········································································· 13-3 13.2 _ECAT_Slave_PP_Advance_Config ··································································· 13-4 EtherCAT Profile Velocity Mode (PV) 14.1 _ECAT_Slave_PV_Start_Move ·········································································· 14-3 14.2 _ECAT_Slave_PV_Advance_Config ··································································· 14-4...
  • Page 7 Inverter Motion Control 15.1 _ECAT_Slave_VL_Start_Move ·········································································· 15-2 EtherCAT Profile Torque Mode (PT) 16.1 _ECAT_Slave_PT_Start_Move ·········································································· 16-3 16.2 _ECAT_Slave_PT_Advance_Config ··································································· 16-4 Group Motion Control 17.1 _ECAT_Slave_User_Motion_Control_Set _Enable_Mode ········································17-3 17.2 _ECAT_Slave_User_Motion_Control_Get_Enable_Mode ········································ 17-5 17.3 _ECAT_Slave_User_Motion_Control_Set_Type ···················································· 17-6 17.4 _ECAT_Slave_User_Motion_Control_Set_Data ···················································· 17-8 17.5 _ECAT_Slave_User_Motion_Control_Clear_Data ·················································· 17-9 17.6 _ECAT_Slave_User_Motion_Control_Get_DataCnt ·············································...
  • Page 8 21.7 _ECAT_Slave_R1_ECx62x_Set_PEL_Inverse ······················································ 21-9 21.8 _ECAT_Slave_R1_ECx62x_Set_Svon_Inverse ··················································· 21-10 21.9 _ECAT_Slave_R1_ECx62x_Set_Home_Slow_Down ············································ 21-11 21.10 _ECAT_Slave_R1_ECx62x_Get_IO_Status ······················································ 21-12 21.11 _ECAT_Slave_R1_ECx62x_Get_Single_IO_Status ············································ 21-13 Operation of Delta Servo System 22.1 _ECAT_Slave_DeltaServo_Write_Parameter ························································ 22-3 22.2 _ECAT_Slave_DeltaServo_Read_Parameter ························································ 22-4 22.3 _ECAT_Slave_DeltaServo_Read_Parameter_Info ················································· 22-5 22.4 _ECAT_Slave_DeltaServo_Set_Velocity_Limit ······················································ 22-6 22.5 _ECAT_Slave_DeltaServo_Set_Compare_Enable ·················································...
  • Page 9 24.2 _ECAT_Slave_R1_EC9144_Set_Output_Enable ··················································· 24-4 24.3 _ECAT_Slave_R1_EC9144_Get_Output _ReturnCode ··········································· 24-5 Auto Recording Function of Motion Axis 25.1 _ECAT_Slave_Record_Set_Type ······································································· 25-3 25.2 _ECAT_Slave_Record_Set_Enable ···································································· 25-4 25.3 _ECAT_Slave_Record_Get_Cnt ········································································ 25-5 25.4 _ECAT_Slave_Record_Read_Data ···································································· 25-6 25.5 _ECAT_Slave_Record_Clear_Data ···································································· 25-7 25.6 _ECAT_Slave_Record_Multi_Set_Enable ···························································· 25-8 25.7 _ECAT_Slave_Record_Multi_Clear_Data ···························································· 25-9 Operation of Local Digital I/O 26.1 _ECAT_GPIO_Set_Output ················································································...
  • Page 10 Information of EtherCAT Dynamic-Link Library (DLL) 28.1 _ECAT_Master_Get_DLL_Path ········································································· 28-2 28.2 _ECAT_Master_Get_DLL_Version ····································································· 28-3 28.3 _ECAT_Master_Get_DLL_Path_Single ······························································· 28-4 28.4 _ECAT_Master_Get_DLL_Version_Single ···························································· 28-5 Security of Software Protection 29.1 _ECAT_Security_Check_Verifykey ····································································· 29-2 29.2 _ECAT_Security_Get_Check_Verifykey_State ······················································ 29-3 29.3 _ECAT_Security_Write_Verifykey ······································································· 29-4 29.4 _ECAT_Security_Get_Write_Verifykey_State ························································ 29-5 29.5 _ECAT_Security_Check_UserPassword ······························································...
  • Page 11 (This page is intentionally left blank.) March, 2017...
  • Page 12 Introduction to API Function Library This chapter introduces APIs of EtherCAT dynamic-link library (DLL). Users can perform various functions through calling these API libraries. The contents below provide instructions on how to import API libraries into your developing environment.                                                                ...
  • Page 13: How To Use Function Libraries

    (2) Select Project / Setting / Link in Visual C development environment. Then, type “..\lib\EtherCat_DLL.lib” in Object / Library modules (3) Setup completed. Users can start to operate EtherCAT DLL with API. 1.2.2 Using VB Place “EtherCat_DLL.bas” and “EtherCat_DLL_Err.bas” in the project created by users to control EtherCAT DLL with API.
  • Page 14: Using C

    EtherCAT Programming Guide Introduction to API Function Library 1.2.4 Using C# Place “EtherCat_DLL.cs” and “EtherCat_DLL_Err.cs” in user-built project to control EtherCAT DLL with API. Note: For C# projects, please tick the Enable native code debugging option in the Debug tab. See figure below.
  • Page 15 Introduction to API Function Library EtherCAT Programming Guide (This page is intentionally left blank.) March, 2017...
  • Page 16: Ethercat Introduction

    This chapter introduces the setting for applying Delta EtherCAT function library, including the suggested maximum slave number for connection, initialization of RTX operating system and the description on how to check if the EtherCAT associated DLL can operate normally in RTS. Please see the contents below for more information.
  • Page 17: Maximum Number Of The Slave Device

    2.1.1 below for the suggested maximum slave quantity to avoid communication instability. When EtherCAT master runs in PCI motion card, it can connect 64 remote modules and 32 motion axes at most with the default communication cycle 1 ms (1K). Please refer to table 2.1.2.
  • Page 18: Initialize Rtx Runtime Environment

    It will start running only after instructions related to EtherCAT initialization API are executed. Or, you can also manually enable RTX. See the steps below. Once RTX is enabled, you can start to use other related functions and APIs in EtherCAT dynamic link library.
  • Page 19: Introduction To Rtss Task Manager

    EtherCAT Introduction EtherCAT Programming Guide Check the status of RTX devices When the status of RTX devices shows “Running”, the user can start to use EtherCAT related functions. Figure 2.2.2 RTX devices in Running status 2.3 Introduction to RTSS Task Manager RTSS Task Manager can be used to check whether the EtherCAT associated files (ECAT_RTX_RTDLL.rtdll, ECAT_STACK_RTDLL.rtdll) are operating normally in RTX.
  • Page 20 EtherCAT Programming Guide EtherCAT Introduction If there is any file missing in Task Manager, users can reload the missing file. Click the Start Task key, and the RtssRun window will pop out. Figure 2.3.2 RtssRun window Click Browse and select the missing file, which is placed in C:\Windows\system32\.
  • Page 21 EtherCAT Introduction EtherCAT Programming Guide Then, while the other options remain unchanged, press OK and the file will be loaded into RTX system. Figure 2.3.4 Load the missing file March, 2017...
  • Page 22: Ethercat Operation Example

    EtherCAT Operation Example This chapter provides the C/C++ examples of EtherCAT dynamic-link library, including EtherCAT initialization, homing procedure, PT, PV, PP, CSP modes, remote digital input/output module, analog input/output, and high-speed pulse compare function. 3.1 EtherCAT Initialization ········································································ 3-3 3.1.1 Function list ················································································ 3-3 3.1.2 Application examples ···································································...
  • Page 23 EtherCAT Operation Example EtherCAT Programming Guide 3.10.1 Function list ············································································ 3-44 3.10.2 Application examples ································································ 3-44 3.11 Application of EtherCAT Compare function for PCI card (PCI-L221-B1) ······ 3-47 3.11.1 Function list ············································································ 3-47 3.11.2 Application examples ································································ 3-48 March, 2017...
  • Page 24: Ethercat Initialization

    EtherCAT motion card Supported 3.1.2 Application examples Program interface Figure 3.1.2.1 (1) Activate interface card Figure 3.1.2.2 Press the OpenCard key to execute the following program: RetCode = _ECAT_Master_Open(&gESCExistCards); /* The variable, gESCExistCards, will return EtherCAT motion card number. */ March, 2017...
  • Page 25 RetCode = _ECAT_Master_Get_CardSeq(i, &CardNo); /* Get the card No. of the PC interface Card i. This card No. is the dip switch value. EtherCAT card number in RTX version is 16. */ RetCode = _ECAT_Master_Initial(CardNo); /* Start to initialize the interface card. */ if(RetCode != 0) strMsg.Format("_ECAT_Master_Initial, RetCode = %d", RetCode);...
  • Page 26 EtherCAT Programming Guide EtherCAT Operation Example (4) Exit program Figure 3.1.2.6 Press the Exit key to execute the following program: for(i=0; i< gESCExistCards; i++) _ECAT_Master_Reset(gpESCCardNoList[i]); // Reset the interface card. _ECAT_Master_Close(); // End the operation of motion control card. March, 2017...
  • Page 27: Motion Control Of Homing

    EtherCAT Operation Example EtherCAT Programming Guide 3.2 Motion control of homing 3.2.1 Function list Function name _ECAT_Slave_Home_Config _ECAT_Slave_Home_Move _ECAT_Slave_Motion_Sd_Stop  Properties Hardware EtherCAT RTX (PAC) EtherCAT motion card Supported 3.2.2 Application examples Program interface Figure 3.2.2.1 (1) Activate and initialize interface card Press the Initial Card key (as shown in figure 3.2.2.1) to start initializing the interface card.
  • Page 28 EtherCAT Programming Guide EtherCAT Operation Example (2) Enter the parameter for motion control Figure 3.2.2.2 Select Node ID and Slot ID and check the Timer box to display the motion status. Set NodeID: Specify the Node ID to be executed. The parameters “AxisNo” and “SlotNo”...
  • Page 29 EtherCAT Operation Example EtherCAT Programming Guide (5) Homing procedures Press the Homing key (as shown in figure 3.2.2.4) to execute the following program: RetCode = _ECAT_Slave_Home_Config(gESCCardNo, gNodeID, gSlotID, Mode, Offset, StrVel, MaxVel, Tacc); /* Set homing mode: 1 ~ 35, offset and speed parameters, but the servo will not operate now.
  • Page 30: Torque Control

    EtherCAT Programming Guide EtherCAT Operation Example 3.3 Torque control 3.3.1 Function list Function name _ECAT_Slave_PT_Start_Move _ECAT_Slave_Motion_Emg_Stop  Properties Hardware EtherCAT RTX (PAC) EtherCAT motion card Supported 3.3.2 Application examples Program interface Figure 3.3.2.1 (1) Activate and initialize interface card Press the Initial Card key (as shown in figure 3.3.2.1) to start initializing the interface card.
  • Page 31 EtherCAT Operation Example EtherCAT Programming Guide (2) Set Node ID and Slot ID for the servo drive and enable motion status display Figure 3.3.2.2 Select Node ID and Slot ID and check the Timer box to display the motion status.
  • Page 32 EtherCAT Programming Guide EtherCAT Operation Example Press the STOP key (as shown in figure 3.3.2.4) to execute the following program: RetCode = _ECAT_Slave_Motion_Emg_Stop(gESCCardNo, gNodeID, gSlotID); /* Stop torque control of the motor. */ (6) Status display Figure 3.3.2.5 Command values of the motion: RetCode = _ECAT_Slave_Motion_Get_Command(gESCCardNo, gNodeID, gSlotID, &Cmd);...
  • Page 33: Constant Speed Control

    EtherCAT Operation Example EtherCAT Programming Guide 3.4 Constant speed control 3.4.1 Function list Function name _ECAT_Slave_PV_Start_Move _ECAT_Slave_Motion_Sd_Stop  Properties Hardware EtherCAT RTX (PAC) EtherCAT motion card Supported 3.4.2 Application examples Program interface Figure 3.4.2.1 (1) Activate and initialize interface card Press the Initial Card key (as shown in figure 3.4.2.1) to start initializing the interface card.
  • Page 34 EtherCAT Programming Guide EtherCAT Operation Example (2) Set Node ID and Slot ID for the servo drive and enable motion status display Figure 3.4.2.2 Select Node ID and Slot ID and check the Timer box to display the motion status.
  • Page 35 EtherCAT Operation Example EtherCAT Programming Guide (5) Speed control Press the ← or → key (as shown in figure 3.4.2.4) to execute the following program: RetCode = _ECAT_Slave_PV_Start_Move(gESCCardNo, gNodeID, gSlotID, Velocity, Tacc, Tdec); /* Set the parameters of speed mode (the acceleration and deceleration time) and enable speed control.
  • Page 36 EtherCAT Programming Guide EtherCAT Operation Example (7) Reset the feedback value and clear the alarm Press the RESET key (as shown in figure 3.4.2.4) to execute the following program: RetCode = _ECAT_Slave_Motion_Set_Position(gESCCardNo, gNodeID, gSlotID, 0); // Clear feedback first (Value showed in servo drive panel will be set to 0).
  • Page 37: Motion Control In Pp Mode

    EtherCAT Operation Example EtherCAT Programming Guide 3.5 Motion control in PP mode 3.5.1 Function list Function name _ECAT_Slave_PP_Start_Move _ECAT_Slave_Motion_Sd_Stop  Properties Hardware EtherCAT RTX (PAC) EtherCAT motion card Supported 3.5.2 Application examples Program interface Figure 3.5.2.1 (1) Activate and initialize interface card Press the Initial Card key (as shown in figure 3.5.2.1) to start initializing the interface card.
  • Page 38 EtherCAT Programming Guide EtherCAT Operation Example (2) Set Node ID and Slot ID for the servo drive and enable motion status display Figure 3.5.2.2 Select Node ID and Slot ID and check the Timer box to display the motion status.
  • Page 39 EtherCAT Operation Example EtherCAT Programming Guide (4) Set the servo motor to ON/OFF state (servo on/servo off) Figure 3.5.2.4 Press the SVON key (as shown in figure 3.5.2.4) to execute the following program: RetCode = _ECAT_Slave_Motion_Set_Svon(gESCCardNo, gNodeID, gSlotID, ON_OFF); // ON_OFF:...
  • Page 40 EtherCAT Programming Guide EtherCAT Operation Example Motion status: RetCode = _ECAT_Slave_Motion_Get_StatusWord(gESCCardNo, gNodeID, gSlotID, &Status); // Get the current status (IO Sts. field). RetCode = _ECAT_Slave_Motion_Get_Mdone(gESCCardNo, gNodeID, gSlotID, &MCDone); // Get the current status of the motor (Motion field). (8) Reset the feedback value and clear the alarm Press the RESET key (as shown in figure 3.5.2.4) to execute the following program:...
  • Page 41: Motion Control In Csp Mode

    EtherCAT Operation Example EtherCAT Programming Guide 3.6 Motion control in CSP mode 3.6.1 Function list Function name _ECAT_Slave_Motion_Set_Svon _ECAT_Slave_CSP_Start_Move _ECAT_Slave_CSP_Start_V_Move _ECAT_Slave_CSP_Start_Multiaxes_Move _ECAT_Slave_CSP_Start_Arc_Move _ECAT_Slave_CSP_Start_Arc2_Move _ECAT_Slave_CSP_Start_Arc3_Move _ECAT_Slave_CSP_Start_Spiral_Move _ECAT_Slave_CSP_Start_Spiral2_Move _ECAT_Slave_CSP_Start_Heli_Move _ECAT_Slave_CSP_Start_Sphere_Move _ECAT_Slave_Motion_Sd_Stop _ECAT_Slave_Motion_Set_Position _ECAT_Slave_Motion_Set_Command _ECAT_Slave_Motion_Ralm _ECAT_Slave_Motion_Get_Command _ECAT_Slave_Motion_Get_Position _ECAT_Slave_Motion_Get_Current_Speed _ECAT_Slave_Motion_Get_StatusWord _ECAT_Slave_Motion_Get_Mdone _ECAT_Master_Check_Initial_Done  Properties...
  • Page 42: Application Examples

    EtherCAT Programming Guide EtherCAT Operation Example 3.6.2 Application examples Program interface Figure 3.6.2.1 (1) Activate and initialize interface card Press the Initial Card key (as shown in figure 3.6.2.1) to start initializing the interface card. Press the Find Slave key (as shown in figure 3.6.2.1) to start searching the connecting modules.
  • Page 43 EtherCAT Operation Example EtherCAT Programming Guide (3) Select the moving mode Figure 3.6.2.2 Single-axis motion control: P To P: Point to point movement Continue: Linear movement Two-axis motion control: Line2: Linear interpolation control Arc: Type 1 arc interpolation control (with the known circle center and angle)
  • Page 44 EtherCAT Programming Guide EtherCAT Operation Example (4) The parameter of single-axis motion control Figure 3.6.2.3 Dist.: Input the moving distance. The parameter “Dist” in the API function. StrVel.: Input the initial speed. The parameter “StrVel” in the API function. ConstVel: Input the constant speed. The parameter “ConstVel” in the API function.
  • Page 45 EtherCAT Operation Example EtherCAT Programming Guide Press the SVON key (as shown in figure 3.6.2.4) to execute the following program: RetCode = _ECAT_Slave_Motion_Set_Svon(gESCCardNo, gNodeID[i], gSlotID[i], ON_OFF); // ON_OFF: // 0: Servo OFF //1: Servo ON (6) Select P To P and start the point to point motion control Press the ←...
  • Page 46 EtherCAT Programming Guide EtherCAT Operation Example (8) Set the Gear or software limit in P To P mode Figure 3.6.2.6 Press the ← or → key (as shown in figure 3.6.2.4) to select P To P motion control. To set the Gear values, press the Set key in the Set Gear section (as shown in figure 3.6.2.6) to...
  • Page 47 EtherCAT Operation Example EtherCAT Programming Guide (10) Select Continue for motion control with constant speed Press the ← or → key (as shown in figure 3.6.2.4) to execute the following program: RetCode = _ECAT_Slave_CSP_Start_V_Move(gESCCardNo, gNodeID[0], gSlotID[0], 0, StrVel, MaxVel, Tacc, gbIsSCurve);...
  • Page 48 EtherCAT Programming Guide EtherCAT Operation Example Spiral parameter settings: Type 1 of spiral interpolation (with the known circle center and angle) CenX: Input the X-coordinate of the circle center. The parameter “CenterPoint” in the API function. CenY: Input the Y-coordinate of the circle center. The parameter “CenterPoint” in the API function.
  • Page 49 EtherCAT Operation Example EtherCAT Programming Guide TPhase1: Input the duration from initial speed to constant speed. The parameter “TPhase1” in the API function. TPhase2: Input the duration from constant speed to end speed. The parameter “TPhase2” in the API function.
  • Page 50 EtherCAT Programming Guide EtherCAT Operation Example (15) Select Spiral2 for two-axis arc motion control (end point and circles). Press the ← or → key (as shown in figure 3.6.2.4) to execute the following program: RetCode = _ECAT_Slave_CSP_Start_Spiral2_Move(gESCCardNo, gNodeID, gSlotID, CenPoint, EndPoint, CycleNum, Dir, StrVel, MaxVel, EndVel, Tacc, Tdec, gbIsSCurve, gbIsABS);...
  • Page 51 EtherCAT Operation Example EtherCAT Programming Guide “TPhase1” in the API function. TPhase2: Input the duration from constant speed to end speed. The parameter “TPhase2” in the API function. S-Curve: Check this box to use S-curve for the speed curve. Otherwise, it will use T-Curve.
  • Page 52 EtherCAT Programming Guide EtherCAT Operation Example StrVel.: Input the initial speed. The parameter “StrVel” in the API function. ConstVel: Input the constant speed. The parameter “ConstVel” in the API function. EndVel: Input the end speed when it reaches the target position. The parameter “EndVel”...
  • Page 53 EtherCAT Operation Example EtherCAT Programming Guide (19) Select Spiral for two-axis arc motion (end point and angle) Press the ← or → key (as shown in figure 3.6.2.4) to execute the following program: RetCode = _ECAT_Slave_CSP_Start_Arc2_Move(gESCCardNo, gNodeID, gSlotID, EndPoint, Angle, StrVel, MaxVel, EndVel, Tacc, Tdec, gbIsSCurve, gbIsABS);...
  • Page 54 EtherCAT Programming Guide EtherCAT Operation Example Heli parameter settings: Three-axis helical interpolation. CenX: Input the X-coordinate of the circle center. The parameter “CenterPoint” in the API function. CenY: Input the Y-coordinate of the circle center. The parameter “CenterPoint” in the API function.
  • Page 55 EtherCAT Operation Example EtherCAT Programming Guide Sphere parameter settings: Three-axis sphere motion (with given three points). PosX1: The point to be passed through on X-axis (between starting and end point). The parameter “Target1Point” in the API function. PosY1: The point to be passed through on Y-axis (between starting and end point). The parameter “Target1Point”...
  • Page 56 EtherCAT Programming Guide EtherCAT Operation Example See the figure below: Figure 3.6.2.11 (24) Select Line3 for three-axis linear motion Press the ← or → key (as shown in figure 3.6.2.4) to execute the following program: RetCode = _ECAT_Slave_CSP_Start_Multiaxes_Move(gESCCardNo, 3, gNodeID, gSlotID, Dist, StrVel, MaxVel, EndVel, Tacc, Tdec, gbIsSCurve, gbIsABS);...
  • Page 57 EtherCAT Operation Example EtherCAT Programming Guide (26) Status display Figure 3.6.2.12 Command values of the motion: RetCode = _ECAT_Slave_Motion_Get_Command(gESCCardNo, gNodeID, gSlotID, &Cmd); // Get the command value (CMD. field). RetCode = _ECAT_Slave_Motion_Get_Position(gESCCardNo, gNodeID, gSlotID, &Pos); // Get the feedback value of the command (FBK. field).
  • Page 58 EtherCAT Programming Guide EtherCAT Operation Example (28) Stop the motion Press the STOP key (see figure 3.6.2.4) to decelerate to stop: RetCode = _ECAT_Slave_Motion_Sd_Stop(gESCCardNo, gNodeID[0], gSlotID[0], Tdec); In this example, the motion decelerates to stop, which is to stop the motion gradually according to the set deceleration time.
  • Page 59: Function List

    EtherCAT Operation Example EtherCAT Programming Guide 3.7 Digital input module 3.7.1 Function list Function name _ECAT_Slave_DIO_Get_Input_Value  Properties Hardware EtherCAT RTX (PAC) EtherCAT motion card Supported 3.7.2 Application examples Program interface Figure 3.7.2.1 (1) Activate and initialize interface card Press the Initial Card key (as shown in figure 3.7.2.1) to start initializing the interface card.
  • Page 60 EtherCAT Programming Guide EtherCAT Operation Example (3) Digital input (Slave DI) To obtain the data sent from the digital input module, users have to use R1-EC-60X2 module and execute the program below: RetCode = _ECAT_Slave_DIO_Get_Input_Value(gESCCardNo, gNodeID, gSlotID, &gValue); As shown in figure 3.7.2.3, no signal input is displayed in R1-EC-60X2 module.
  • Page 61: Function List

    EtherCAT Operation Example EtherCAT Programming Guide 3.8 Digital output module 3.8.1 Function list Function name _ECAT_Slave_DIO_Set_Output_Value _ECAT_Slave_DIO_Get_Output_Value  Properties Hardware EtherCAT RTX (PAC) EtherCAT motion card Supported 3.8.2 Application examples Program interface Figure 3.8.3.1 (1) Activate and initialize interface card Press the Initial Card key (as shown in figure 3.8.3.1) to start initializing the interface card.
  • Page 62 EtherCAT Programming Guide EtherCAT Operation Example (3) Digital output To output data via the digital output module, users have to use R1-EC-70X2 module and execute the program below: RetCode = ECAT_Slave_DIO_Set_Output_Value(gESCCardNo,gNodeID,gSlotID, gValue); The status of the digital output module can be obtained through the following program: RetCode = _ECAT_Slave_DIO_Get_Output_Value(gESCCardNo,gNodeID,gSlotID, &gValue);...
  • Page 63: Function List

    EtherCAT Operation Example EtherCAT Programming Guide 3.9 Analog input module 3.9.1 Function list Function name _ECAT_Slave_AIO_Set_Input_RangeMode _ECAT_Slave_R1_EC8124_Set_Input_AverageMode _ECAT_Slave_AIO_Set_Input_ConvstFreq_Mode _ECAT_Slave_AIO_Get_Input_Value  Properties Hardware EtherCAT RTX (PAC) EtherCAT motion card Supported 3.9.2 Application examples Program interface Figure 3.9.2.1 (1) Activate and initialize interface card Press the Initial Card key (as shown in figure 3.9.2.1) to start initializing the interface card.
  • Page 64 EtherCAT Programming Guide EtherCAT Operation Example Set NodeID: Specify the Node ID to be executed. The parameters “AxisNo” and “SlotNo” in the API function. Timer: Check the Timer box to display the current contact status. (3) Select AD Channel, AD Mode, Avg Range, and Conversion Time.
  • Page 65: Function List

    EtherCAT Operation Example EtherCAT Programming Guide 3.10 Analog output module 3.10.1 Function list Function name _ECAT_Slave_AIO_Set_Output_RangeMode _ECAT_Slave_AIO_Set_Output_OverRange_Enable _ECAT_Slave_R1_EC9144_Get_Output_ReturnCode _ECAT_Slave_AIO_Set_Output_Value _ECAT_Slave_AIO_Get_Output_Value  Properties Hardware EtherCAT RTX (PAC) EtherCAT motion card Supported 3.10.2 Application examples Program interface Figure 3.10.2.1 3-44 March, 2017...
  • Page 66 EtherCAT Programming Guide EtherCAT Operation Example (1) Activate and initialize interface card Press the Initial Card key (as shown in figure 3.10.2.1) to start initializing the interface card. Press the Find Slave key (as shown in figure 3.10.2.1) to start searching the connecting modules.
  • Page 67 EtherCAT Operation Example EtherCAT Programming Guide (4) When selecting DA Channel and DA Mode (as shown in figure 3.10.2.3), the following program is executed: RetCode = _ECAT_Slave_AIO_Set_Output_RangeMode(gESCCardNo, gNodeID, gSlotID, Mode); /* Set DA output range */ When the Apply key (as shown in 3.10.2.3) is pressed, the following program will be...
  • Page 68: Function List

    EtherCAT Programming Guide EtherCAT Operation Example 3.11 EtherCAT motion card – high-speed pulse compare function 3.11.1 Function list Function name _ECAT_Compare_Set_Channel_Position _ECAT_Compare_Get_Channel_Position _ECAT_Compare_Set_Ipulser_Mode _ECAT_Compare_Set_Channel_Direction _ECAT_Compare_Set_Channel_Trigger_Time _ECAT_Compare_Set_Channel_One_Shot _ECAT_Compare_Set_Channel_Source _ECAT_Compare_Set_Channel_Enable _ECAT_Compare_Channel0_Position _ECAT_Compare_Set_Channel0_Trigger_By_GPIO _ECAT_Compare_Set_Channel1_Output_Enable _ECAT_Compare_Set_Channel1_Output_Mode _ECAT_Compare_Get_Channel1_IO_Status _ECAT_Compare_Set_Channel1_GPIO_Out _ECAT_Compare_Set_Channel1_Position_Table _ECAT_Compare_Get_Channel1_Positioin_Table_Level _ECAT_Compare_Get_Channel1_Position_Table_Count _ECAT_Compare_Set_Channel_Polarity _ECAT_Compare_Reuse_Channel1_Postion_Table _ECAT_Compare_Reuse_Channel1_Position_Table_Level Properties ...
  • Page 69: Application Examples

    (1) Activate and initialize interface card *Make sure the PCI-L221-B1 interface card has been installed and it has to work with Delta’s pulse module for pulse comparing in this example. Press the Initial Card key (as shown in figure 3.11.2.1) to start initializing the interface card.
  • Page 70 (2) Select the Card No., Node ID, and QEP Figure 3.11.2.2 Card: Select the EtherCAT PCI motion card No. to be used. Node: Select the Node ID; in the example, this axis will generate pulse for comparison. QEP1: Select channel 1 for pulse input. (It should correspond to the physical wiring of QA1 and QB1.)
  • Page 71 EtherCAT Operation Example EtherCAT Programming Guide TCount: Number of the compared times. rt = _ECAT_Compare_Get_Channel1_Position_Table_Count (gu16_CardNo, &u32_Count); /* Obtain the number of compared times. */ (4) MPC parameter settings Figure 3.11.2.4 Enable: Enable/disable compare function. The following program is executed: rt = _ECAT_Compare_Set_Channel_Enable (gu16_CardNo, u16_Channel, 1);...
  • Page 72 EtherCAT Programming Guide EtherCAT Operation Example (5) Settings for pulse comparison Figure 3.11.2.5 Trigger Time: Set the lasting time for triggering the signal. Trigger count: Set the number of times for signal to be triggered. Start Position: Set the starting position for signal to be compared.
  • Page 73 EtherCAT Operation Example EtherCAT Programming Guide Select Type 1 for applying channel 1 (CMP_2) as the differential signal output channel to output the triggered signal. (Compare the pulse at user-defined pulse intervals. In this example, the result of simulated pulse comparison at a fixed pulse interval is similar to Type 0.
  • Page 74 EtherCAT Programming Guide EtherCAT Operation Example Enable the differential signal output function of channel 2: rt = _ECAT_Compare_Set_Channel1_Output_Enable (gu16_CardNo, 1); // 0: Disable // 1: Enable (6) Command display and testing operations: Figure 3.11.2.8 Reset: Press this key to reset the command.
  • Page 75 EtherCAT Operation Example EtherCAT Programming Guide (This page is intentionally left blank.) 3-54 March, 2017...
  • Page 76: Api List Of Dynamic-Link Library

    API List of Dynamic-Link Library This chapter lists all the APIs, data type and setting range of Delta EtherCAT Dynamic-link library. 4.1 Data Type and Setting Range ······························································· 4-2 API list and descriptions······································································ 4-2 March, 2017...
  • Page 77: Api List And Descriptions

    1.797683134862315E309 Boolean Boolean TRUE, FALSE 4.2 API list and descriptions EtherCAT Master Configuration Set the cycle time of the EtherCAT master _ECAT_Master_Set_CycleTime communication. *Set before initialization. Acquire the cycle time of the EtherCAT master _ECAT_Master_Get_CycleTime communication. Determine whether to enable user-defined station.
  • Page 78 EtherCAT Programming Guide API List of EtherCAT Dynamic-Link Library EtherCAT Master Initialization Check the number of motion cards and EtherCAT _ECAT_Master_Open kernels, as well as creating memory block. Initialize EtherCAT communication and switch the _ECAT_Master_Initial slave to OP mode Reset the EtherCAT master’s status and switch _ECAT_Master_Reset the slave to initial mode.
  • Page 79 API List of EtherCAT Dynamic-Link Library EtherCAT Programming Guide EtherCAT CoE Standard Communication Acquire the basic information of each slave device _ECAT_Slave_PDO_Get_Information PDO. Acquire the details of PDO mapping in the slave _ECAT_Slave_PDO_Get_Detail_Mapping device _ECAT_Slave_PDO_Get_Rx_Data Acquire all slave Rx data of the PDO mapping...
  • Page 80 EtherCAT Programming Guide API List of EtherCAT Dynamic-Link Library Cyclic Synchronous Position Mode (CSP) _ECAT_Slave_CSP_Start_Move Execute linear interpolation of single axis Execute the single-axis motion with constant _ECAT_Slave_CSP_Start_V_Move speed Execute two-axis arc motion, moving from current _ECAT_Slave_CSP_Start_Arc_Move position and the specified circle center to form the specified arc’s angle...
  • Page 81 API List of EtherCAT Dynamic-Link Library EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) Set the single-axis linear motion by specifying two _ECAT_Slave_CSP_Start_2Segment_Move distances and speed Set the single-axis motion to move to multiple _ECAT_Slave_CSP_Start_PVT_Move points at fixed time Specify the initial speed and end speed of the...
  • Page 82 EtherCAT Programming Guide API List of EtherCAT Dynamic-Link Library Profile Velocity Mode (PV) Execute the single-axis motion with constant speed _ECAT_Slave_PV_Start_Move in PV mode _ECAT_Slave_PV_Advance_Config Advanced setting of PV mode Invertor Motion Control Inverter single-axis motion control with constant _ECAT_Slave_VL_Start_Move speed.
  • Page 83 EtherCAT Programming Guide Operation of DI/DO module Enable/Disable the retentive function of each _ECAT_Slave_DIO_Set_Output_Error_Mode channel on remote DO module when EtherCAT communication is disconnected Set the output status of each channel on remote DO _ECAT_Slave_DIO_Set_Output_Error_Value module when EtherCAT communication is...
  • Page 84 _ECAT_Slave_DeltaServo_Set_Compare_Enable identical to Delta servo parameter P5-59 Read the pulse compare parameter that is written _ECAT_Slave_DeltaServo_Get_Compare_Enable to the servo drive, which is identical to Delta servo parameter P5-59 Write the data array number and values of the _ECAT_Slave_DeltaServo_Set_Compare_Config pulse compare function to Delta servo drives...
  • Page 85 API List of EtherCAT Dynamic-Link Library EtherCAT Programming Guide Auto Recording Function for Motion Axis _ECAT_Slave_Record_Data_Set_Type Set the recording data type of specified axis. Enable/Disable the recording function of specified _ECAT_Slave_Record_Data_Set_Enable axis _ECAT_Slave_Record_Data_Get_Cnt Acquire the data entry number of specified axis...
  • Page 86: Ecat_Master_Get_Dll_Path ·········································································

    EtherCAT Programming Guide API List of EtherCAT Dynamic-Link Library High-Speed Pulse Compare Function Set the pulse data of channel 1 (user-defined pulse _ECAT_Compare_Set_Channel1_Position_Table intervals) _ECAT_Compare_Set_Channel1_Position_Table_L Set the pulse data of channel 1 and its user-defined active level for triggering signals...
  • Page 87 API List of EtherCAT Dynamic-Link Library EtherCAT Programming Guide Retentive Digital Output Function (R1-EC70E2D0 series) _ECAT_Slave_R1_EC70E2_Set_Output_Enable Enable/Disable the digital output of the module Retentive Digital Output Function (R1-EC70X2D0 series) _ECAT_Slave_R1_EC70X2_Set_Output_Enable Enable/Disable digital output of the module MPG operation (R1-EC5614D0 series)
  • Page 88: Ethercat Master Configuration

    EtherCAT Master Configuration This chapter provides introduction on how to use APIs for EtherCAT master before initialization. APIs mentioned here are for advanced users. If no special requirement is defined, EtherCAT master is set in default. 5.1 _ECAT_Master_Set_CycleTime ···························································· 5-3 5.2 _ECAT_Master_Get_CycleTime ···························································...
  • Page 89 EtherCAT Master Configuration EtherCAT Programming Guide API list of EtherCAT master configuration Description Function name Set the cycle time of the EtherCAT master _ECAT_Master_Set_CycleTime communication. *Set before initialization. Acquire the cycle time of the EtherCAT master _ECAT_Master_Get_CycleTime communication. Determine whether to enable user-defined station.
  • Page 90: Ecat_Master_Set_Cycletime

    This is for setting the cycle time Set before initialization of the EtherCAT master communication Note: This API can only be executed after the EtherCAT Master has been started ( “_ECAT_Master_Open” in section 6.1) and before EtherCAT communication is initialized ( “_ECAT_Master_Initial” in section 6.2).
  • Page 91: Ecat_Master_Get_Cycletime

    U16 PASCAL _ECAT_Master_Get_CycleTime (U16 CardNo, U16 *CycleTime)  Purpose This is for acquiring the cycle time of the EtherCAT master communication Note: This function can be used only after the EtherCAT Master is enabled by “_ECAT_Master_Open” (refer to section 6.1).  Parameter Name...
  • Page 92: Ecat_Master_Nodeid_Alias_Enable

     Purpose This is for determining whether to enable user-defined station. *Set before initialization. If there is any EtherCAT slave that has not been assigned with an alias, error message (0x1004) will occur. Note: Please make sure no repeated slave station alias is on the bus.
  • Page 93: Ecat_Get_Serialno

    U16 PASCAL _ECAT_Get_SerialNo (U16 CardNo, U32* SerialNo)  Purpose This is for acquiring the serial No. of the PAC or motion card. Note: This API can only be executed after the EtherCAT Master has been started by API “_ECAT_Master_Open” (section 6.1).  Parameter...
  • Page 94: Ecat_Master_Get_Dll_Seqid

    U16 PASCAL _ECAT_Master_Get_DLL_SeqID (U16 CardNo, U16 *SeqID)  Purpose This is for acquiring the sequence ID of the current dynamic link library (DLL). Note: This API can only be executed after the EtherCAT Master has been started by _ECAT_Master_Open (section 6.1).  Parameter...
  • Page 95: Ecat_Autoconfig_Open_File

    EtherCAT Master will refer to the saved communication topology and DC data during connection. If the actual communication structure does not match the DC data, EtherCAT Master will return an error code. With this API, you can avoid EtherCAT Master from issuing the wrong command when the communication topology is changed accidently.
  • Page 96: Ecat_Autoconfig_Save_File

    “_ECAT_Autoconfig_Open_File” (section 5.6) to import this configuration file so that the EtherCAT Master will able to check if the actual topology complies with the configuration and return an error code. Note: This API can only be executed after the EtherCAT Master has been started by API “_ECAT_Master_Open” (section 6.1). ...
  • Page 97: Ecat_Autoconfig_Set_Slave_Dctime

    This is for setting the DC time of each node, which default is 1000 us. Note: This API can only be executed after the EtherCAT Master has been started ( “_ECAT_Master_Open” in section 6.1) and before EtherCAT communication is initialized ( “_ECAT_Master_Initial”...
  • Page 98: Eact_Autoconfig_Clear_Configfile

    Note: This API can only be executed after the EtherCAT Master has been started ( “_ECAT_Master_Open” in section 6.1) and before EtherCAT communication is initialized ( “_ECAT_Master_Initial”...
  • Page 99: Ecat_Autoconfig_Set_Nodeid_Alias

    5.12). Meanwhile, the station alias information can be acquired by “_ECAT_Autoconfig_Get_NodeID_Alias” (refer to section 5.11) 3. This API can only be executed after the EtherCAT Master has been started ( “_ECAT_Master_Open” in section 6.1) and before setting the user-defined station alias of each node ( “_ECAT_Autoconfig_Save_NodeID_Alias”...
  • Page 100 EtherCAT Programming Guide EtherCAT Master Configuration // Enabled the communication mode of user-defined alias Status = _ECAT_Master_NodeID_Alias_Enable (CardNo, Enable); // initialize EtherCAT communication Status = _ECAT_Master_Initial(CardNo); 5-13 March, 2017...
  • Page 101: Ecat_Autoconfig_Get_Nodeid_Alias

    This is for acquiring the user-defined station alias of each node. *Set after initialization. Note: This API can only be executed after the EtherCAT Master has been started ( “_ECAT_Master_Open” in section 6.1). To use user-defined station alias of each node ( “_ECAT_Autoconfig_Set_NodeID_Alias”...
  • Page 102: Ecat_Autoconfig_Save_Nodeid_Alias

     Purpose This is for saving the user-defined station alias to the module memory block. After executing this API, EtherCAT communication will be disconnected automatically and reboot of all slave devices is required. Note: This API is only applicable to Delta R1-EC series remote modules.
  • Page 103 EtherCAT Master Configuration EtherCAT Programming Guide // Enabled the communication mode of user-defined alias Status = _ECAT_Master_NodeID_Alias_Enable (CardNo, Enable); // initialize EtherCAT communication Status = _ECAT_Master_Initial(CardNo); 5-16 March, 2017...
  • Page 104: Master Initialization

    Master Initialization This chapter provides detailed introduction on how to use the API for initializaing the EtherCAT master. Users have to execute the API mentioned here before applying the function of motion control and remote module in other chapters. 台...
  • Page 105 Initialize EtherCAT communication and switch the slave _ECAT_Master_Initial to OP mode Reset the EtherCAT master’s status and switch the slave _ECAT_Master_Reset to initial mode Disable all functions of EtherCAT master and kernels and...
  • Page 106: Ecat_Master_Open

    U16 PASCAL _ECAT_Master_Open(U16 *Cardnum)  Purpose This is for checking the number of motion cards and EtherCAT kernels, as well as creating memory block. Note: This is the most essential API for controlling Delta EtherCAT master. Please execute this API before starting using other functions.
  • Page 107: Ecat_Master_Initial

     Purpose This is for initialiaing EtherCAT communication and switching the slave to OP mode. Note: After using this API to do the initialization, please apply API “_ECAT_Master_Check_Initial_Done” (section 6.12) to check the status and wait for it to return “0”. Then, you can start using other functions.
  • Page 108: Ecat_Master_Reset

    EtherCAT Programming Guide Master Initialization 6.3 _ECAT_Master_Reset  Syntax U16 PASCAL _ECAT_Master_Reset(U16 CardNo)  Purpose This is for resetting the EtherCAT master’s status and switching the slave to initial mode.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 109: Ecat_Master_Close

    EtherCAT Programming Guide 6.4 _ECAT_Master_Close  Syntax U16 PASCAL _ECAT_Master_Close()  Purpose This is for disabling all functions of EtherCAT master and kernels and releasing the memory.  Example U16 Status; U16 CardNo=0; U16 Cardnum=0; Status = _ECAT_Master_Open(&Cardnum); for (U16 CardSeq = 0; CardSeq < Cardnum; CardSeq ++) Status = _ECAT_Master_Get_CardSeq (CardSeq, &CardNo);...
  • Page 110: Ecat_Master_Get_Cardseq

    After acquiring the quantity of EtherCAT master, you can get the number of EtherCAT master in sequence by the master sequence ID, which starts from 0. And the card No. of EtherCAT master is the number on the knob exactly. If you are using RTX version of Delta PAC, the master’s No. is always 16.
  • Page 111: Ecat_Master_Get_Slavenum

    Master Initialization EtherCAT Programming Guide 6.6 _ECAT_Master_Get_SlaveNum  Syntax U16 PASCAL _ECAT_Master_Get_SlaveNum(U16 CardNo, U16 *Slavenum)  Purpose This is for acquiring slave quantity on the communication bus of the specified EtherCAT master.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 112: Ecat_Master_Get_Slave_Info

    Delta products) is not supported by the master station, you should firstly obtain this slave module’s Vender ID, product code and revision No. Then, contact Delta and we will help you to solve the issue. To obtain the aforementioned information, please open the XML document of the slave module via text editor.
  • Page 113 Master Initialization EtherCAT Programming Guide Figure 6.7.1 Contents of XML document 6-10 March, 2017...
  • Page 114: Ecat_Master_Get_Dc_Status

    EtherCAT Programming Guide Master Initialization 6.8 _ECAT_Master_Get_DC_Status  Syntax U16 PASCAL _ECAT_Master_Get_DC_Status (U16 CardNo, U32 *State, I32 *Time, I32 *OffsetTime)  Purpose This is for acquiring the motion card's DC status, time and time offset.  Parameter Name Data type...
  • Page 115: Ecat_Master_Get_Connect_Status

    Master Initialization EtherCAT Programming Guide 6.9 _ECAT_Master_Get_Connect_Status  Syntax U16 PASCAL _ECAT_Master_Get_Connect_Status(U16 CardNo, U16 * MasterStatus)  Purpose This is for acquiring EtherCAT master’s connection status.  Parameter Name Data type Property Description CardNo Number Card No. Master’s current status...
  • Page 116: Ecat_Master_Get_Api_Bufferlength

    EtherCAT Programming Guide Master Initialization 6.10 _ECAT_Master_Get_Api_BufferLength  Syntax U16 PASCAL _ECAT_Master_Get_Api_BufferLength(U16 CardNo, U16 SlaveNo, U16 *BuffLength)  Purpose This is for acquiring the command amount of each slave that has not been completed.  Parameter Name Data type Property...
  • Page 117: Ecat_Master_Get_Cycle_Spendtime

    Master Initialization EtherCAT Programming Guide 6.11 _ECAT_Master_Get_Cycle_SpendTime  Syntax U16 PASCAL _ECAT_Master_Get_Cycle_SpendTime (U16 CardNo, F64 *Tx_Time, F64 *Tx_MaxTime, F64 *Rx_Time, F64 *Rx_MaxTime)  Purpose This is for acquiring the time spent on Tx and Rx every cycle and the maximum consuming time in the log.
  • Page 118: Ecat_Master_Check_Initial_Done

    EtherCAT Programming Guide Master Initialization 6.12 _ECAT_Master_Check_Initial_Done  Syntax U16 PASCAL _ECAT_Master_Check_Initial_Done(U16 CardNo, U16 *InitDone)  Purpose This is for checking whether the DLL initialization has been completed.  Parameter Name Data type Property Description CardNo Number Card No. 0: Completed...
  • Page 119: Ecat_Master_Get_Initial_Errorcode

    Master Initialization EtherCAT Programming Guide 6.13 _ECAT_Master_Get_Initial_ErrorCode  Syntax U16 PASCAL _ECAT_Master_Get_Initial_ErrorCode(U16 CardNo)  Purpose This is for acquiring the error code when error occurs (“_ECAT_Master_Check_Initial_Done” returns 99). Refer to Chapter 34 for more information about error code description. ...
  • Page 120: Ecat_Master_Check_Working_Counter

    EtherCAT Programming Guide Master Initialization 6.14 _ECAT_Master_Check_Working_Counter  Syntax U16 PASCAL _ECAT_Master_Check_Working_Counter(U16 CardNo, U16 *Abnormal_Flag, U16 *Working_Slave_Cnt)  Purpose This is for acquiring the current connection status of EtherCAT communication.  Parameter Name Data type Property Description CardNo Number (No.) Card No.
  • Page 121: Ecat_Master_Get_Return_Code_Message

    Master Initialization EtherCAT Programming Guide 6.15 _ECAT_Master_Get_Return_Code_Message  Syntax U16 PASCAL _ECAT_Master_Get_Return_Code_Message(U16 ReturnCode, I8 *Message);  Purpose This is for acquiring the corresponding message of each return code.  Parameter Name Data type Property Description ReturnCode Number Return code Message...
  • Page 122: Ethercat Coe Standard Communication

    EtherCAT CoE Standard Communication This chapter introduces the use of API for CoE (CANopen over EtherCAT) standard communication. EtherCAT protocol allows issuing SDO or PDO command to the Slave directly via CoE standard communication. 7.1 _ECAT_Slave_SDO_Send_Message ····················································· 7-3 7.2 _ECAT_Slave_SDO_Read_Message····················································· 7-4 7.3 _ECAT_Slave_SDO_Quick_Send_Message ···········································...
  • Page 123 Master sends a request. That is to say, SDO cannot issue the command frequently. However, users can read/write any OD that is not in PDO mapping table via SDO. API list of EtherCAT CoE standard communication Function name Description...
  • Page 124: Ecat_Slave_Sdo_Send_Message

    EtherCAT Programming Guide EtherCAT CoE Standard Communication 7.1 _ECAT_Slave_SDO_Send_Message  Syntax U16 PASCAL _ECAT_Slave_SDO_Send_Message(U16 CardNo, U16 NodeID, U16 SlotNo, U16 Index, U16 SubIndex, U16 DataSize, U8 *Data)  Purpose This is for issuing SDO command (CANopen) to the slave. ...
  • Page 125: Ecat_Slave_Sdo_Read_Message

    EtherCAT CoE Standard Communication EtherCAT Programming Guide 7.2 _ECAT_Slave_SDO_Read_Message  Syntax U16 PASCAL _ECAT_Slave_SDO_Read_Message(U16 CardNo, U16 NodeID, U16 SlotNo, U16 Index, U16 SubIndex, U16 DataSize, U8 *Data)  Purpose This is for acquiring the current SDO data (CANopen) of the slave.
  • Page 126: Ecat_Slave_Sdo_Quick_Send_Message

    EtherCAT Programming Guide EtherCAT CoE Standard Communication 7.3 _ECAT_Slave_SDO_Quick_Send_Message  Syntax U16 PASCAL _ECAT_Slave_SDO_Quick_Send_Message(U16 CardNo, U16 NodeID, U16 SlotNo, U16 Index, U16 SubIndex, U16 DataSize, U8 *Data)  Purpose This is for issuing SDO command (CANopen) to the slave without waiting for the response.
  • Page 127: Ecat_Slave_Sdo_Quick_Read_Message

    EtherCAT CoE Standard Communication EtherCAT Programming Guide 7.4 _ECAT_Slave_SDO_Quick_Read_Message  Syntax U16 PASCAL _ECAT_Slave_SDO_Quick_Read_Message(U16 CardNo, U16 NodeID, U16 SlotNo, U16 Index, U16 SubIndex, U16 DataSize)  Purpose This is for issuing SDO read command (CANopen) to the slave without waiting for the response.
  • Page 128: Ecat_Slave_Sdo_Read_Response

    EtherCAT Programming Guide EtherCAT CoE Standard Communication 7.5 _ECAT_Slave_SDO_Read_Response  Syntax U16 PASCAL _ECAT_Slave_SDO_Read_Response (U16 CardNo, U16 NodeID, U16 SlotNo, U16* Done, U8* Data, U32* ErrorCode)  Purpose This is for reading the returned data from the slave.  Parameter...
  • Page 129: Ecat_Slave_Sdo_Wait_All_Done

    EtherCAT CoE Standard Communication EtherCAT Programming Guide 7.6 _ECAT_Slave_SDO_Wait_All_Done  Syntax U16 PASCAL _ECAT_Slave_SDO_Wait_All_Done(U16 CardNo, U16 AxisNum, U16* NodeID, U16* SlotNo)  Purpose This is for waiting multiple slaves to complete all SDO commands.  Parameter Name Data type Property...
  • Page 130: Ecat_Slave_Sdo_Get_Errorcode

    EtherCAT Programming Guide EtherCAT CoE Standard Communication 7.7 _ECAT_Slave_SDO_Get_ErrorCode  Syntax U16 PASCAL _ECAT_Slave_SDO_Get_ErrorCode(U16 CardNo, U16 NodeID, U16 SlotNo, U32* ErrorCode)  Purpose Aquire the error code of ERR_ECAT_SDO_Return that returned during the execution of SDO Send_Message or Read_Message. Please refer to CANopen protocol or the definition of each device for error code.
  • Page 131 EtherCAT CoE Standard Communication EtherCAT Programming Guide List of error code Code Description 0x0503 0000 Toggle bit not alternated. 0x0504 0000 SDO protocol timed out 0x0504 0001 Client/server command specifier not valid or unknown. 0x0504 0002 Invalid block size 0x0504 0003...
  • Page 132: Ecat_Slave_Sdo_Check_Done

    EtherCAT Programming Guide EtherCAT CoE Standard Communication 7.8 _ECAT_Slave_SDO_Check_Done  Syntax U16 PASCAL _ECAT_Slave_SDO_Check_Done (U16 CardNo, U16 NodeID, U16 SlotNo, U16 *Done)  Purpose This is for checking if the specified slave has completed all the SDO commands.  Parameter...
  • Page 133 EtherCAT CoE Standard Communication EtherCAT Programming Guide 7.9 _ECAT_Slave_PDO_Get_OD_Data  Syntax U16 PASCAL _ECAT_Slave_PDO_Get_OD_Data (U16 CardNo, U16 NodeID, U16 SlotNo, U16 IOType, U16 ODIndex, U16 ODSubIndex, U16 ByteSize, U8 *Data)  Purpose This is for reading the data of an OD index in the PDO mapping. Before initializing the master, the OD code should be defined in PDO mapping table by EcNavi in advance.
  • Page 134 EtherCAT Programming Guide EtherCAT CoE Standard Communication 7.10 _ECAT_Slave_PDO_Set_OD_Data  Syntax U16 PASCAL _ECAT_Slave_PDO_Set_OD_Data (U16 CardNo, U16 NodeID, U16 SlotNo, U16 ODIndex, U16 ODSubIndex, U8 *Data)  Purpose This is for sending the data of an OD index in the PDO mapping. Before initializing the master, the OD code should be defined in PDO mapping table by EcNavi in advance.
  • Page 135: Ecat_Slave_Pdo_Get_Information

    EtherCAT CoE Standard Communication EtherCAT Programming Guide 7.11 _ECAT_Slave_PDO_Get_Information  Syntax U16 PASCAL _ECAT_Slave_PDO_Get_Information (U16 CardNo, U16 NodeID, U16 SlotNo, U16 IOType, U16 *ODCnt, U16 *StartIndex)  Purpose This is for acquiring the basic information of each slave device PDO.
  • Page 136 EtherCAT Programming Guide EtherCAT CoE Standard Communication 7.12 _ECAT_Slave_PDO_Get_Detail_Mapping  Syntax U16 PASCAL _ECAT_Slave_PDO_Get_Detail_Mapping (U16 CardNo, U16 NodeID, U16 SlotNo, U16 IOType, U16 ODSeqID, U16 *ODIndex, U16 *ODSubIndex, U16 *ODByteSize, U16 *ODStartIndex)  Purpose This is for acquiring the details of PDO mapping in the slave device.
  • Page 137: Ecat_Slave_Pdo_Get_Rx_Data

    EtherCAT CoE Standard Communication EtherCAT Programming Guide 7.13 _ECAT_Slave_PDO_Get_Rx_Data  Syntax U16 PASCAL _ECAT_Slave_PDO_Get_Rx_Data(U16 CardNo, BYTE *Data)  Purpose This is for acquiring all slave Rx data of the PDO mapping.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 138: Ecat_Slave_Pdo_Get_Tx_Data

    EtherCAT Programming Guide EtherCAT CoE Standard Communication 7.14 _ECAT_Slave_PDO_Get_Tx_Data  Syntax U16 PASCAL _ECAT_Slave_PDO_Get_Tx_Data(U16 CardNo, BYTE *Data)  Purpose This is for acquiring all slave Tx data of the PDO mapping.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 139: Ecat_Slave_Pdo_Set_Tx_Data

    EtherCAT CoE Standard Communication EtherCAT Programming Guide 7.15 _ECAT_Slave_PDO_Set_Tx_Data  Syntax U16 PASCAL _ECAT_Slave_PDO_Set_Tx_Data(U16 CardNo, BYTE *Data)  Purpose This is for configuring all slave Tx data of the PDO mapping.  Parameter Name Data type Property Description CardNo Number (No.) Card No.
  • Page 140: Ecat_Slave_Pdo_Set_Tx_Detail_Data

    EtherCAT Programming Guide EtherCAT CoE Standard Communication 7.16 _ECAT_Slave_PDO_Set_Tx_Detail_Data  Syntax U16 PASCAL _ECAT_Slave_PDO_Set_Tx_Detail_Data(U16 CardNo, U16 NodeID, U16 SlotNo, U16 ODStartIndex, U16 ByteSize, U8 *Data)  Purpose This is for configuring all the slave Tx data of the PDO mapping.
  • Page 141 EtherCAT CoE Standard Communication EtherCAT Programming Guide (This page is intentionally left blank.) 7-20 March, 2017...
  • Page 142: General Operation Of Motion Axis

    General Operation of Motion Axis This chapter presents the APIs for general operation of motion axis, which can be used to acquire system status or set the motion parameters/commands of motion axis. And Touch Probe setting is also included. 8.1 _ECAT_Slave_Motion_Set_Svon ······················································ 8-3 8.2 _ECAT_Slave_Motion_Ralm ····························································...
  • Page 143 General Operation of Motion Axis EtherCAT Programming Guide API list of general operation of motion axis Function name Description _ECAT_Slave_Motion_Set_Svon Set the servo to On/Off state. Reset the alarm of the axis. Before applying this _ECAT_Slave_Motion_Ralm command, please clear the alarm first. Otherwise, the alarm might occur again.
  • Page 144: Ecat_Slave_Motion_Set_Svon

    EtherCAT Programming Guide General Operation of Motion Axis 8.1 _ECAT_Slave_Motion_Set_Svon  Syntax U16 PASCAL _ECAT_Slave_Motion_Set_Svon(U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable)  Purpose This is for setting the servo to On/Off state.  Parameter Name Data type Property Description...
  • Page 145: Ecat_Slave_Motion_Ralm

    General Operation of Motion Axis EtherCAT Programming Guide 8.2 _ECAT_Slave_Motion_Ralm  Syntax U16 PASCAL _ECAT_Slave_Motion_Ralm(U16 CardNo, U16 AxisNo, U16 SlotNo)  Purpose This is for resetting the alarm of the axis. Before applying this command, please clear the alarm first. Otherwise, the alarm might occur again.
  • Page 146: Ecat_Slave_Motion_Sd_Stop

    EtherCAT Programming Guide General Operation of Motion Axis 8.3 _ECAT_Slave_Motion_Sd_Stop  Syntax U16 PASCAL _ECAT_Slave_Motion_Sd_Stop(U16 CardNo, U16 AxisNo, U16 SlotNo, F64 Tdec)  Purpose This is for setting the deceleration time for motor to decelerate to stop.  Parameter Name...
  • Page 147: Ecat_Slave_Motion_Emg_Stop

    General Operation of Motion Axis EtherCAT Programming Guide 8.4 _ECAT_Slave_Motion_Emg_Stop  Syntax U16 PASCAL _ECAT_Slave_Motion_Emg_Stop(U16 CardNo, U16 AxisNo, U16 SlotNo)  Purpose This is for emergency stop of the axis. The motor will stop with its maximum deceleration.  Parameter...
  • Page 148: Ecat_Slave_Motion_Set_Alm_Reaction

    EtherCAT Programming Guide General Operation of Motion Axis 8.5 _ECAT_Slave_Motion_Set_Alm_Reaction  Syntax U16 PASCAL _ECAT_Slave_Motion_Set_Alm_Reaction (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Fault_Type, U16 Waring_Type);  Purpose This is for setting the action when alarm occurs. Note: It is also applicable to group function (Please refer to Chapter 17).
  • Page 149: Ecat_Slave_Motion_Set_Position

    General Operation of Motion Axis EtherCAT Programming Guide 8.6 _ECAT_Slave_Motion_Set_Position  Syntax U16 PASCAL _ECAT_Slave_Motion_Set_Position(U16 CardNo, U16 AxisNo, U16 SlotNo,I32 NewPosition)  Purpose This is for specifying current feedback position of the axis. This will change the position data set in the servo drive or pulse module, which might also alter the machine’s coordinates.
  • Page 150: Ecat_Slave_Motion_Set_Command

    EtherCAT Programming Guide General Operation of Motion Axis 8.7 _ECAT_Slave_Motion_Set_Command  Syntax U16 PASCAL _ECAT_Slave_Motion_Set_Command(U16 CardNo, U16 AxisNo, U16 SlotNo, I32 NewCommand)  Purpose This is for setting the motion command data of the axis. The unit (property) of the data will vary with the applying motion mode.
  • Page 151: Ecat_Slave_Motion_Set_Movemode

    General Operation of Motion Axis EtherCAT Programming Guide 8.8 _ECAT_Slave_Motion_Set_MoveMode  Syntax U16 PASCAL _ECAT_Slave_Motion_Set_MoveMode(U16 CardNo, U16 AxisNo, U16 SlotNo, U16 MoveMode)  Purpose This is for setting the motion mode of the axis.  Parameter Name Data type Property...
  • Page 152: Ecat_Slave_Motion_Get_Movemode

    EtherCAT Programming Guide General Operation of Motion Axis 8.9 _ECAT_Slave_Motion_Get_MoveMode  Syntax U16 PASCAL _ECAT_Slave_Motion_Get_MoveMode (U16 CardNo , U16 AxisNo , U16 SlotNo, U8 *Mode)  Purpose This is for acquiring the information of current motion mode.  Parameter Name...
  • Page 153: Ecat_Slave_Motion_Get_Controlword

    General Operation of Motion Axis EtherCAT Programming Guide 8.10 _ECAT_Slave_Motion_Get_ControlWord  Syntax U16 PASCAL _ECAT_Slave_Motion_Get_ControlWord (U16 CardNo , U16 AxisNo, U16 SlotNo, U16 *ControlWord)  Purpose This is for acquiring the current control word of the axis.  Parameter Name...
  • Page 154 EtherCAT Programming Guide General Operation of Motion Axis Name Operation Mode Specific (Operation mode) Operation Mode Specific (Operation mode) Operation Mode Specific (Operation mode) Fault reset (Clear servo alarm) Halt 9 ~15 Operation Mode Specific represents by bit 4 ~ 6 are as follows. See the table below:...
  • Page 155: Ecat_Slave_Motion_Get_Statusword

    General Operation of Motion Axis EtherCAT Programming Guide 8.11 _ECAT_Slave_Motion_Get_StatusWord  Syntax U16 PASCAL _ECAT_Slave_Motion_Get_StatusWord (U16 CardNo ,U16 AxisNo ,U16 SlotNo , U16 * StatusWord)  Purpose This is for acquiring the current status word of the axis.  Parameter...
  • Page 156 EtherCAT Programming Guide General Operation of Motion Axis Name Fault (Servo error occurs; motor disabled) Voltage Enabled (Servo on) Quick Stop Switch On Disabled Warning Remote Target Reached (Target-reached signal) Internal Limit Active (internal software limit; not supported) Operation Mode Specific (Operation mode) Operation Mode Specific (Operation mode) Operation Mode Specific represents by bit 12 ~ 13 are as follows.
  • Page 157: Ecat_Slave_Motion_Get_Mdone

    General Operation of Motion Axis EtherCAT Programming Guide 8.12 _ECAT_Slave_Motion_Get_Mdone  Syntax U16 PASCAL _ECAT_Slave_Motion_Get_Mdone(U16 CardNo, U16 AxisNo, U16 SlotNo, U16 *Mdone)  Purpose This is for acquiring the current status of motion done.  Parameter Name Data type Property...
  • Page 158: Ecat_Slave_Motion_Get_Position

    EtherCAT Programming Guide General Operation of Motion Axis 8.13 _ECAT_Slave_Motion_Get_Position  Syntax U16 PASCAL _ECAT_Slave_Motion_Get_Position(U16 CardNo, U16 AxisNo, U16 SlotNo, I32 *Position)  Purpose This is for acquiring the current position of the axis. When applying the function of enabling virtual position (_ECAT_Slave_CSP_Virtual_Set_Enable) in section 9.29, users can acquire the master’s virtual position with this API.
  • Page 159: Ecat_Slave_Motion_Get_Command

    General Operation of Motion Axis EtherCAT Programming Guide 8.14 _ECAT_Slave_Motion_Get_Command  Syntax U16 PASCAL _ECAT_Slave_Motion_Get_Command (U16 CardNo, U16 AxisNo, U16 SlotNo, I32 *Command)  Purpose This is for acquiring the current command information. The data unit (property) will vary with the applying motion mode.
  • Page 160: Ecat_Slave_Motion_Get_Target_Command

    EtherCAT Programming Guide General Operation of Motion Axis 8.15 _ECAT_Slave_Motion_Get_Target_Command  Syntax U16 PASCAL _ECAT_Slave_Motion_Get_Target_Command (U16 CardNo, U16 AxisNo, U16 SlotNo, I32 *TargetPosition)  Purpose This is for acquiring the target command data of the axis.  Parameter Name Data type...
  • Page 161: Ecat_Slave_Motion_Get_Actual_Position

    General Operation of Motion Axis EtherCAT Programming Guide 8.16 _ECAT_Slave_Motion_Get_Actual_Position  Syntax U16 PASCAL _ECAT_Slave_Motion_Get_Actual_Position(U16 CardNo, U16 AxisNo, U16 SlotNo, I32* ActualPositon)  Purpose This is for acquiring the actual position command of the axis. When applying the function of enabling virtual position (_ECAT_Slave_CSP_Virtual_Set_Enable) in section 9.29, users should use this API to get motor’s actual feedback position.
  • Page 162: Ecat_Slave_Motion_Get_Actual_Command

    EtherCAT Programming Guide General Operation of Motion Axis 8.17 _ECAT_Slave_Motion_Get_Actual_Command  Syntax U16 PASCAL _ECAT_Slave_Motion_Get_Actual_Command(U16 CardNo, U16 AxisNo, U16 SlotNo,I32* ActualCommand)  Purpose This is for acquiring the current command data. The data will vary with to the applied motion mode.
  • Page 163: Ecat_Slave_Motion_Get_Current_Speed

    General Operation of Motion Axis EtherCAT Programming Guide 8.18 _ECAT_Slave_Motion_Get_Current_Speed  Syntax U16 PASCAL _ECAT_Slave_Motion_Get_Current_Speed(U16 CardNo, U16 AxisNo, U16 SlotNo, I32 *Speed)  Purpose This is for acquiring the current speed of the axis.  Parameter Name Data type Property...
  • Page 164: Ecat_Slave_Motion_Get_Torque

    EtherCAT Programming Guide General Operation of Motion Axis 8.19 _ECAT_Slave_Motion_Get_Torque  Syntax U16 PASCAL _ECAT_Slave_Motion_Get_Torque (U16 CardNo, U16 AxisNo, U16 SlotNo, I16 *Torque)  Purpose This is for acquiring the feedback torque from the motor.  Parameter Name Data type...
  • Page 165: Ecat_Slave_Motion_Get_Buffer_Length

    This is for acquiring the quantity of the commands that have not been carried out. EtherCAT master provides a buffer which can store 20 motion commands. When the current command has not been completely processed and the next motion command is received, the next command will be put in the buffer temporarily.
  • Page 166: Ecat_Slave_Motion_Set_Touchprobe_Config

    Please refer to the definition of Slave CANopen 60B8 TriggerMode Option bit1. 1. Please refer to Description below for Delta’s product. This parameter is to define the source trigger signal: 1. Please refer to the definition of Slave CANopen Signal_Source Option 60B8 bit2.
  • Page 167 Please check the user manual in advance. The following table illustrates the Touch Probe function and settings which defined in OD-60B8 by Delta ASDA A2-E and EtherCAT remote pulse module. Please note that this API does not support the second touch probe function (Touch Probe 2.)
  • Page 168 EtherCAT Programming Guide General Operation of Motion Axis Value Description (This API does not support Touch Probe function 2.) Stop capturing the pulse (position) when the trigger signal for Touch Probe 2 is rising-edge triggered. (This API does not support Touch Probe function 2.) Start capturing the pulse (position) when the trigger signal for Touch Probe 2 is rising-edge triggered.
  • Page 169: Ecat_Slave_Motion_Set_Touchprobe_Quickstart

    General Operation of Motion Axis EtherCAT Programming Guide 8.22 _ECAT_Slave_Motion_Set_TouchProbe_QuickStart  Syntax U16 PASCAL _ECAT_Slave_Motion_Set_TouchProbe_QuickStart(U16 CardNo, U16 AxisNo, U16 SlotNo)  Purpose This is for enabling the first Touch Probe function (Touch Probe 1). Use this API to set OD code –...
  • Page 170 EtherCAT Programming Guide General Operation of Motion Axis while (1) Status = _ECAT_Slave_Motion_Get_TouchProbe_Status(CardNo, AxisNo, SlotNo, & TouchProbe_Status); if (TouchProbe_Status & 0x2) Status = _ECAT_Slave_Motion_Get_TouchProbe_Position(CardNo, AxisNo, SlotNo, &LatchPosition); break;  Description Please refer to the following diagram (figure 8.22.1) when activating Touch Probe function.
  • Page 171: Ecat_Slave_Motion_Set_Touchprobe_Quickdone

    General Operation of Motion Axis EtherCAT Programming Guide Enable Touch Probe function 60B8 bit 0 Start Touch Probe function 60B8 bit 4 Start Touch Probe Start Touch Probe Function enabled status 60B9 bit 0 Status of triggering signal 60B9 bit 1...
  • Page 172 EtherCAT Programming Guide General Operation of Motion Axis  Example U16 Status, TouchProbe_Status; U16 CardNo=16,AxisNo=1,SlotNo=0; I32 LatchPosition = 0; U16 TriggerMode =0; // It records the pulse (position) when the signal is triggered for the first time. U16 Signal_Source=1; // Motor’s Z pulse is regarded as trigger signal of the first Touch Probe function.
  • Page 173: Ecat_Slave_Motion_Set_Touchprobe_Disable

    General Operation of Motion Axis EtherCAT Programming Guide 8.24 _ECAT_Slave_Motion_Set_TouchProbe_Disable  Syntax U16 PASCAL _ECAT_Slave_Motion_Set_TouchProbe_Disable(U16 CardNo, U16 AxisNo, U16 SlotNo)  Purpose This is for disabling the first Touch Probe function (Touch Probe 1). Use this API to set OD code – 60B8 bit 0 to 0 to disable the first Touch Probe function.
  • Page 174: Ecat_Slave_Motion_Get_Touchprobe_Status

    Please check the user manual in advance. The following table illustrates status of Touch Probe function defined by Delta ASDA A2-E and EtherCAT remote pulse module. (This API does not support the second Touch Probe function.)
  • Page 175 General Operation of Motion Axis EtherCAT Programming Guide CANopen-OD 60B9: Value Description Touch probe 1 is disabled Touch probe 1 is enabled The signal of Touch Probe 1 is not rising-edge triggered The signal of Touch Probe 1 has been rising-edge triggered...
  • Page 176: Ecat_Slave_Motion_Get_Touchprobe_Position

    This is for acquiring the current position of first Touch Probe function (Touch Probe 1). EtherCAT master reads the captured position from OD code - 60BA. It is suggested to save the captured position to PDO mapping table via EcNavi for quick access.
  • Page 177 General Operation of Motion Axis EtherCAT Programming Guide Status = _ECAT_Slave_Motion_Get_TouchProbe_Position(CardNo, AxisNo, SlotNo, &LatchPosition); 8-36 March, 2017...
  • Page 178: Cyclic Synchronous Position Mode (Csp)

    Cyclic Synchronous Position Mode (CSP) This chapter explains the APIs used in CSP mode. Different from PP mode, EtherCAT master issues one position command in each communication cycle. Thus, the motion path is controlled by EtherCAT master. CSP mode proveds single-axis motion, multi-axis interpolation and synchronous motion and advanced motion compensation.
  • Page 179 Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.29 _ECAT_Slave_CSP_Virtual_Set_Enable ············································· 9-52 9.30 _ECAT_Slave_CSP_Virtual_Set_Command ·········································· 9-53 9.31 _ECAT_Slave_CSP_Get_SoftLimit_Status ·········································· 9-54 9.32 _ECAT_Slave_CSP_Pitch_Set_Interval ·············································· 9-55 9.33 _ECAT_Slave_CSP_Pitch_Set_Mode ················································ 9-56 9.34 _ECAT_Slave_CSP_Pitch_Set_Org ··················································· 9-57 9.35 _ECAT_Slave_CSP_Pitch_Set_Rel_Table ·········································· 9-58 9.36 _ECAT_Slave_CSP_Pitch_Set_Abs_Table ·········································· 9-59 9.37 _ECAT_Slave_CSP_Pitch_Set_Enable ··············································...
  • Page 180 Cyclic Synchronous Position Mode (CSP) CSP (Cyclic Synchronous Position) mode uses PDO communication to issue position commands. EtherCAT master will calculate the position commands for the next communication cycle after analyzing the moving distance, speed and acceleration of the API. Then, it sends the new command to all motion axes in each communication cycle to achieve single-axis motion or multi-axis interpolation.
  • Page 181 Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide Function name Description When multi-axis command is being executed, this _ECAT_Slave_CSP_Mask_Axis API can be used to stop the specified axes without influencing others. Set the function of synchronous motion of multiple _ECAT_Slave_CSP_Sync_Config...
  • Page 182 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) 9.1 _ECAT_Slave_CSP_Start_Move  Syntax U16 PASCAL _ECAT_Slave_CSP_Start_Move(U16 CardNo, U16 AxisNo, U16 SlotNo, I32 Dist, I32 Strvel, I32 ConstVel, I32 EndVel, F64 TPhase1, F64 TPhase2, U16 Scurve, U16 Abs_Rel)  Purpose This is for executing linear interpolation of single axis.
  • Page 183 Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide  Description Linear interpolation of CSP command (acc/deceleration) (pps) Constant Velocity Start Velocity Velocity (sec) TPhase1 TPhase2 Figure 9.1.1 Perform lineter interpolation by referring to relative coordinates (T-curve) (pps) Constant Velocity Start...
  • Page 184 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) 9.2 _ECAT_Slave_CSP_Start_V_Move  Syntax U16 PASCAL _ECAT_Slave_CSP_Start_V_Move (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Dir, I32 Strvel, I32 MaxVel, F64 Tacc, U16 Scurve)  Purpose This is for executing the single-axis motion with constant speed.
  • Page 185: Ecat_Slave_Csp_Start_Arc_Move

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.3 _ECAT_Slave_CSP_Start_Arc_Move  Syntax U16 PASCAL _ECAT_Slave_CSP_Start_Arc_Move (U16 CardNo, U16 *AxisNo, U16 *SlotNo,I32 *CenterPoint, F64 Angle , I32 Strvel, I32 ConstVel, I32 EndVel, F64 TPhase1, F64 TPhase2, U16 Scurve, U16 Abs_Rel) ...
  • Page 186 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)  Description The specified angle of the arc can be over 360 degrees. Figure 9.3.1 The axis forms a specified angle from the current position and the given circle center Figure 9.3.2 Description of TPhase1 and TPhase2 (acc/deceleration) ...
  • Page 187: Ecat_Slave_Csp_Start_Arc2_Move

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.4 _ECAT_Slave_CSP_Start_Arc2_Move  Syntax U16 PASCAL _ECAT_Slave_CSP_Start_Arc2_Move(U16 CardNo, U16 *AxisNo, U16 *SlotNo,I32 *EndPoint, F64 Angle, I32 Strvel, I32 ConstVel, I32 EndVel, F64 TPhase1, F64 TPhase2, U16 Scurve, U16 Abs_Rel)  Purpose This is for executing two-axis arc motion, regarding the speicify angle from the current position as the included angle and moving to the specified end point.
  • Page 188 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)  Example U16 Status; U16 CardNo=0, AxisNoArray[2]={1,2}, SlotID[2]={0, 0}; I32 EndPoint [2]= {100000,100000}; F64 Angle=180, TPhase1=0.2, TPhase2=0.1; I32 StrVel=0, ConstVel =50000, EndVel=20000; U16 Scurve =0, Abs_Rel =0; Status = _ECAT_Slave_CSP_Start_Arc2_Move(CardNo, AxisNoArray, SlotID, EndPoint, Angle, Strvel, ConstVel, EndVel, TPhase1, TPhase2, Scurve, Abs_Rel);...
  • Page 189: Ecat_Slave_Csp_Start_Arc3_Move

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.5 _ECAT_Slave_CSP_Start_Arc3_Move  Syntax U16 PASCAL _ECAT_Slave_CSP_Start_Arc3_Move (U16 CardNo, U16 *AxisNo, U16 *SlotNo,I32 *CenterPoint, I32 *EndPoint, U16 Dir, I32 StrVel, I32 ConstVel, I32 EndVel, F64 TPhase1, F64 TPhase2, U16 Scurve, U16 Abs_Rel) ...
  • Page 190 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)  Example U16 Status, CardNo=0, AxisNoArray[2]={1,2}, SlotID[2]={0, 0}, Dir=1, Scurve =0, Abs_Rel =0; I32 CenterPoint[2] = {50000,50000}, EndPoint[2] ={10000,100000}; I32 StrVel=0, ConstVel =50000, EndVel=20000; F64 TPhase1=0.2, TPhase2=0.1; Status = _ECAT_Slave_CSP_Start_Arc3_Move(CardNo, AxisNoArray, SlotID, CenterPoint, EndPoint, Angle, Strvel, ConstVel, EndVel, TPhase1, TPhase2, Scurve, Abs_Rel);...
  • Page 191: Ecat_Slave_Csp_Start_Spiral_Move

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.6 _ECAT_Slave_CSP_Start_Spiral_Move  Syntax U16 PASCAL _ECAT_Slave_CSP_Start_Spiral_Move(U16 CardNo, U16 *AxisNo, U16 *SlotNo, I32 *CenterPoint, I32 Spiral_Interval, F64 Angle, I32 StrVel, I32 ConstVel, I32 EndVel, F64 TPhase1, F64 TPhase2, U16 Scurve, U16 Abs_Rel) ...
  • Page 192: Ecat_Slave_Csp_Start_Spiral2_Move

    EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)  Example U16 Status; U16 CardNo=0, AxisNo[2]={1,2}, SlotID[2]={0, 0}, Scurve =0, Abs_Rel =0; I32 CenterPoint[2] ={50000,50000}, Spiral_Interval = 5000; I32 StrVel=0, ConstVel =50000, EndVel=20000; F64 Angel, TPhase1 = 0.2, TPhase2 = 0.1;...
  • Page 193 Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide Name Data type Property Description ConstVel Pulse r / second Parameter of the motion constant speed EndVel Pulse / second Parameter of the motion end speed The time it takes to change from initial speed to...
  • Page 194: Ecat_Slave_Csp_Start_Sphere_Move

    EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) 9.8 _ECAT_Slave_CSP_Start_Sphere_Move  Syntax U16 PASCAL _ECAT_Slave_CSP_Start_Sphere_Move (U16 CardNo, U16 *AxisNo, U16 *SlotNo, I32 * Target1Point, I32 Target2Point, I32 StrVel, I32 ConstVel, I32 EndVel, F64 TPhase1, F64 TPhase2, U16 Scurve, U16 Abs_Rel) ...
  • Page 195: Ecat_Slave_Csp_Start_Heli_Move

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide  Example U16 Status, CardNo=0, AxisNo[2]={1,2}, SlotID[2]={0, 0}, Scurve =0, Abs_Rel =0; I32 Target1Point [2] ={25000,50000,20000}, Target2Point [2] ={95000,110000,60000}; I32 StrVel=0, ConstVel =50000, EndVel=20000; F64 TPhase1=0.2, TPhase2=0.1; Status = _ECAT_Slave_CSP_Start_Sphere_Move (CardNo, AxisNo, SlotID, Target1Point, Target2Point, StrVel, ConstVel, EndVel, TPhase1, TPhase2, Scurve, Abs_Rel);...
  • Page 196 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) Name Data type Property Description TPhase1 Time (second) The time is spend from initial speed to constant speed TPhase2 Time (second) This time is spend from constant speed to end speed 0: T-curve (Default)
  • Page 197: Ecat_Slave_Csp_Start_Multiaxes_Move

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.10 _ECAT_Slave_CSP_Start_Multiaxes_Move  Syntax U16 PASCAL _ECAT_Slave_CSP_Start_Multiaxes_Move (U16 CardNo, U16 AxisNum, U16 *AxisArray, U16 *SlotArray, I32 *DistArray, I32 Strvel, I32 ConstVel, I32 EndVel, F64 TPhase1, F64 TPhase2, U16 Scurve, U16 Abs_Rel) ...
  • Page 198: Ecat_Slave_Csp_Start_Msbrline_Move

    EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)  Example U16 Status, CardNo=0, AxisNum =2, AxisArray [2]={1,2}, SlotArray [2]={0, 0}; U16 Scurve =0, Abs_Rel =0; I32 DistArrary [2]= {100000,200000}, StrVel=0, ConstVel =50000, EndVel=20000; F64 TPhase1=0.2, TPhase2=0.1; Status = _ECAT_Slave_CSP_Start_Multiaxes_Move (CardNo, AxisNum, AxisArray, SlotArray, DistArrary, Strvel, ConstVel, EndVel, TPhase1, TPhase2, Scurve, Abs_Rel);...
  • Page 199 Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide Name Data type Property Description TargetPoint2. 16 Bits 0 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 Node ID Assuming that M1 is the path of arc motion executed by axis 1 and 2, and M2 is the parth executed by axis 3 and 4, then the parameter value should be 0x030C.
  • Page 200 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) Name Data type Property Description adjust the value to the valid range. Please refer to _ECAT_Slave_CSP_Speed_Continue_Set_Combine _ Ratio (section 9.19) for the description when the ratio is set to 100. If M1 is the path of linear motion, this value will be ignored.
  • Page 201 Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide  Example U16 Status; U16 CardNo=0, AxisNum =2, AxisArray [2]={1,2}, SlotArray [2]={0, 0}, ArcNodeBit = 0; U16 Mode =1, Scurve =0, Abs_Rel =0; I32 TargetPoint1 [2]= {100000,200000}, TargetPoint2 [2]= {100000,200000}; I32 StrVel=0, ConstVel =50000, EndVel=20000;...
  • Page 202: Ecat_Slave_Csp_Set_Gear

    EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) 9.12 _ECAT_Slave_CSP_Set_Gear  Syntax U16 PASCAL _ECAT_Slave_CSP_Set_Gear(U16 CardNo, U16 AxisNo, U16 SlotNo, I16 Nummerator, I16 Denominator, I16 Enable)  Purpose This is for setting the E-gear ratio.  Parameter Name Data type...
  • Page 203: Ecat_Slave_Csp_Set_Softlimit

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.13 _ECAT_Slave_CSP_Set_Softlimit  Syntax U16 PASCAL _ECAT_Slave_CSP_Set_Softlimit(U16 CardNo, U16 AxisNo, U16 SlotNo, I32 PosiLimit, I32 NegaLimit, U16 Mode)  Purpose This is for setting the software limit. Note: Function of software limit is only available in CSP mode.
  • Page 204: Ecat_Slave_Csp_Targetpos_Change

    EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) 9.14 _ECAT_Slave_CSP_TargetPos_Change  Syntax U16 PASCAL _ECAT_Slave_CSP_TargetPos_Change (U16 CardNo, U16 AxisNo, U16 SlotNo, I32 NewTargetCmd)  Purpose This is for replacing the target position. Note: This function is disabled during acceleration. ...
  • Page 205: Ecat_Slave_Csp_Velocity_Change

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.15 _ECAT_Slave_CSP_Velocity_Change  Syntax U16 PASCAL _ECAT_Slave_CSP_Velocity_Change (U16 CardNo, U16 AxisNo, U16 SlotNo, I32 NewTargetSpd, F64 Tsec)  Purpose This is for setting the new target speed of single axis. Note: This function is available when the current command running with constant speed.
  • Page 206: Ecat_Slave_Csp_Feedrate_Overwrite

    EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) 9.16 _ECAT_Slave_CSP_Feedrate_Overwrite  Syntax U16 PASCAL _ECAT_Slave_CSP_Feedrate_Overwrite (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Mode, I32 NewSpeed, F64 Tsec)  Purpose This is used for the advanced setting of speed change for single axis. Multiple modes are provided.
  • Page 207: Ecat_Slave_Csp_Feedrate_Overwrite

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide  Description Speed change function in mode 0 is identical to _ECAT_Slave_CSP_Velocity_Change. However, the change is valid only when the motion is at constant speed. Figure 9.16.1 Set Mode to 0 to change the constant speed In Mode 1, speed can be changed in any condition.
  • Page 208 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) When Mode = 1, the speed will be changed to 1500 ConstVel = 1500 ConstVel = 1500 ConstVel = 1200 ConstVel = 1100 ConstVel = 1000 StrVel *Starting from A, NewSpeed is set to 1500 so speed of current command or the ones issued later will all be 1500.
  • Page 209 Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide When Mode = 2, the speed ratio is ConstVel = 2400 changed to 200% ConstVel = 2200 ConstVel = 1200 ConstVel = 1100 ConstVel = 1000 StrVel *Starting from A, NewSpeed is set to 200 so speed of the current motion command and the ones issued later will be 200% (2 times) of the original speed.
  • Page 210: Ecat_Slave_Csp_Speed_Continue_Enable

    This is for enabling or disabling the continuous speed function. When this function is enabled, EtherCAT master will adjust the speed for all CSP motion commands of the specified axis. That is to say, the acceleration and deceleration of continuous commands will be adjusted by the ratio set in _ECAT_Slave_CSP_Speed_Continue_Set_Combine_Ratio.
  • Page 211: Ecat_Slave_Csp_Speed_Continue_Set_Mode

    Status = _ECAT_Slave_CSP_Speed_Continue_Set_Mode (CardNo, AxisNo, SlotNo, Mode);  Description When the user issues an invalid command, EtherCAT master will modify the command according to the set Mode. For example: The moving distance is set to 1000 mm, constant speed is 20000 mm/s and the acceleration and deceleration time are both 0.1 second.
  • Page 212 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) When Mode is set to 0: If the moving distance and acceleration slope remain unchanged, users have to modify the constant speed and acceleration/deceleration time. When Mode is set to 0, it will decrease the constant speed and acceleration /deceleration time in accordance with the proportion.
  • Page 213 Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide When Mode is set to 2: If the moving distance and constant speed remain unchanged, users have to modify the acceleration/deceleration time and slope. When Mode is set to 2, the constant speed will remain, but the acceleration/deceleration time will be altered according to the actual application.
  • Page 214: Ecat_Slave_Csp_Speed_Continue_Set_Combine_ Ratio

    EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) 9.19 _ECAT_Slave_CSP_Speed_Continue_Set_Combine_ Ratio  Syntax U16 PASCAL _ECAT_Slave_CSP_Speed_Continue_Set_Combine_Ratio (U16 CardNo , U16 AxisNo , U16 SlotNo , U16 Ratio)  Purpose This is for setting the percentage of for starting blending speed of two commands.
  • Page 215: Ecat_Slave_Csp_Scurve_Rate

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.20 _ECAT_Slave_CSP_Scurve_Rate  Syntax U16 PASCAL _ECAT_Slave_CSP_Scurve_Rate (U16 CardNo , U16 AxisNo , U16 SlotNo , U16 Ratio)  Purpose This is for setting the ratio of T-curve and S-curve during acceleration and deceleration.
  • Page 216: Ecat_Slave_Csp_Liner_Speed_Master

    EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)  Description Please refer to figure 9.20.1. When setting Ratio to 60, it means the T-curve ratio is 60%.The front part (20%) of the accerleration uses S-curve. The middle part (60%) applies T-curve for acceleration.
  • Page 217 Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide  Example U16 Status; U16 CardNo=16, AxisNo=1, SlotNo=0, Mode=1; Status = _ECAT_Slave_CSP_Liner_Speed_Master (CardNo, AxisNo, SlotNo, Mode);  Description Mode parameter setting: Figure 9.21.1 When Mode = 0, the command will change the resultant velocity of X and Y.
  • Page 218: Ecat_Slave_Csp_Mask_Axis

    EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) 9.22 _ECAT_Slave_CSP_Mask_Axis  Syntax U16 PASCAL _ECAT_Slave_CSP_Mask_Axis(U16 CardNo , U16 AxisNo , U16 SlotNo , U16 Mode)  Purpose When multi-axis motion command is being executed, this API can be used to stop the specified axes without influencing others.
  • Page 219: Ecat_Slave_Csp_Sync_Config

    Purpose This is for setting the function of synchronous motion of multiple axes. The function allows the EtherCAT master issue up to 20 CSP motion commands at the same time. Note: When some commands are issued to the the same axis, they will be executed according to the issuing sequence.
  • Page 220: Ecat_Slave_Csp_Sync_Move

    Purpose This is for enabling the function of synchronous motion of multiple axes. The function allows the EtherCAT master issue up to 20 CSP motion commands at the same time. Note: When some commands are issued to the the same axis, they will be executed by following the issuing sequence.
  • Page 221: Ecat_Slave_Csp_Start_Mabrline_Move

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.25 _ECAT_Slave_CSP_Start_Mabrline_Move  Syntax U16 PASCAL _ECAT_Slave_CSP_Start_Mabrline_Move (U16 CardNo, U16 AxisNum, U16 *AxisArray, U16 *SlotArray, I32 *Target1Point, I32 *Target2Point, I32 StrVel, I32 First_ConstVel, I32 Second_ConstVel, I32 EndVel, F64 Tacc_Step1, F64 Tacc_Step2,U16 Abs_Rel) ...
  • Page 222 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) Name Data type Property Description End point; the array number should equal to the axis number Array of pulse Target2Point[0] stores the first point of the first axis. Target2Point I32* for each axis...
  • Page 223: Ecat_Slave_Csp_Start_2Segment_Move

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.26 _ECAT_Slave_CSP_Start_2Segment_Move  Syntax U16 PASCAL _ECAT_Slave_CSP_Start_2Segment_Move(U16 CardNo, U16 AxisNo, U16 SlotNo, U16 SegMode, I32 Dist, I32 Dist2, I32 StrVel, I32 MaxVel, I32 MaxVel2, I32 EndVel, F64 Tacc, F64 Tsec, F64 Tdec, U16 Scurve, U16 Abs_Rel) ...
  • Page 224 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) U16 CardNo = 16, AxisNo=0, SlotNo=0, SegMode=0, Scurve=0, Abs_Rel=0; I32 Dist=0, Dist2=0, StrVel=0, MaxVel=0, MaxVel2=0, EndVel=0; F64 Tacc=0, Tsec=0, Tdec=0; Status = _ECAT_Slave_CSP_Start_2Segment_Move (CardNo, AxisNo, SlotNo, SegMode, Dist, Dist2, StrVel, MaxVel, MaxVel2, EndVel, Tacc, Tsec, Tdec, Scurve, Abs_Rel);...
  • Page 225: Ecat_Slave_Csp_Start_Pvt_Move

    This is for setting single-axis motion to move to multiple target points at fixed time. The axis will move to the target positions (Max.: 8000) within the set time. And EtherCAT master automatically calcaultes the acceleration and deceleration during operation.
  • Page 226 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)  Example U16 Status; U16 CardNo=16, NodeID=7, SlotID=0; I32 DataCnt=3, TargetPos[3]={0, 20000, 30000}, TargetTime[3]={0, 1000, 2000}, TargetVel[3]={0,11000, 0}; Status = _ECAT_Slave_CSP_Start_PVT_Move (CardNo, NodeID, SlotID, DataCnt, TargetPos, TargetTime, TargetVel); 9-49 March, 2017...
  • Page 227: Ecat_Slave_Csp_Start_Pvtcomplete_Move

    This API function is similar to _ECAT_Slave_CSP_Start_PVT_Move. Users can use this API to define the initial and end speed. And the axis will move to the target positions (Max.: 8000) within the set times. Its acceleration and deceleration are calculated by the EtherCAT master. ...
  • Page 228 EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)  Example U16 Status; U16 CardNo=16, NodeID=7, SlotID=0; I32 DataCnt=4, TargetPos[4]={0, 20000, 30000, 40000}, TargetTime[4]={0, 4000, 10000, 15000}, StrVel=10000, EndVel=0; Status = _ECAT_Slave_CSP_Start_PVTComplete_Move (CardNo, NodeID, SlotID, DataCnt, TargetPos, TargetTime, StrVel, EndVel); 9-51...
  • Page 229: Ecat_Slave_Csp_Virtual_Set_Enable

    _ECAT_Slave_Motion_Get_Position in section 8.5) will be changed to the vitual position from the motor’s feedback position. Since EtherCAT master will do the compensation for the specified axis, the motor’s feedback position will be slightly different from the machine’s actual position (virtual position) when applying the function of interval compensation and E-cam.
  • Page 230: Ecat_Slave_Csp_Virtual_Set_Command

    EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) 9.30 _ECAT_Slave_CSP_Virtual_Set_Command  Syntax U16 PASCAL _ECAT_Slave_CSP_Virtual_Set_Command(U16 CardNo, U16 AxisNo, U16 SlotNo, I32 Command)  Purpose This is for setting the virtual position and replacing the current position with the specified position.
  • Page 231: Ecat_Slave_Csp_Get_Softlimit_Status

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.31 _ECAT_Slave_CSP_Get_SoftLimit_Status  Syntax U16 PASCAL _ECAT_Slave_CSP_Get_SoftLimit_Status (U16 CardNo, U16 NodeID, U16 SlotNo, U16 *Status)  Purpose This is for acquiring the status of software limit.  Parameter Name Data type Property...
  • Page 232: Ecat_Slave_Csp_Pitch_Set_Interval

    U16 Slot No, I32 Interval)  Purpose This is for setting the interval of the pitch error compensation. EtherCAT master executes the position compensation with the set interval, so that the machine moves in the correct coordinates system.  Parameter...
  • Page 233: Ecat_Slave_Csp_Pitch_Set_Mode

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.33 _ECAT_Slave_CSP_Pitch_Set_Mode  Syntax U16 PASCAL _ECAT_Slave_CSP_Pitch_Set_Mode(U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Mode)  Purpose This is for setting the mode of pitch error compensation.  Parameter Name Data type Property...
  • Page 234: Ecat_Slave_Csp_Pitch_Set_Org

    U16 PASCAL _ECAT_Slave_CSP_Pitch_Set_Org(U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Dir, I32 OrgPos)  Purpose This is for setting the start position of pitch error compensation. EtherCAT master starts to do the compensation when it reaches the start position.  Parameter Name Data type...
  • Page 235: Ecat_Slave_Csp_Pitch_Set_Rel_Table

    Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide 9.35 _ECAT_Slave_CSP_Pitch_Set_Rel_Table  Syntax U16 PASCAL _ECAT_Slave_CSP_Pitch_Set_Rel_Table(U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Dir, I32* Table, U16 Num)  Purpose This is for setting the relative position of each interval for pitch error compensation.
  • Page 236: Ecat_Slave_Csp_Pitch_Set_Abs_Table

    EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP) 9.36 _ECAT_Slave_CSP_Pitch_Set_Abs_Table  Syntax U16 PASCAL _ECAT_Slave_CSP_Pitch_Set_Abs_Table(U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Dir, I32* Table, U16 Num)  Purpose This is for setting the absolute position of each interval for pitch error compensation.
  • Page 237: Ecat_Slave_Csp_Pitch_Set_Enable

    Purpose This is for enabling the pitch error compensation. EtherCAT master will carry out the compensation in accordance with the interval set by _ECAT_Slave_CSP_Pitch_Set_Interval (section 9.32) and the relative position set by _ECAT_Slave_CSP_Pitch_Set_Rel_Table (section 9.35) or the absolute position set by _ECAT_Slave_CSP_Pitch_Set_Abs_Table (section 9.36).
  • Page 238: Cyclic Synchronous Velocity Mode (Csv)

    This chapter introduces the application of APIs in CSV mode. Unlike PV mode, EtherCAT master issues one speed command every communication cycle in CSV mode. That is, the motion speed is controlled by EtherCAT master. And CSV mode also provides functions of single-axis and multi-axis motion control with the setting speed.
  • Page 239: Ecat_Slave_Csv_Start_Move

    In CSV (Cyclic Synchronous Velocity) mode, it issues the speed command via PDO communication. EtherCAT master will calculate all speed commands for the next communication cycle after analyzing the speed and acceleration set in the API. Then, it sends the new command to all motion axes every communication cycle so that single axis or multiple axes can operate with the setting speed.
  • Page 240: Ecat_Slave_Csv_Multi_Start_Move

    EtherCAT Programming Guide Cyclic Synchronous Velocity Mode (CSV) Name Data type Property Description Acceleration unit: Acc_Type Option 0: Second 1: inc/ s^2  Example U16 Status; U16 CardNo=16, AxisNo=1, SlotNo=0, Curve_Mode = 1, Acc_Type = 0; I32 Target_Velocity =600000; F64 Acceleration = 0.2;...
  • Page 241 Cyclic Synchronous Velocity Mode (CSV) EtherCAT Programming Guide Name Data type Property Description Array of time to reach the target speed (inc/s^2) second inc signifies the unit set in the device. . Please refer Acceleration F64* Inc / s^2 to the manual of the slave device for more details.
  • Page 242: Cyclic Synchronous Torque Mode (Cst)

    This chapter introduces the APIs in CST mode. Different from PT (Profile Torque) mode, EtherCAT master issues one torque command in each communication cycle in CST mode. That is, the torque of all axes is controlled by EtherCAT master. And CST mode also provides function of single-axis and multi-axis torque control.
  • Page 243: Ecat_Slave_Cst_Start_Move

    In CST (Cyclic Synchronous Torque) mode, it issues the torque command via PDO communication. EtherCAT master will calculate all torque commands for the next communication cycle after analyzing the speed and acceleration set in the API. Then, it sends the new command to all motion axes in each communication cycle so that single axis or multiple axes can operate with the setting torque.
  • Page 244: Ecat_Slave_Cst_Multi_Start_Move

    EtherCAT Programming Guide Cyclic Synchronous Torque Mode (CST) 11.2 _ECAT_Slave_CST_Multi_Start_Move  Syntax U16 PASCAL _ECAT_Slave_CST_Multi_Start_Move (U16 CardNo, U16 AxisNum, U16 *AxisNo, U16 *SlotNo, I16 * Target_Torque, U32 *Slope, U16 Curve_Mode)  Purpose This is for executing multi- axes synchronous motion with the setting torque.
  • Page 245 Cyclic Synchronous Torque Mode (CST) EtherCAT Programming Guide (This page is intentionally left blank.) 11-4 March, 2017...
  • Page 246: Homing

    Homing This chapter elaborates the APIs for single-axis homing with 35 modes available. The motion axis will start homing according to the received command set by users. 12.1 _ECAT_Slave_Home_Config ···························································· 12-3 12.2 _ECAT_Slave_Home_Move ···························································· 12-19 12.3 _ECAT_Slave_Home_Status ··························································· 12-20 12-1 March, 2017...
  • Page 247 Homing EtherCAT Programming Guide API list of homing Function name Description _ECAT_Slave_Home_Config Set the homing mode _ECAT_Slave_Home_Move Execute homing _ECAT_Slave_Home_Status Acquire the current homing status 12-2 March, 2017...
  • Page 248 EtherCAT Programming Guide Homing 12.1 _ECAT_Slave_Home_Config  Syntax U16 PASCAL _ECAT_Slave_Home_Config (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Mode,I32 Offset, U32 FirstVel, U32 SecondVel, U32 Acceleration)  Purpose This is for setting the homing mode. Executing this API will not start the homing procedure. To execute homing, use API “_ECAT_Slave_Home_Move”...
  • Page 249 Homing EtherCAT Programming Guide  Example U16 Status; U16 CardNo=16, AxisNo=1, SlotNo=0, Mode=1; I32 Offset=200; U32 FirstVel =600000, SecondVel =100000; U32 Acceleration = 3; /*Homing mode setting*/ Status = _ECAT_Slave_Home_Config (CardNo, AxisNo, SlotNo, Mode, Offset, FirstVel, SecondVel, Acceleration);  Description Mode 1 The motor runs in reverse direction at high speed until it reaches the negative limit.
  • Page 250 EtherCAT Programming Guide Homing Mode 2 The motor runs in forward direction at high speed and starts to decelerate once it reaches the positive limit. When the motor leaves the positive limit at low speed, it starts to look for the first Z pulse in reverse direction and regards the first Z pulse as the new homing origin.
  • Page 251 Homing EtherCAT Programming Guide Mode 4 Mode 4 is similar to Mode 3. The only difference is the moving direction after the motor detects that the home switch has changed its state. Home switch ON: The motor runs in reverse direction at low speed until it leaves the home switch.
  • Page 252 EtherCAT Programming Guide Homing Mode 5 Mode 5 is similar to similar to mode 3 but with different initial moving directions.  Home switch OFF: The motor runs in reverse direction at high speed until it reaches the home switch. Then, the motor decelerates in forward direction. When the motor leaves the switch at low speed and looks for the first Z pulse, it regards the first Z pulse as the new homing origin.
  • Page 253 Homing EtherCAT Programming Guide Mode 6 Mode 6 is similar to mode 4 but with different initial moving directions.  Home switch OFF: The motor runs in reverse direction at high speed until it reaches the home switch. Then, the motor runs at low speed, it starts to look for the first Z pulse and regards the first Z pulse as the new homing origin.
  • Page 254 EtherCAT Programming Guide Homing Mode 7  Home switch OFF: The motor runs in forward direction at high speed until it reaches the home switch. Then, it decelerates in reverse direction. When the motor leaves the home switch at low speed, it starts to look for the first Z pulse and regards the first Z pulse as the new homing origin.
  • Page 255 Homing EtherCAT Programming Guide Mode 8  Home switch OFF: The motor runs in forward direction at high speed until it reaches the home switch. Then, the motor runs at low speed, starting to look for the first Z pulse and regards it as the new homing origin.
  • Page 256 EtherCAT Programming Guide Homing Mode 9  Home switch OFF: The motor runs in forward direction at high speed until it reaches the home switch. Then, the motor decelerates and leaves the home switch at low speed. Afterwards, the motor runs in reverse direction. When the motor reaches the home switch again, it starts to look for the first Z pulse and regards the first Z pulse as the new homing origin.
  • Page 257 Homing EtherCAT Programming Guide 10. Mode 10  Home switch OFF: The motor runs in forward direction at high speed until it reaches the home switch. Then, it runs at low speed. When the motor leaves the home switch, it starts to look for the first Z pulse and regards the first Z pulse as the new homing origin.
  • Page 258 EtherCAT Programming Guide Homing 11. Mode 11  Home switch OFF: The motor runs in reverse direction at high speed until it reaches the home switch. Then, the motor decelerates and then run in forward direction. When the motor leaves the switch at low speed, it starts to look for the first Z pulse and regards the first Z pulse as the new homing origin.
  • Page 259 Homing EtherCAT Programming Guide 12. Mode 12  Home switch OFF: The motor runs in reverse direction at high speed until it reaches the home switch. Then, the motor runs at low speed, it starts to look for the first Z pulse and regards the first Z pulse as the new homing origin.
  • Page 260 EtherCAT Programming Guide Homing 13. Mode 13  Home switch OFF: The motor runs in reverse direction at high speed until it reaches the home switch. Then, the motor decelerates and leaves the switch at low speed. Afterwards, the motor runs in forward direction. When it reaches the home switch again, the motor starts to look for the first Z pulse and regards the first Z pulse as the new homing origin.
  • Page 261 Homing EtherCAT Programming Guide 14. Mode 14  Home switch OFF: The motor runs in reverse direction at high speed before it reaches the home switch. Then, the motor decelerates to low speed. When the motor leaves the home switch, it starts to look for the first Z pulse and regards the first Z pulse as the new homing origin.
  • Page 262 EtherCAT Programming Guide Homing 15. Mode 17 ~ 30 Mode 17 ~ 30 are similar to mode 1 ~ 14 with following differences: In mode 1 ~ 14, after receiving signals of the limits or home switch, the motor looks for Z pulse and regards the Z pulse as the new homing origin, whereas in mode 17 ~ 30, the motor regards the signals as the new homing origin.
  • Page 263 Homing EtherCAT Programming Guide 17. Mode 34 The motor runs in forward direction looking for the first Z pulse and regards it as the new homing origin. Homing origin Speed Motor Position H: High speed (The 1 speed) L: Low speed (The 2...
  • Page 264: Ecat_Slave_Home_Move

    EtherCAT Programming Guide Homing 12.2 _ECAT_Slave_Home_Move  Syntax U16 PASCAL _ECAT_Slave_Home_Move (U16 CardNo, U16 AxisNo, U16 SlotNo)  Purpose This is for executing homing. The specified motion axis will start homing according to the setting mode (section 12.1).  Parameter...
  • Page 265: Ecat_Slave_Home_Status

    Homing EtherCAT Programming Guide 12.3 _ECAT_Slave_Home_Status  Syntax U16 PASCAL _ECAT_Slave_Home_Status (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 *Status)  Purpose This is for acquiring the current homing status. Note: This API can only be used in homing mode. If it is used in other motion modes, the following returned code will prompt out: ERR_ECAT_MODE_NOT_SUPPORT (4612) ...
  • Page 266: Ecat_Slave_Pp_Start_Move

    Then, the motion axis will automatically complete those commands. Its motion will not be interfered by EtherCAT master unless it is a stop command. 13.1 _ECAT_Slave_PP_Start_Move ························································· 13-3 13.2 _ECAT_Slave_PP_Advance_Config ··················································...
  • Page 267 Commands will be issued via SDO communication in PP (Profile Position) mode. In this mode, EtherCAT master sends the position, speed and acceleration related parameters to the motion axis. When all commands are issued, the motion axis starts working and will be controlled by the servo drive and pulse module.
  • Page 268 EtherCAT Programming Guide Profile Position Mode (PP) 13.1 _ECAT_Slave_CST_Start_Move  Syntax U16 PASCAL _ECAT_Slave_PP_Start_Move(U16 CardNo, U16 AxisNo, U16 SlotNo, I32 TargetPos, U32 ConstVel, U32 Acceleration, U32 Deceleration, U16 Abs_Rel)  Purpose This is for executing single-axis linear motion in PP mode.
  • Page 269 Profile Position Mode (PP) EtherCAT Programming Guide Status = _ECAT_Slave_PP_Start_Move(CardNo, AxisNo, SlotNo, Dist, MaxVel, TAcc, TDec, Abs_Rel); 13.2 _ECAT_Slave_PP_Advance_Config  Syntax U16 PASCAL _ECAT_Slave_PP_Advance_Config(U16 CardNo, U16 AxisNo, U16 SlotNo,U16 SetBit, I32 End_Vel, I32 Min_Range_Limit, I32 Max_Range_Limit, I32 Min_Soft_Limit, I32 Max_Soft_Limit) ...
  • Page 270 EtherCAT Programming Guide Profile Position Mode (PP) Name Data type Property Description refer to the manual of the slave device for more details. (OD: 0x607D Sub 1) Set the maximum range for absolute movement inc signifies the unit set in the slave device. Please...
  • Page 271 Profile Position Mode (PP) EtherCAT Programming Guide (This page is intentionally left blank.) 13-6 March, 2017...
  • Page 272: Ecat_Slave_Pv_Start_Move

    PV mode. Then, the motion axis will automatically complete the motion and not be interfered by EtherCAT master during the process (except the stop command). Thus, it only issues the command for single-axis motion.
  • Page 273 Profile Velocity Mode (PV) EtherCAT Programming Guide Commands will be issued via SDO communication in PV (Profile Velocity) mode. EtherCAT master sends the speed and acceleration parameters to the motion axis. When all commands are issued, the motion axis starts working and will be controlled by the servo drive and pulse module.
  • Page 274 EtherCAT Programming Guide Profile Velocity Mode (PV) 14.1 _ECAT_Slave_PV_Start_Move  Syntax U16 PASCAL _ECAT_Slave_PV_Start_Move (U16 CardNo, U16 AxisNo, U16 SlotNo, I32 TargetVel, U32 Acceleration, U32 Deceleration)  Purpose This is for executing the single-axis motion with constant speed in PV mode.
  • Page 275 Profile Velocity Mode (PV) EtherCAT Programming Guide 14.2 _ECAT_Slave_PV_Advance_Config  Syntax U16 PASCAL _ECAT_Slave_PV_Advance_Config (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 SetBit, U16 Max_Torque, U16 Velocity_Window, U16 Velocity_Window_Time, U16 Velocity_Threshold, U16 Velocity_Threshold_Time)  Purpose This is for the advanced setting of PV mode.
  • Page 276 EtherCAT Programming Guide Profile Velocity Mode (PV) Name Data type Property Description Set the duration of non-zero speed (OD: 0x6070 Sub 0) Bit 12 of “ _ECAT_Slave_Motion_Get_StatusWord” will be Velocity_Threshold_Time Millisecond (ms) disabled when the motion speed reaches the value specified by Velocity_Threshold, and this speed has lasted longer than the time set by Velocity_Threshold_Time.
  • Page 277 Profile Velocity Mode (PV) EtherCAT Programming Guide (This page is intentionally left blank.) 14-6 March, 2017...
  • Page 278: Inverter Motion Control

    Inverter Motion Control This chapter presents the API for inverter motion control. Without encoder, the inverter cannot complete position feedback control. Thus, it only provides the information about single-axis constant speed control. 15.1 _ECAT_Slave_VL_Start_Move ························································· 15-2 15-1 March, 2017...
  • Page 279 15.1 _ECAT_Slave_VL_Start_Move  Syntax U16 PASCAL _ECAT_Slave_VL_Start_Move (U16 CardNo, U16 AxisNo, U16 SlotNo, I32 TargetVel, U32 Acceleration, U32 Deceleration)  Purpose This is for executing Delta inverter single-axis motion control with constant speed.  Parameter Name Data type Property Description...
  • Page 280 CST mode, all relevant commands will be issued to the motion axis at once in PT mode. Then, the motion axis will automatically complete the motion and not be interfered by EtherCAT master during the process (except the stop command). Thus, it only issues the command for single-axis motion.
  • Page 281 Profile Torque Mode (PT) EtherCAT Programming Guide Commands will be issued via SDO communication in PT (Profile Torque) mode. EtherCAT master sends the acceleration parameters to the motion axis. When all commands are issued, the motion axis starts working and will be controlled by the servo drive and pulse module.
  • Page 282: Ecat_Slave_Pt_Start_Move

    EtherCAT Programming Guide Profile Torque Mode (PT) 16.1 _ECAT_Slave_PT_Start_Move  Syntax U16 PASCAL _ECAT_Slave_PT_Start_Move (U16 CardNo, U16 AxisNo, U16 SlotNo, I16 Target_Torque, U32 Slope, I16 Torque_Profile)  Purpose This is for executing the single-axis motion with constant torque in PT mode.
  • Page 283 Profile Torque Mode (PT) EtherCAT Programming Guide 16.2 _ECAT_Slave_PT_Advance_Config  Syntax U16 PASCAL _ECAT_Slave_PT_Advance_Config (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 SetBit, U16 Max_Current, I16 Torque_Profile)  Purpose This is for the advanced setting of PT mode.  Parameter Name...
  • Page 284: Group Motion Control

    This chapter introduces the API for setting the specified groups. The grouped motion axes use two methods to carry out motion commands. In the first method, EtherCAT master completes the command of the group one after another to avoid motion commands being executed simultaneously.
  • Page 285 Group Motion Control EtherCAT Programming Guide List of Group Motion Control API Function name Description Set the group status. *Please note that before enabling the group, users should apply Set_Motion_Control_Type to specify _ECAT_Slave_User_Motion_Control_Set_Enable_ the axis for one group and use...
  • Page 286: Ecat_Slave_User_Motion_Control_Set _Enable_Mode

    // Enable the mode and set it to pause. Mode =2; Status =_ECAT_Slave_User_Motion_Control_Set_Enable_Mode (CardNo, GroupNo, Mode); // Input 100 data in advance. If the communication cycle of the EtherCAT master is 1 ms, it means these 100 data requires 100 ms to process. 17-3...
  • Page 287 // Carry on issuing rest of the motion commands. while (1) Status = _ECAT_Slave_User_Motion_Control_Get_DataCnt (CardNo, GroupNo, &Counter); if (Counter<100) // If you are using RTX version EtherCAT of Delta PAC, users can check up to 800 data. Status = _ECAT_Slave_User_Motion_Control_Set_Data (CardNo, GroupNo, DataArray); else if (Counter==0) Mode =0;...
  • Page 288: Ecat_Slave_User_Motion_Control_Get_Enable_Mode

    EtherCAT Programming Guide Group Motion Control 17.2 _ECAT_Slave_User_Motion_Control_Get_Enable_Mode  Syntax U16 PASCAL_ECAT_Slave_User_Motion_Control_Get_Enable_mode (U16 CardNo, U16 GroupNo, U16* Mode)  Purpose This is for acquiring the status of the current group.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 289: Ecat_Slave_User_Motion_Control_Set_Type

    1: User-defined path (CSP mode); When applying this mode, users have to defined the path for each axis in each EtherCAT communication cycle. 2: User-defined path (CSV mode); When applying this mode, users have to specify the speed for each axis in each EtherCAT communication cycle.
  • Page 290 When mode is set to 1 or 2, EtherCAT master will execute the CSP or CSV commands issued by users in sequence. If the current command of any one of the grouped axes is not completed and a new command is issued, the master will complete the current one first and then execute the new one.
  • Page 291: Ecat_Slave_User_Motion_Control_Set_Data

    Group Motion Control EtherCAT Programming Guide 17.4 _ECAT_Slave_User_Motion_Control_Set_Data  Syntax U16 PASCAL_ECAT_Slave_User_Motion_Control_Set_Data (U16 CardNo, U16 GroupNo, I32 *Data)  Purpose This is for inputting the absolute position data of each axis of each communication cycle in the specified group when mode is set to 0 in API “_ECAT_Slave_User_Motion_Control_Set_Type”...
  • Page 292: Ecat_Slave_User_Motion_Control_Clear_Data

    EtherCAT Programming Guide Group Motion Control 17.5 _ECAT_Slave_User_Motion_Control_Clear_Data  Syntax U16 PASCAL_ECAT_Slave_User_Motion_Control_Clear_Data (U16 CardNo, U16 GroupNo)  Purpose This is for clearing the data of each axis in the group that is specified by API “ _ECAT_Slave_User_Motion_Control_Set_Data” (section 17.4) when the mode is set to 0 in API “_ECAT_Slave_User_Motion_Control_Set_Type “...
  • Page 293: Ecat_Slave_User_Motion_Control_Get_Datacnt

    Group Motion Control EtherCAT Programming Guide 17.6 _ECAT_Slave_User_Motion_Control_Get_DataCnt  Syntax U16 PASCAL_ECAT_Slave_User_Motion_Control_Get_DataCnt (U16 CardNo, U16 GroupNo, U16* Counter)  Purpose This is for reading the data number that has not been processed in the specified group when mode is set to 0 in API “_ECAT_Slave_User_Motion_Control_Set_Type”.
  • Page 294: Ecat_Slave_User_Motion_Control_Ralm

    EtherCAT Programming Guide Group Motion Control 17.7 _ECAT_Slave_User_Motion_Control_Ralm  Syntax U16 PASCAL_ECAT_Slave_User_Motion_Control_Ralm (U16 CardNo, U16 GroupNo)  Purpose This is for resetting the alarm of all axes in the specified group.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 295: Ecat_Slave_User_Motion_Control_Svon

    Group Motion Control EtherCAT Programming Guide 17.8 _ECAT_Slave_User_Motion_Control_Svon  Syntax U16 PASCAL_ECAT_Slave_User_Motion_Control_Svon (U16 CardNo, U16 GroupNo, U16 ON_OFF)  Purpose This is for enabling/disabling all axes in the group. Except the API “_ECAT_Slave_User_Motion_Control_Set_Type” (see section 17.3), all axes of the group have to be enabled before use.
  • Page 296: Ecat_Slave_User_Motion_Control_Get_Alm

    EtherCAT Programming Guide Group Motion Control 17.9 _ECAT_Slave_User_Motion_Control_Get_Alm  Syntax U16 PASCAL_ECAT_Slave_User_Motion_Control_Get_Alm (U16 CardNo, U16 GroupNo, U16 *Alm)  Purpose This is for acquiring the current alarm status of the specified group.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 297 Group Motion Control EtherCAT Programming Guide (This page is intentionally left blank.) 17-14 March, 2017...
  • Page 298: Operation Of Di/Do Module

    This chapter introduces DI/DO API, including acquiring the state of DI/DO module and signal, DO settings and its output value when error occurs, etc. The APIs included in this chapter are applicable to all EtherCAT digital input/output modules. Please note that Delta DI/DO modules require to be enabled before being used;...
  • Page 299 _ECAT_Slave_DIO_Set_Single_Output_Value Set the output value of the specified channel Enable/Disable the retentive function of each _ECAT_Slave_DIO_Set_Output_Error_Mode channel on remote DO module when EtherCAT communication is disconnected Set the output status of each channel on remote DO _ECAT_Slave_DIO_Set_Output_Error_Value module when EtherCAT communication is...
  • Page 300: Ecat_Slave_Dio_Get_Input_Value

    EtherCAT Programming Guide Operation of DI/DO Module 18.1 _ECAT_Slave_DIO_Get_Input_Value  Syntax U16 PASCAL_ECAT_Slave_DIO_Get_Input_Value (U16 CardNo, U16 NodeID, U16 SlotNo, U16 *Value)  Purpose This is for acquiring the DI status of the DI module. To acquire the status of X15, X14, …, X1, X0 (from left to right), users can convert the value to binary format.
  • Page 301: Ecat_Slave_Dio_Get_Output_Value

    Operation of DI/DO Module EtherCAT Programming Guide 18.2 _ECAT_Slave_DIO_Get_Output_Value  Syntax U16 PASCAL_ECAT_Slave_DIO_Get_Output_Value (U16 CardNo, U16 NodeID, U16 SlotNo, U16 *Value)  Purpose This is for acquiring the DO status of the DO module. To acquire the status of Y15, Y14, …, Y1, Y0 (from left to right), users can convert the value to binary format.
  • Page 302: Ecat_Slave_Dio_Set_Output_Value

    This is for setting the output status of the DO module. To output the status of Y15, Y14, …, Y1, Y0 (from left to right), users can convert the bit status to decimal format. Note: To use this API with Delta’s remote DO module R1-EC70E2D0 and R1-EC70F2D0, please firstly execute the API “_ECAT_Slave_R1_EC70X2_Set_Output_Enable” (see section 32.1) to enable module’s output function.
  • Page 303: Ecat_Slave_Dio_Get_Single_Input_Value

    Operation of DI/DO Module EtherCAT Programming Guide 18.4 _ECAT_Slave_DIO_Get_Single_Input_Value  Syntax U16 PASCAL_ECAT_Slave_DIO_Get_Single_Input_Value (U16 CardNo, U16 NodeID, U16 SlotNo, U16 BitNum, U16 *Value)  Purpose This is for acquiring the input value of the specified channel.  Parameter Name Data type...
  • Page 304: Ecat_Slave_Dio_Get_Single_Output_Value

    EtherCAT Programming Guide Operation of DI/DO Module 18.5 _ECAT_Slave_DIO_Get_Single_Output_Value  Syntax U16 PASCAL_ECAT_Slave_DIO_Get_Single_Output_Value (U16 CardNo, U16 NodeID, U16 SlotNo, U16 BitNum, U16 *Value)  Purpose This is for acquiring the value output by the specified channel.  Parameter Name Data type...
  • Page 305: Ecat_Slave_Dio_Set_Single_Output_Value

    Operation of DI/DO Module EtherCAT Programming Guide 18.6 _ECAT_Slave_DIO_Set_Single_Output_Value  Syntax U16 PASCAL_ECAT_Slave_DIO_Set_Single_Ouput_Value (U16 CardNo, U16 NodeID, U16 SlotNo, U16 BitNum, U16 Value)  Purpose This is for setting the output value of the specified channel.  Parameter Name Data type...
  • Page 306: Ecat_Slave_Dio_Set_Output_Error_Mode

    U16 SlotNo, U16 BitMode)  Purpose This is for enabling/disabling the retentive function of each output channel on remote DO module when EtherCAT communication is disconnected. Note: Please use _ECAT_Slave_DIO_Set_Output_Error_Value (see section 18.8) to set the output value when EtherCAT communication is disconnected.
  • Page 307: Ecat_Slave_Dio_Set_Output_Error_Value

    U16SlotNo, U16 Value)  Purpose This is for setting the retentive status of each channel on remote DO module when EtherCAT communication is disconnected. Note: Please use _ECAT_Slave_DIO_Set_Output_Error_Mode (see section 18.7) to enable the retentive function when EtherCAT communication is disconnected.
  • Page 308: Operation Of Ai/Ao Module

    This chapter introduces the APIs for obtaining the input/output value and setting value of the AI/AO module. APIs included in this chapter are applicable to all EtherCAT analog input/output modules. Please note that Delta analog modules require to be enabled before being used.
  • Page 309 Operation of AI/AO Module EtherCAT Programming Guide API list of AI/AO module Function name Description _ECAT_Slave_AIO_Get_Input_Value Acquire analog input value _ECAT_Slave_AIO_Set_Output_Value Set analog output value _ECAT_Slave_AIO_Get_Output_Value Acquire analog output value 19-2 March, 2017...
  • Page 310: Ecat_Slave_Aio_Get_Input_Value

    To measure the input current, you need to modify the wriing of the analog input module first. (Please refer to the user manual of Delta analog input model regarding the wiring for current measurement.) After finishing the wiring, users can convert the measurement into current by using the circuit with 250Ω- resistor.
  • Page 311: Ecat_Slave_Aio_Set_Output_Value

    Operation of AI/AO Module EtherCAT Programming Guide 19.2 _ECAT_Slave_AIO_Set_Output_Value  Syntax U16 PASCAL_ECAT_Slave_AIO_Set_Output_Value (U16 CardNo, U16 NodeID, U16 SlotNo, U16 Value)  Purpose This is for setting analog output value, which range is 0 ~ 65535. The output value will be converted into value 0 ~ 65535 in accordance with the proportion. Then, this API will be controlling the analog output module.
  • Page 312: Ecat_Slave_Aio_Get_Output_Value

    EtherCAT Programming Guide Operation of AI/AO Module 19.3 _ECAT_Slave_AIO_Set_Output_Value  Syntax U16 PASCAL_ECAT_Slave_AIO_Get_Output_Value (U16 CardNo, U16 NodeID, U16 SlotNo, U16* Value)  Purpose This is for acquiring analog output value. The output value will be converted into value 0 ~ 65535 in accordance with the proportion. Then, this API will be controlling the analog output module.
  • Page 313 Operation of AI/AO Module EtherCAT Programming Guide (This page is intentionally left blank.) 19-6 March, 2017...
  • Page 314: Operation Of Pulse Module (For R1-Ec5621D0 Series)

    (for R1-EC5621D0 series). These APIs can set mode of pulse input/output, contact type of the origin signal/Z pulse signal, determine whether to apply the special mode when homing. If you are using Delta R1-X62XD0 series pulse module (multiple-axis), please refer to chapter 21 for the API usage. 台...
  • Page 315 Operation of Pulse Module (R1-EC5621D0) EtherCAT Programming Guide API list of pulse module operation (for R1-EC5621D0 series) Description _ECAT_Slave_R1_EC5621_Set_Output_Mode Set the mode of pulse output. _ECAT_Slave_R1_EC5621_Set_Input_Mode Set the mode of pulse input. Set the contact type (NC/NO) of the origin switch _ECAT_Slave_R1_EC5621_Set_ORG_Inverse (ORG).
  • Page 316: Ecat_Slave_R1_Ec5621_Set_Output_Mode

    EtherCAT Programming Guide Operation of Pulse Module (R1-EC5621D0) 20.1 _ECAT_Slave_R1_EC5621_Set_Output_Mode  Syntax U16 PASCAL _ECAT_Slave_R1_EC5621_Set_Output_Mode (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 RangeMode)  Purpose This is for setting the mode of pulse output.  Parameter Name Data type Property...
  • Page 317: Ecat_Slave_R1_Ec5621_Set_Input_Mode

    Operation of Pulse Module (R1-EC5621D0) EtherCAT Programming Guide 20.2 _ECAT_Slave_R1_EC5621_Set_Input_Mode  Syntax U16 PASCAL _ECAT_Slave_R1_EC5621_Set_Input_Mode (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 RangeMode)  Purpose This is for setting the mode of pulse input.  Parameter Name Data type Property...
  • Page 318: Ecat_Slave_R1_Ec5621_Set_Org_Inverse

    EtherCAT Programming Guide Operation of Pulse Module (R1-EC5621D0) 20.3 _ECAT_Slave_R1_EC5621_Set_ORG_Inverse  Syntax U16 PASCAL _ECAT_Slave_R1_EC5621_Set_ORG_Inverse (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable)  Purpose This is for setting the contact type (NC/NO) of the origin switch (ORG).  Parameter...
  • Page 319: Ecat_Slave_R1_Ec5621_Set_Qz_Inverse

    Operation of Pulse Module (R1-EC5621D0) EtherCAT Programming Guide 20.4 _ECAT_Slave_R1_EC5621_Set_QZ_Inverse  Syntax U16 PASCAL _ECAT_Slave_R1_EC5621_Set_QZ_Inverse (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable)  Purpose This is for setting the contact type (NC/NO) of encoder’s Z pulse (QZ).  Parameter...
  • Page 320: Ecat_Slave_R1_Ec5621_Set_Home_Spmode

    U16 PASCAL _ECAT_Slave_R1_EC5621_Set_Home_SpMode (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Mode)  Purpose This is for applying the special mode when homing. (For special applications only.) EtherCAT master will look for encoder’s Z pulse (QZ) at extremely low speed.)  Parameter...
  • Page 321: Ecat_Slave_R1_Ec5621_Set_Mel_Inverse

    Operation of Pulse Module (R1-EC5621D0) EtherCAT Programming Guide 20.6 _ECAT_Slave_R1_EC5621_Set_MEL_Inverse  Syntax U16 PASCAL _ECAT_Slave_R1_EC5621_Set_MEL_Inverse (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable)  Purpose This is for setting the contact type (NC/NO) of the negative limit switch (MEL).  Parameter...
  • Page 322: Ecat_Slave_R1_Ec5621_Set_Pel_Inverse

    EtherCAT Programming Guide Operation of Pulse Module (R1-EC5621D0) 20.7 _ECAT_Slave_R1_EC5621_Set_PEL_Inverse  Syntax U16 PASCAL _ECAT_Slave_R1_EC5621_Set_PEL_Inverse (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable)  Purpose This is for setting the contact type (NC/NO) of the positive limit switch (PEL).  Parameter...
  • Page 323: Ecat_Slave_R1_Ec5621_Set_Svon_Inverse

    Operation of Pulse Module (R1-EC5621D0) EtherCAT Programming Guide 20.8 _ECAT_Slave_R1_EC5621_Set_Svon_Inverse  Syntax U16 PASCAL _ECAT_Slave_R1_EC5621_Set_Svon_Inverse (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable)  Purpose This is for setting the contact type (NC/NO) of the servo enable switch (Svon).  Parameter...
  • Page 324: Ecat_Slave_R1_Ec5621_Set_Home _Slow_Down

    EtherCAT Programming Guide Operation of Pulse Module (R1-EC5621D0) 20.9 _ECAT_Slave_R1_EC5621_Set_Home _Slow_Down  Syntax U16 PASCAL _ECAT_Slave_R1_EC5621_Set_Home_Slow_Down (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable, U16 SlowDownTime, U16 WaitTime)  Purpose It sets the deceleration time after the motor reaches the origin: 1.
  • Page 325: Ecat_Slave_R1_Ec5621_Get_Io_Status

    Operation of Pulse Module (R1-EC5621D0) EtherCAT Programming Guide 20.10 _ECAT_Slave_R1_EC5621_Get_IO_Status  Syntax U16 PASCAL _ECAT_Slave_R1_EC5621_Get_IO_Status (U16 CardNo, U16 NodeID, U16 SlotNo, U16 *IOStatus)  Purpose This is for obtaining the status of all I/O points.  Parameter Name Data type...
  • Page 326: Ecat_Slave_R1_Ec5621_Get_Single_Io_Status

    EtherCAT Programming Guide Operation of Pulse Module (R1-EC5621D0) 20.11 _ECAT_Slave_R1_EC5621_Get_Single_IO_Status  Syntax U16 PASCAL _ECAT_Slave_R1_EC5621_Get_Single_IO_Status (U16 CardNo, U16 NodeID, U16 SlotNo, U16 BitNo, U16 *IOStatus)  Purpose This is for obtaining the status of single I/O point.  Parameter Name...
  • Page 327 Operation of Pulse Module (R1-EC5621D0) EtherCAT Programming Guide (This page is intentionally left blank.) 20-14 March, 2017...
  • Page 328: Operation Of Pulse Module (For R1-Ecx62Xd0 Series)

    Operation of Pulse Module (For R1-ECx62xD0 Series) This chapter provides the detailed information about how to use the APIs for operating the pulse type module (R1-ECx62xD0 series). These APIs can set the type of pulse input/output, contact type of the origin signal/Z pulse signal, and determine whether to apply the special mode when homing.
  • Page 329 Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide API list of pulse module operation (for R1-ECx62xD0 series) Description _ECAT_Slave_R1_ECx62x_Set_Output_Mode Set the type of pulse output _ECAT_Slave_R1_ECx62x_Set_Input_Mode Set the type of pulse input Set the contact type (NC/NO) of the origin switch...
  • Page 330: Ecat_Slave_R1_Ecx62X_Set_Output_Mode

    EtherCAT Programming Guide Operation of Pulse Module (R1-ECx62xD0 Series) 21.1 _ECAT_Slave_R1_ECx62x_Set_Output_Mode  Syntax U16 PASCAL _ECAT_Slave_R1_ECx62x_Set_Output_Mode (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Mode)  Purpose This is for setting the type of pulse output.  Parameter Name Data type...
  • Page 331: Ecat_Slave_R1_Ecx62X_Set_Input_Mode

    Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide 21.2 _ECAT_Slave_R1_ECx62x_Set_Input_Mode  Syntax U16 PASCAL _ECAT_Slave_R1_ECx62x_Set_Input_Mode (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 RangeMode)  Purpose This is for setting the type of pulse input.  Parameter Name Data type...
  • Page 332: Ecat_Slave_R1_Ecx62X_Set_Org_Inverse

    EtherCAT Programming Guide Operation of Pulse Module (R1-ECx62xD0 Series) 21.3 _ECAT_Slave_R1_ECx62x_Set_ORG_Inverse  Syntax U16 PASCAL _ECAT_Slave_R1_ECx62x_Set_ORG_Inverse (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable)  Purpose This is for setting the contact type (NC/NO) of the origin switch (ORG). ...
  • Page 333: Ecat_Slave_R1_Ecx62X_Set_Qz_Inverse

    Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide 21.4 _ECAT_Slave_R1_ECx62x_Set_QZ_Inverse  Syntax U16 PASCAL _ECAT_Slave_R1_ECx62x_Set_QZ_Inverse (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable)  Purpose This is for setting the contact type (NC/NO) of encoder's Z pulse signal (QZ).
  • Page 334: Ecat_Slave_R1_Ecx62X_Set_Home_Spmode

    U16 PASCAL _ECAT_Slave_R1_ECx62x_Set_Home_SpMode (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Mode)  Purpose This is for applying the special mode when homing. (For special applications only. EtherCAT master will look for encoder’s Z pulse (QZ) at extremely low speed.)  Parameter...
  • Page 335: Ecat_Slave_R1_Ecx62X_Set_Mel_Inverse

    Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide 21.6 _ECAT_Slave_R1_ECx62x_Set_MEL_Inverse  Syntax U16 PASCAL _ECAT_Slave_R1_ECx62x_Set_MEL_Inverse (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable)  Purpose This is for setting the contact type (NC/NO) of the negative limit switch (MEL).
  • Page 336: Ecat_Slave_R1_Ecx62X_Set_Pel_Inverse

    EtherCAT Programming Guide Operation of Pulse Module (R1-ECx62xD0 Series) 21.7 _ECAT_Slave_R1_ECx62x_Set_PEL_Inverse  Syntax U16 PASCAL _ECAT_Slave_R1_ECx62x_Set_PEL_Inverse (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable)  Purpose This is for setting the contact type (NC/NO) of the positive limit switch (PEL).
  • Page 337: Ecat_Slave_R1_Ecx62X_Set_Svon_Inverse

    Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide 21.8 _ECAT_Slave_R1_ECx62x_Set_Svon_Inverse  Syntax U16 PASCAL _ECAT_Slave_R1_ECx62x_Set_Svon_Inverse (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable)  Purpose This is for setting the contact type (NC/NO) of the servo enable switch (Svon).
  • Page 338: Ecat_Slave_R1_Ecx62X_Set_Home_Slow_Down

    EtherCAT Programming Guide Operation of Pulse Module (R1-ECx62xD0 Series) 21.9 _ECAT_Slave_R1_ECx62x_Set_Home_Slow_Down  Syntax U16 PASCAL _ECAT_Slave_R1_ECx62x_Set_Home_Slow_Down (U16 CardNo, U16 NodeID, U16 SlotNo, U16 Enable, U16 SlowDownTime, U16 WaitTime)  Purpose It sets the deceleration time after the motor reaches the origin: 1.
  • Page 339: Ecat_Slave_R1_Ecx62X_Get_Io_Status

    Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide 21.10 _ECAT_Slave_R1_ECx62x_Get_IO_Status  Syntax U16 PASCAL _ECAT_Slave_R1_ECx62x_Get_IO_Status (U16 CardNo, U16 NodeID, U16 SlotNo, U16 *IOStatus)  Purpose This is for acquiring all status of all I/O points.  Parameter Name Data type...
  • Page 340: Ecat_Slave_R1_Ecx62X_Get_Single_Io_Status

    EtherCAT Programming Guide Operation of Pulse Module (R1-ECx62xD0 Series) 21.11 _ECAT_Slave_R1_ECx62x_Get_Single_IO_Status  Syntax U16 PASCAL _ECAT_Slave_R1_ECx62x_Get_Single_IO_Status (U16 CardNo, U16 NodeID, U16 SlotNo, U16 BitNo, U16 *IOStatus)  Purpose This is for acquiring single status of single I/O point.  Parameter...
  • Page 341 Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide (This page is intentionally left blank.) 21-14 March, 2017...
  • Page 342: Operation Of Delta Servo System

    Operation of Delta Servo System This chapter will provide the information about how to use the APIs for operating Delta servo system. APIs for reading/writing servo parameters, setting servo maximum speed, reading/writing the compare parameters of the servo drive will be elaborated.
  • Page 343 _ECAT_Slave_DeltaServo_Set_Compare_Enable to Delta servo parameter P5-59 Read the pulse compare parameter that is written to _ECAT_Slave_DeltaServo_Get_Compare_Enable the servo drive, which is identical to Delta servo parameter P5-59 Write the data array number and values of the pulse _ECAT_Slave_DeltaServo_Set_Compare_Config compare function to Delta servo drives...
  • Page 344 EtherCAT Programming Guide Operation of Delta Servo System 22.1 _ECAT_Slave_DeltaServo_Write_Parameter  Syntax U16 PASCAL _ECAT_Slave_DeltaServo_Write_Parameter (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Page, U16 Index, I32 WriteData)  Purpose This is for writing servo parameter values to Delta servo drives ...
  • Page 345 Operation of Delta Servo System EtherCAT Programming Guide 22.2 _ECAT_Slave_DeltaServo_Read_Parameter  Syntax U16 PASCAL _ECAT_Slave_DeltaServo_Read_Parameter (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Page, U16 Index, I32* ReadData)  Purpose This is for reading servo parameter values from Delta servo drives ...
  • Page 346: Ecat_Slave_Deltaservo_Read_Parameter_Info

    EtherCAT Programming Guide Operation of Delta Servo System 22.3 _ECAT_Slave_DeltaServo_Read_Parameter_Info  Syntax U16 PASCAL _ECAT_Slave_DeltaServo_Read_Parameter_Info (U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Page, U16 Index, U16 *ParaType, U16 *DataSize, U16 *DataType)  Purpose This is for reading attributes of the servo parameter from Delta servo drives ...
  • Page 347: Ecat_Slave_Deltaservo_Set_Velocity_Limit

    Operation of Delta Servo System EtherCAT Programming Guide 22.4 _ECAT_Slave_DeltaServo_Set_Velocity_Limit  Syntax U16 PASCAL _ECAT_Slave_DeltaServo_Set_Velocity_Limit (U16 CardNo, U16 AxisNo, U16 SlotNo, U32 LimitValue)  Purpose This is for setting motor’s max. speed. Delta servo  Parameter Name Data type Property...
  • Page 348 Syntax U16 PASCAL _ECAT_Slave_DeltaServo_Set_Compare_Enable(U16 CardNo, U16 AxisNo, U16 SlotNo, U16 Enable, U16 CompareSource, U16 SignalLength, U16 SignalPolarity)  Purpose This is for writing the pulse compare parameter, which is identical to Delta servo parameter P5-59.  Parameter Name Data type...
  • Page 349 U16 PASCAL _ECAT_Slave_DeltaServo_Get_Compare_Enable(U16 CardNo, U16 AxisNo, U16 SlotNo, U16* Enable, U16* CompareSource, U16* SignalLength, U16* SignalPolarity)  Purpose This is for reading the pulse compare parameter that is written in the servo drive, which is identical to Delta servo parameter P5-59.  Parameter Name Data type...
  • Page 350: Ecat_Slave_Deltaservo_Set_Compare_Config

    Syntax U16 PASCAL _ECAT_Slave_DeltaServo_Set_Compare_Config(U16 CardNo, U16 AxisNo, U16 SlotNo, U16 CompareNum, I32* ComparePos)  Purpose This is for writing the data array number and values of the pulse compare function to the Delta servo drive.  Parameter Name Data type...
  • Page 351 Operation of Delta Servo System EtherCAT Programming Guide (This page is intentionally left blank.) 22-10 March, 2017...
  • Page 352: Analog Input Settings (For R1-Ec8124D0)

    Analog Input Settings (For R1-EC8124D0) This chapter introduces the APIs for analog input settings. Please note that these APIs are only applicable to Delta analog input modules. Information about general operation of analog input module can be found in chapter 19. 台...
  • Page 353 Analog Input Settings (For R1-EC8124D0) EtherCAT Programming Guide API of analog input settings (for R1-EC8124D0 series) Description Set the sampling range of Delta analog input _ECAT_Slave_R1_EC8124_Set_Input_RangeMode module Set the sampling rate of Delta analog input _ECAT_Slave_R1_EC8124_Set_Input_ConvstFreq_Mode module Enable/Disable the analog input sampling...
  • Page 354: Ecat_Slave_R1_Ec8124_Set_Input _Rangemode

    To measure the input current, you need to modify the wriing of the analog input module first. (Please refer to the user manual of Delta analog input model regarding the wiring for current measurement.) After finishing the wiring, users can convert the measurement into current by using the circuit with 250Ω- resistor.
  • Page 355: Ecat_Slave_R1_Ec8124_Set_Input _Convstfreq_Mode

    EtherCAT Programming Guide 23.2 _ECAT_Slave_R1_EC8124_Set_Input_ConvstFreq_Mode  Syntax U16 PASCAL _ECAT_Slave_R1_EC8124_Set_Input_ConvstFreq_Mode (U16 CardNo, U16 NodeID, U16 SlotNo, U16 RangeMode)  Purpose This is for setting the sampling rate of Delta analog input module.  Parameter Name Data type Property Description CardNo...
  • Page 356 U16 PASCAL _ECAT_Slave_R1_EC8124_Set_Input_Enable (U16 CardNo, U16 NodeID, U16 SlotNo, U16 Enable)  Purpose This is for enabling/disabling the analog input sampling function of Delta analog input module. This API has to be executed before measuring or acquiring the input value.  Parameter Name...
  • Page 357: Ecat_Slave_R1_Ec8124_Get_Input _Rangemode

    To measure the input current, you need to modify the wiring of the analog input module first. (Please refer to the user manual of Delta analog input model regarding the wiring for current measurement.) After finishing the wiring, users can convert the measurement into current by using the circuit with 250Ω- resistor.
  • Page 358 U16 SlotNo, U16 Avg_Times)  Purpose This is for setting the average times of the analog input signal filter of Delta analog input module. EtherCAT Master will average out the current value from 1 to127 data based on the setting count.
  • Page 359 Analog Input Settings (For R1-EC8124D0) EtherCAT Programming Guide (This page is intentionally left blank.) 23-8 March, 2017...
  • Page 360: Analog Output Settings (For R1-Ec9144D0 Series)

    This chapter introduces the APIs for analog output settings of Delta modules (R1-EC9144D0). Please note that these APIs are only applicable to Delta modules. General function for analog output operation of Delta modules can be found in chapter 台 24.1 _ECAT_Slave_R1_EC9144_Set_Output _RangeMode ·························· 24-3 24.2 _ECAT_Slave_R1_EC9144_Set_Output_Enable ··································...
  • Page 361 Analog Output Settings (R1-EC9144) EtherCAT Programming Guide API list of analog output settings (for R1-EC9144D0 series) Description Set the output range of Delta analog output _ECAT_Slave_R1_EC9144_Set_Output _RangeMode module Enable/Disable the analog output of Delta _ECAT_Slave_R1_EC9144_Set_Output _Enable module Acquire the operation status of Delta analog...
  • Page 362 Analog Output Settings (R1-EC9144) 24.1 _ECAT_Slave_R1_EC9144_Set_Output _RangeMode  Syntax U16 PASCAL _ECAT_Slave_R1_EC9144_Set_Output_RangeMode(U16 CardNo, U16 NodeID, U16 SlotNo, U16 RangeMode)  Purpose This is for setting the output range of Delta analog output module.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 363: Ecat_Slave_R1_Ec9144_Set_Output_Enable

    Analog Output Settings (R1-EC9144) EtherCAT Programming Guide 24.2 _ECAT_Slave_R1_EC9144_Set_Output_Enable  Syntax U16 PASCAL _ECAT_Slave_R1_EC9144_Set_Output_Enable(U16 CardNo, U16 NodeID, U16 SlotNo, U16 Enable)  Purpose This is for enabling/disabling the analog output of Delta module.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 364: Ecat_Slave_R1_Ec9144_Get_Output _Returncode

    Analog Output Settings (R1-EC9144) 24.3 _ECAT_Slave_R1_EC9144_Get_Output _ReturnCode  Syntax U16 PASCAL _ECAT_Slave_R1_EC9144_Get_Output_ReturnCode (U16 CardNo, U16 NodeID, U16 SlotNo, U16 *ReturnCode)  Purpose This is for aquiring the operation status of Delta analog output module.  Parameter Name Data type Property Description CardNo...
  • Page 365 Analog Output Settings (R1-EC9144) EtherCAT Programming Guide List of _ECAT_Slave_AIO_Get_Output_ReturnCode Description Iout_3 error: This bit is set if an error is detected on current output channel 3. Iout_2 error: This bit is set if an error is detected on current output channel 2.
  • Page 366 EtherCAT system’s kernel will automatically save the relvevant data of the servo motion axis every communication cycle. Up to 800 data can be saved in kernel of PAC RTX version and up to 200 data in kernel of EtherCAT motion card version.
  • Page 367 Auto Recording Function of Motion Axis EtherCAT Programming Guide API list of auto recording function for motion axis Description _ECAT_Slave_Record_Data_Set_Type Set the recording data type of specified axis _ECAT_Slave_Record_Data_Set_Enable Enable/Disable the recording function of specified axis _ECAT_Slave_Record_Data_Get_Cnt Acquire the data entry number of specified axis...
  • Page 368: Ecat_Slave_Record_Set_Type

    U16 SlotNo, U16 MonitorIndex, U16 IOType, U16 Index, U16 SubIndex)  Purpose Set the recording data type of axis. specified EtherCAT master saves one data in each communication cycle. Each slave can save 8 different OD codes.  Parameter Name Data type...
  • Page 369: Ecat_Slave_Record_Set_Enable

    Auto Recording Function of Motion Axis EtherCAT Programming Guide 25.2 _ECAT_Slave_Record_Set_Enable  Syntax U16 PASCAL _ECAT_Slave_Record_Set_Enable (U16 CardNo, U16 NodeID, U16 SlotNo, U16 Enable)  Purpose Enable/Disable the recording function of axis. specified  Parameter Name Data type Property Description...
  • Page 370: Ecat_Slave_Record_Get_Cnt

    Note: It can save 800 data in PAC RTX version and 200 data in EtherCAT motion card. Users can use this API to check the buffer zone status. Then, use the API in 25.4 to access the data and save it to another space.
  • Page 371: Ecat_Slave_Record_Read_Data

    Note: It can save 800 data in PAC RTX version and 200 data in EtherCAT motion card. Users can use ththe API in section 25.3 to check the buffer zone status. When accessing one data by this API, the acquired data numbers will reduce 1 automatically.
  • Page 372: Ecat_Slave_Record_Clear_Data

    EtherCAT Programming Guide Auto Recording Function of Motion Axis Status= _ECAT_Slave_Record_Read_Data (CardNo, NodeID, SlotNo, Data); 25.5 _ECAT_Slave_Record_Clear_Data  Syntax U16 PASCAL _ECAT_Slave_Record_Clear_Data (U16 CardNo, U16 NodeID, U16 SlotNo)  Purpose Delete the saved record of the specified axis.  Parameter...
  • Page 373: Ecat_Slave_Record_Multi_Set_Enable

    Auto Recording Function of Motion Axis EtherCAT Programming Guide 25.6 _ECAT_Slave_Record_Multi_Set_Enable  Syntax U16 PASCAL _ECAT_Slave_Record_Multi_Set_Enable (U16 CardNo, U16 NodeNum, U16 *NodeIDArray, U16 *SlotIDArray, U16 Enable)  Purpose Enable/Disable the recoding function of multiple axes. specified  Parameter Name Data type...
  • Page 374: Ecat_Slave_Record_Multi_Clear_Data

    EtherCAT Programming Guide Auto Recording Function of Motion Axis 25.7 _ECAT_Slave_Record_Multi_Clear_Data  Syntax U16 PASCAL _ECAT_Slave_Record_Multi_Clear_Data (U16 CardNo, U16 NodeNum, U16 *NodeIDArray, U16 *SlotIDArray)  Purpose Delete the saved record of multiple axes. specified  Parameter Name Data type Property...
  • Page 375 Auto Recording Function of Motion Axis EtherCAT Programming Guide (This page is intentionally left blank.) 25-10 March, 2017...
  • Page 376 Operaion of Local Digital I/O This chaper introduces the APIs of the built-in local digital I/O, such as setting and reading the input and output status of GPIO (General-purpose input/output) on the motion card. 台 26.1 _ECAT_GPIO_Set_Output ······························································· 26-3 26.2 _ECAT_GPIO_Get_Output ······························································ 26-4 26.3 _ECAT_GPIO_Get_Input ·································································...
  • Page 377: Operation Of Local Digital I/O

    Operation of Local Digital I/O EtherCAT Programming Guide API List of operating local digital I/O Description _ECAT_GPIO_Set_Output Control the output status of the GPIO on the motion card _ECAT_GPIO_Get_Output Read the output status of the GPIO on the motion card...
  • Page 378: Ecat_Gpio_Set_Output

    EtherCAT Programming Guide Operation of Local Digital I/O 26.1 _ECAT_GPIO_Set_Output  Syntax U16 PASCAL _ECAT_GPIO_Set_Output (U16 CardNo, U16 Data)  Purpose This is for controling the output status of the GPIO (General-purpose input/output) on the motion card. To set the output status of bit 15, bit 14, …, bit 0, users can convert the value to decimal format (from left to right).
  • Page 379: Ecat_Gpio_Get_Output

    Operation of Local Digital I/O EtherCAT Programming Guide 26.2 _ECAT_GPIO_Get_Output  Syntax U16 PASCAL _ECAT_GPIO_Get_Output (U16 CardNo, U16* Data)  Purpose This is for reading the output status of the GPIO on the motion card. To get the output status of bit 15, bit 14, …, bit 0, users can convert the value to binary format (from left to right).
  • Page 380: Ecat_Gpio_Get_Input

    EtherCAT Programming Guide Operation of Local Digital I/O 26.3 _ECAT_GPIO_Get_Input  Syntax U16 PASCAL _ECAT_GPIO_Get_Input (U16 CardNo, U16* Data)  Purpose This is for reading the input status of the GPIO (General-purpose input/output) on the motion card. To get the input status of bit 15, bit 14, …, bit 0, users can convert the value to binary format (from left to right).
  • Page 381 Operation of Local Digital I/O EtherCAT Programming Guide (This page is intentionally left blank.) 26-6 March, 2017...
  • Page 382: High-Speed Pulse Compare Function

    High-Speed Pulse Compare Function This chapter introduces the APIs for high speed pulse compare of motion cards. With the pulse input interface, FPGA real-time compare function of the motion card can be carried out. It can compare the pulse number and simultaneously ouput the differential signal to control the camera.
  • Page 383 High Speed Pulse Compare Function EtherCAT Programming Guide All advanced type motion cards of Delta provide high speed pulse compare function. As soon as the pulse compare function is carried out, it sends a differential signal for triggering the camera to take photos.
  • Page 384 EtherCAT Programming Guide High Speed Pulse Compare Function API list of high speed pulse compare function Description Overwrite a position value for the specified _ECAT_Compare_Set_Channel_Position channel Acquire the current position value of the _ECAT_Compare_Get_Channel_Position specified channel Set the mode of pulse input for the specified...
  • Page 385: Ecat_Compare_Set_Channel_Position

    High Speed Pulse Compare Function EtherCAT Programming Guide 27.1 _ECAT_Compare_Set_Channel_Position  Syntax U16 PASCAL _ECAT_Compare_Set_Channel_Position(U16 CardNo, U16 CompareChannel, I32 Position)  Purpose Overwrite a new position value (pulse) for the specified channel.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 386: Ecat_Compare_Get_Channel_Position

    EtherCAT Programming Guide High Speed Pulse Compare Function 27.2 _ECAT_Compare_Get_Channel_Position  Syntax U16 PASCAL _ECAT_Compare_Get_Channel_Position (U16 CardNo, U16 compare_Channel, I32 *position)  Purpose Acquire the current position value (pulse) of the specified channel.  Parameter Name Data type Property Description...
  • Page 387: Ecat_Compare_Set_Ipulser_Mode

    High Speed Pulse Compare Function EtherCAT Programming Guide 27.3 _ECAT_Compare_Set_Ipulser_Mode  Syntax U16 PASCAL _ECAT _Compare_Set _Ipulser_Mode (U16 CardNo, U16 mode)  Purpose Set the mode of pulse input for the specified channel. There are two modes available, AB phase or CW/CCW.
  • Page 388: Ecat_Compare_Set_Channel_Direction

    EtherCAT Programming Guide High Speed Pulse Compare Function 27.4 _ECAT_Compare_Set_Channel_Direction  Syntax U16 PASCAL _ECAT _Compare_Set _Channel_Direction (U16 CardNo, U16 compare_channel, U16 dir)  Purpose Set the pulse direction of the specified channel. With this API, modifying the wiring will not be required if pulse direction has to be alternated ...
  • Page 389: Ecat_Compare_Set_Channel_Trigger_Time

    High Speed Pulse Compare Function EtherCAT Programming Guide 27.5 _ECAT_Compare_Set_Channel_Trigger_Time  Syntax U16 PASCAL _ECAT _Compare_Set _Channel_Trigger_Time (U16 CardNo, U16 compare_channel, U32 time_us)  Purpose Set the trigger retainining time for the specified channel. Note: When carrying out compare function with channel 0, the minimum trigger time is set to 1 us. If 0 is input, it displays 0.8 us.
  • Page 390: Ecat_Compare_Set_Channel_One_Shot

    EtherCAT Programming Guide High Speed Pulse Compare Function 27.6 _ECAT_Compare_Set_Channel_One_Shot  Syntax U16 PASCAL _ECAT_Compare_Set_Channel_One_Shot (U16 CardNo, U16 compare_channel)  Purpose Allow the trigger of the specified channel to generate one trigger signal.  Parameter Name Data type Property Description...
  • Page 391: Ecat_Compare_Set_Channel_Source

    High Speed Pulse Compare Function EtherCAT Programming Guide 27.7 _ECAT_Compare_Set_Channel_Source  Syntax U16 PASCAL _ECAT_Compare_Set _Channel_Source (U16 CardNo, U16 compare_channel, U16 source)  Purpose Set the compare source for the specified channel.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 392: Ecat_Compare_Set_Channel_Enable

    EtherCAT Programming Guide High Speed Pulse Compare Function 27.8 _ECAT_Compare_Set_Channel_Enable  Syntax U16 PASCAL _ECAT_Compare_Set _Channel_Enable (U16 CardNo, U16 compare_channel,U16 enable)  Purpose Enable/disable the high speed compare function of the specified channel. Note: Channel 0 can only be enabled/disabled with this API.
  • Page 393: Ecat_Compare_Channel0_Position

    High Speed Pulse Compare Function EtherCAT Programming Guide 27.9 _ECAT_Compare_Channel0_Position  Syntax U16 PASCAL _ECAT_Compare_Channel0_Position(U16 CardNo, I32 Start, U16 Dir, U16 Interval, U32 TriggerCount);  Purpose Set the parameters for triggering the signal at a fixed pulse interval of channel 0.
  • Page 394: Ecat_Compare_Set_Channel0_Trigger _By_Gpio

    EtherCAT Programming Guide High Speed Pulse Compare Function 27.10 _ECAT_Compare_Set_Channel0_Trigger _By_GPIO  Syntax U16 PASCAL _ECAT_Compare_Set_Channel0_Trigger_By_GPIO (U16 CardNo, U16 dir, U16 interval, I32 trigger_cnt)  Purpose Set the parameters for triggering the signal at a fixed pulse interval of channel 0, which function...
  • Page 395: Ecat_Compare_Set_Channel1_Output_Enable

    High Speed Pulse Compare Function EtherCAT Programming Guide 27.11 _ECAT_Compare_Set_Channel1_Output_Enable  Syntax U16 PASCAL _ECAT_Compare_Set_Channel1_Output_Enable (U16 CardNo, U16 on_off)  Purpose Enable/Disable the compare function with user-defined interval of channel 1. Note: Before GPIO is enabled, please make sure channel 0 is enabled by API “_ECAT_Compare_Set_Channel_Enable”.
  • Page 396: Ecat_Compare_Set_Channel1_Output_Mode

    EtherCAT Programming Guide High Speed Pulse Compare Function 27.12 _ECAT_Compare_Set_Channel1_Output_Mode  Syntax U16 PASCAL _ECAT_Compare_Set_Channel1_Output_Mode (U16 CardNo, U16 Mode)  Purpose Set the output mode of channel 1. There are two modes available: Output at user-defined pulse intervals or output at user-defined intervals and with user-defined trigger level.
  • Page 397 High Speed Pulse Compare Function EtherCAT Programming Guide Note: The trigger-on position is set by “Pos_table” of the API “_ECAT_Compare_Set_Channel1_Position_Table”. For the trigge retaining time, please refer to section 27.5 API ”. “_ECAT_Compare_Set_Channel_Trigger_Time 2. Output mode of user-defined intervals and trigger level In this mode, you can define the position (pulse) for the trigger, which is the same as mode 0.
  • Page 398: Ecat_Compare_Get_Channel1_Io_Status

    EtherCAT Programming Guide High Speed Pulse Compare Function 27.13 _ECAT_Compare_Get_Channel1_IO_Status  Syntax U16 PASCAL _ECAT_Compare_Get_Channel1_IO_Status (U16 CardNo, U16* io_status)  Purpose Read the operation status of channel 1.  Parameter Name Data type Property Description CardNo Number Card No. The operation status of channel 1.
  • Page 399: Ecat_Compare_Set_Channel1_Gpio_Out

    High Speed Pulse Compare Function EtherCAT Programming Guide 27.14 _ECAT_Compare_Set_Channel1_GPIO_Out  Syntax U16 PASCAL _ECAT_Compare_Set_Channel1_GPIO_Out (U16 CardNo, U16 on_off)  Purpose Set the output status of PIN15 on CN2 of General-purpose input/output (GPIO).  Parameter Name Data type Property Description...
  • Page 400 EtherCAT Programming Guide High Speed Pulse Compare Function 27.15 _ECAT_Compare_Set_Channel1_Position_Table  Syntax U16 PASCAL _ECAT_Compare_Set_Channel1_Position_Table (U16 CardNo, I32* pos_table, U32 table_size)  Purpose Set the pulse data of user-defined pulse intervals for channel 1. The max. entry of position data is 100000.
  • Page 401 High Speed Pulse Compare Function EtherCAT Programming Guide  Output mode of user-defined pulse interval. User can define the position for performing compare function. Figure 27.12.3 Output mode of user-defined pulse interval Note: The trigger-on position is set by “Pos_table” of the API “_ECAT_Compare_Set_Channel1_Position_Table”.
  • Page 402 EtherCAT Programming Guide High Speed Pulse Compare Function 27.16 _ECAT_Compare_Set_Channel1_Position_Table_Level  Syntax U16 PASCAL _ECAT_Compare_Set_Channel1_Position_Table_Level (U16 CardNo, I32* pos_table, U32* level_table, U32 table_size)  Purpose Set the pulse data of channel 1 and its user-defined active level for triggering signals. The max.
  • Page 403: Ecat_Compare_Set_Channel1_Position_Table

    High Speed Pulse Compare Function EtherCAT Programming Guide  Description As shown in the above example, level_table is a data array. It translates the trigger state at the 32 positions into a 32-bit value. Then, these values are input in the array. Find more information in the following section.
  • Page 404 EtherCAT Programming Guide High Speed Pulse Compare Function When level_table is set as follows: U32 level_table[16] ={1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0}; // Refer to the pulse array with setting of pos_table, a signal will be triggered only at position 1000 (pulse). Below is the result of the above setting: Figure 27.12.4 Output mode of user-defined intervals and trigger level (Incorrect)
  • Page 405: Ecat_Compare_Get_Channel1_Position _Table_Count

    High Speed Pulse Compare Function EtherCAT Programming Guide 27.17 _ECAT_Compare_Get_Channel1_Position _Table_Count  Syntax U16 PASCAL _ECAT_Compare_Get_Channel1_Position_Table_Count (U16 CardNo, U32* cnt)  Purpose Acquire the current trigger counts of channel 1.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 406: Ecat_Compare_Set_Channel_Polarity

    EtherCAT Programming Guide High Speed Pulse Compare Function 27.18 _ECAT_Compare_Set_Channel_Polarity  Syntax U16 PASCAL _ECAT_Compare_Set_Channel_Polarity (U16 CardNo, U16 inverse)  Purpose Set the trigger level of the compare function.  Parameter Name Data type Property Description CardNo Number Card No.
  • Page 407: Ecat_Compare_Reuse_Channel1_Position_Table

    High Speed Pulse Compare Function EtherCAT Programming Guide 27.19 _ECAT_Compare_Reuse_Channel1_Position_Table  Syntax U16 PASCAL _ECAT_Compare_Reuse_Channel1_Position_Table (U16 CardNo)  Purpose Execute again the compare function of channel 1 which is set by API “_ECAT_Compare_Set_Channel1_Position_Table”.  Parameter Name Data type Property Description...
  • Page 408: Ecat_Compare_Reuse_Channel1_Position _Table_Level

    EtherCAT Programming Guide High Speed Pulse Compare Function 27.20 _ECAT_Compare_Reuse_Channel1_Position _Table_Level  Syntax U16 PASCAL _ECAT_Compare_Reuse_Channel1_Position_Table_Level (U16 CardNo)  Purpose Execute again the user-defined trigger level of compare function for channel 1 which is set by API _ECAT_Compare_Reuse_Channel1_Position_Table_Level”.  Parameter...
  • Page 409 High Speed Pulse Compare Function EtherCAT Programming Guide (This page is intentionally left blank.) 27-28 March, 2017...
  • Page 410: Information Of Ethercat Dynamic-Link Library (Dll)

    Information of EtherCAT Dynamic-Link Library (DLL) This chapter introduces the APIs for DLL (Dynamic-link library), such as acquiring information about directory and version of the EtherCat_DLL.dll file. 台 28.1 _ECAT_Master_Get_DLL_Path ························································ 28-2 28.2 _ECAT_Master_Get_DLL_Version ····················································· 28-3 28.3 _ECAT_Master_Get_DLL_Path_Single ··············································· 28-4 28.4 _ECAT_Master_Get_DLL_Version_Single ···········································...
  • Page 411 Information of EtherCAT Dynamic-link Library (DDL) EtherCAT Programming Guide API list of DDL information Description _ECAT_Master_Get_DLL_Path Acquire the directory of the EtherCat_DLL.dll file _ECAT_Master_Get_DLL_Version Acquire the version information of the EtherCat_DLL.dll file Acquire the directory of the ECAT_RTX_DLL.dll or _ECAT_Master_Get_DLL_Path_Single PCI_L221.dll file...
  • Page 412: Ecat_Master_Get_Dll_Version

    EtherCAT Programming Guide Information of EtherCAT Dynamic-link Library (DDL) 28.2 _ECAT_Master_Get_DLL_Version  Syntax U16 PASCAL _ECAT_Master_Get_DLL_Version(I8 *lpBuf, U32 nSize, U32 *nLength)  Purpose Acquire the version information of the EtherCat_DLL.dll file.  Parameter Name Data type Property Description lpBuf String Version of the EtherCat_DLL.dll file.
  • Page 413: Ecat_Master_Get_Dll_Path_Single

    Information of EtherCAT Dynamic-link Library (DDL) EtherCAT Programming Guide 28.3 _ECAT_Master_Get_DLL_Path_Single  Syntax U16 PASCAL _ECAT_Master_Get_DLL_Path_Single ( I8 *lpFilePath, U32 nSize, U16 CardNo, U32 *nLength)  Purpose Acquire the directory of the ECAT_RTX_DLL.dll or PCI_L221.dll file. Note: These two DLL files (ECAT_RTX_DLL.dll or PCI_L221.dll) are the updated file and the file generated by EtherCAT_DLL.dll automatically.
  • Page 414: Ecat_Master_Get_Dll_Version_Single

    EtherCAT Programming Guide Information of EtherCAT Dynamic-link Library (DDL) 28.4 _ECAT_Master_Get_DLL_Version_Single  Syntax U16 PASCAL _ECAT_Master_Get_DLL_Version_Single (U16 CardNo, I8 *lpBuf, U32 nSize, U32 *nLength)  Purpose Acquire the version information of the ECAT_RTX_DLL.dll or PCI_L221.dll file. Note: These two DLL files (ECAT_RTX_DLL.dll or PCI_L221.dll) are the updated file and the file generated by EtherCAT_DLL.dll automatically.
  • Page 415 Information of EtherCAT Dynamic-link Library (DDL) EtherCAT Programming Guide (This page is intentionally left blank.) 28-6 March, 2017...
  • Page 416: Security Of Software Protection

    Security of Software Protection This chapter introduces the APIs for security of software protection. With the built-in verification IC on Delta PAC or motion cards, you can protect your own software from being pirated. 台 29.1 _ECAT_Security_Check_Verifykey ···················································· 29-3 29.2 _ECAT_Security_Get_Check_Verifykey_State ····································· 29-4 29.3 _ECAT_Security_Write_Verifykey ······················································...
  • Page 417 Security of Software Protection EtherCAT Programming Guide API list of software protection Description _ECAT_Security_Check_Verifykey Check the verification key _ECAT_Security_Get_Check_Verifykey_State Check the verification status of the verification key _ECAT_Security_Write_Verifykey Write the verification key into the verification IC Obtain the status and result of writing in the...
  • Page 418: Ecat_Security_Check_Verifykey

    EtherCAT Programming Guide Security of Software Protection 29.1 _ECAT_Security_Check_Verifykey  Syntax U16 PASCAL _ECAT_Security_Check_Verifykey (U16 CardNo, U32 *Verifykey )  Purpose Check the verification key. The default 8-character verification key is 00000000. Users can reset it via the API “_ECAT_Security_Write_Verifykey” (section 29.3). Please remember to confirm the user password by the API mentioned in 29.5 first.
  • Page 419: Ecat_Security_Get_Check_Verifykey_State

    Security of Software Protection EtherCAT Programming Guide 29.2 _ECAT_Security_Get_Check_Verifykey_State  Syntax U16 PASCAL _ECAT_Security_Get_Check_Verifykey_State (U16 CardNo, U16 *State )  Purpose Check the verification status and result of checking the verification key. Note: The function of verification check will not be completed unless the return code is not 2.
  • Page 420: Ecat_Security_Write_Verifykey

    Write the verification key into the verification IC Note: Before writing in the verification key, users should use the API function (in section 6.1 and 6.2) to initialize the EtherCAT master. Also, use the API function (section 29.5) to confirm the password. beforehand.
  • Page 421: Ecat_Security_Get_Write_Verifykey_State

    Security of Software Protection EtherCAT Programming Guide 29.4 _ECAT_Security_Get_Write_Verifykey_State  Syntax U16 PASCAL _ECAT_Security_Get_Write_Verifykey_State (U16 CardNo, U16 *State)  Purpose Acquire the status and result of writing in the verification key. Note: The write-in function cannot be done unless the the return code is not 2.
  • Page 422: Ecat_Security_Check_Userpassword

    The default user password is 00000000. Users can reset the new password with the API function “_ECAT_Security_Write_UserPassword” (section 29.7). Note: Before applying this API, users should use the API function (in setion 6.1 and 6.2) to initialize the EtherCAT master in advance.  Parameter...
  • Page 423 Security of Software Protection EtherCAT Programming Guide 29.6 _ECAT_Security_Get_Check_UserPassword _State  Syntax U16 PASCAL _ECAT_Security_Get_Check_UserPassword_State (U16 CardNo, U16 *State )  Purpose Acquire the status of verifying the user password. Note: The password check function cannot be done unless the the return code is not 2.
  • Page 424: Ecat_Security_Write_Userpassword

    Before write in the user password, users should use the API function (in setion 6.1 and 6.2) to initialize the EtherCAT master. Also, use the API function in 29.5 to confirm the password beforehand. The new password will be valid immediately. Users will need to use API “_ECAT_Security_Check_UserPassword”...
  • Page 425: Ecat_Security_Get_Write_Userpassword_State

    Security of Software Protection EtherCAT Programming Guide 29.8 _ECAT_Security_Get_Write_UserPassword_State  Syntax U16 PASCAL _ECAT_Security_Get_Write_UserPassword_State (U16 CardNo, U16 *State )  Purpose Acquire the status and result of writing in the user password. Note: The password write-in function cannot be done until the the return code is not 2.
  • Page 426: Operating Mram On Pac

    Operating MRAM on PAC This chapter introduces the APIs for operating the MRAM on PAC. The high-speed read/write function of MRAM can satisfy the demand of retaining the information when power is cut off, which is more convenient than saving files manually. 台...
  • Page 427 Write the U16 data (Word) to the specified address of MRAM in PAC. Note: Delta MH1 and MP1 series PAC provide 128K byte retentive memory space. API allows Word type data to access the retentive memory. Index 0 will occupy byte 0 and byte 1, index 1 occupies byte 2 and byte 3 and so on.
  • Page 428: Ecat_Master_Mram_Read_Word_Data

    Read the U16 data (Word) from the specified address of MRAM in PAC. Note: Delta MH1 and MP1 series PAC provide 128K byte retentive memory space. API allows Word type data to access the retentive memory. Index 0 will occupy byte 0 and byte 1, index 1 occupies byte 2 and byte 3 and so on.
  • Page 429: Ecat_Master_Mram_Write_Dword_Data

    Write the U32 data (DWord) to the specified address of MRAM in PAC. Note: Delta MH1 and MP1 series PAC provide 128K byte retentive memory space. The API allows Double Word type data to access the retentive memory. Index 0 will occupy byte 0, byte 1, byte 2 and byte 3, index 1 occupies byte 2, byte 3, byte 4 and byte 5 and so on.
  • Page 430: Ecat_Master_Mram_Read_Dword_Data

    Read the U32 data (DWord) from the specified address of MRAM in PAC. Note: Delta MH1 and MP1 series PAC provide 128K byte retentive memory space. The API allows Double Word type data to access the retentive memory. Index 0 will occupy byte 0, byte 1, byte 2 and byte 3, index 1 occupies byte 2, byte 3, byte 4 and byte 5 and so on.
  • Page 431 Operating MRAM on PAC EtherCAT Programming Guide (This page is intentionally left blank.) 30-6 March, 2017...
  • Page 432: Retentive Digital Output Of The Module (For 70E2 Series)

    This chapter will tell you how to use the API for enabling/disabling retentive digital output of the module. Delta R1-EC70E2D0 can retain the output status when EtherCAT is offline. API function in this chapter can be used to enable the function of digital output when EtherCAT is online.
  • Page 433: Ecat_Slave_R1_Ec70E2_Set_Output_Enable

    Enable/Disable the digital output of the module. 31.1 _ECAT_Slave_R1_EC70E2_Set_Output_Enable  Syntax U16 PASCAL _ECAT_Slave_R1_EC70E2_Set_Output_Enable(U16 CardNo, U16 NodeID, U16 SlotNo, U16 Eanble )  Purpose This is for enabling/disabling digital output of Delta R1-EC70E2D0 when EtherCAT is online.  Parameter Name Data type Property Description CardNo...
  • Page 434: Retentive Digital Output Of The Module (For 70X2 Series)

    This chapter will tell you how to use the API for enabling/disabling digital output of the module. Delta R1-EC70E2D0 and R1-EC70F2D0 provide retentive function, which can keep the output status when EtherCAT is offline. API function in this chapter can be used to enable the digital output when EtherCAT is online.
  • Page 435: Ecat_Slave_R1_Ec70X2_Set_Output_Enable

    Enable/Disable digital output of the module 32.1 _ECAT_Slave_R1_EC70X2_Set_Output_Enable  Syntax U16 PASCAL _ECAT_Slave_R1_EC70X2_Set_Output_Enable(U16 CardNo, U16 NodeID, U16 SlotNo, U16 Eanble )  Purpose This is for enabling/disabling digital output of Delta R1-EC70E2D0 and R1-EC70F2D0 when EtherCAT is online.  Parameter Name Data type Property Description...
  • Page 436: Mpg Operation (For R1-Ec5614D0 Series)

    (For R1-EC5614D0 Series) This chapter will tell you how to use the APIs for MPG operation. Delta R1-EC5641D0 series provides MPG function, which allows users to set the specified axis to jog. You can start using the MPG function just by enabling it when programming.
  • Page 437 MPG Operation EtherCAT Programming Guide API List of MPG operation (for R1-EC5614D0 series) Description _ECAT_Slave_R1_EC5614_Set_MJ_Config Set the parameters of MPG function _ECAT_Slave_R1_EC5614_Set_MJ_Enable Enable/Disable the MPG function _ECAT_Slave_R1_EC5614_Get_IO_Status Acquire the I/O contact status of the MPG module _ECAT_Slave_R1_EC5614_Get_MPG_Counter Acquire the value of the MPG counter...
  • Page 438: Ecat_Slave_R1_Ec5614_Set_Mj_Config

    EtherCAT Programming Guide MPG Operation 33.1 _ECAT_Slave_R1_EC5614_Set_MJ_Config  Syntax U16 PASCAL _ECAT_Slave_R1_EC5614_Set_MJ_Config (U16 CardNo, U16 MJNo, U16 MJType, U16 NodeID, U16 SlotNo, U16 AxisNum, U16 *AxisArray, U16 *SlotArray, I32 *MaxSpeedArray, F64 *TaccArray, F64 *RatioArray )  Purpose This is for setting the parameters of MPG function.
  • Page 439 MPG Operation EtherCAT Programming Guide Status = _ECAT_Slave_R1_EC5614_Set_MJ_Config( CardNo, NodeID, SlotNo, MJNo, MJType, AxisNum, AxisArray, SlotArray, MaxSpeedArray, TaccArray, RatioArray ); // It can be enabled when setting is complete. If(Status == 0) Status = _ECAT_Slave_R1_EC5614_Set_MJ_Enable(CardNo, MJNo, Enable); 33-4 March, 2017...
  • Page 440: Ecat_Slave_R1_Ec5614_Set_Mj_Enable

    EtherCAT Programming Guide MPG Operation 33.2 _ECAT_Slave_R1_EC5614_Set_MJ_Enable  Syntax U16 PASCAL _ECAT_Slave_R1_EC5614_Set_MJ_Enable (U16 CardNo, U16 MJNo, U16 Enable)  Purpose This is for enabling/disabling the MPG function. Note: Before enabling the MPG function, please set the parameters of _ECAT_Slave_R1_EC5614_Set_MJ_Config in section 33.1.
  • Page 441: Ecat_Slave_R1_Ec5614_Get_Io_Status

    MPG Operation EtherCAT Programming Guide 33.3 _ECAT_Slave_R1_EC5614_Get_IO_Status  Syntax U16 PASCAL _ECAT_Slave_R1_EC5614_Get_IO_Status (U16 CardNo, U16 NodeID, U16 SlotNo, U16 *IOStatus)  Purpose This is for acquiring the DI/O contact status of MPG module.  Parameter Name Data type Property Description...
  • Page 442: Ecat_Slave_R1_Ec5614_Get_Mpg_Counter

    EtherCAT Programming Guide MPG Operation 33.4 _ECAT_Slave_R1_EC5614_Get_MPG_Counter  Syntax U16 PASCAL _ECAT_Slave_R1_EC5614_Get_MPG_Counter (U16 CardNo, U16 NodeID, U16 SlotNo, I32 *Counter)  Purpose This is for acquiring accumulative value of the MPG counter.  Parameter Name Data type Property Description CardNo...
  • Page 443 MPG Operation EtherCAT Programming Guide (This page is intentionally left blank.) 33-8 March, 2017...
  • Page 444: Error Code Description

    Error Code Description If an error code is returned after an API is executed, you can refer to this chapter to find more information about the cause and troubleshooting method. 台 34.1 List of error code ··········································································· 34-2 34.2 Error code description ···································································· 34-10 34-1 March, 2017...
  • Page 445 The Autoconfig file for saving the hardware ERR_ECAT_ENVIRONMENT_ connection configuration has not been RECORD_NOT_CREATE created. The setting for initializing EtherCAT Master is ERR_ECAT_DEVICE_OPEN in error. The module data that is loaded during the ERR_ECAT_NO_DEVICE initial stage of EtherCAT Master initialization is in error.
  • Page 446 (Decimal) ERR_ECAT_MASTER_REQUEST_ Wrong communication mode of EtherCAT STATE Master. ERR_ECAT_MASTER_OPERATION_NOT The EtherCAT Master is not in OP status yet. _READY ERR_ECAT_DELTA_NODE_ID_ALIAS_RE Fait to read the verification code of Delta servo drive. ERR_ECAT_MASTER_GET_ Fail to acquire the serial number of Delta PAC SERIAL_NO_WRONG or EtherCAT motion card.
  • Page 447 The DC time information in the ESI file cannot 3851 be set. Unable to generate process data or initial 4080 ERR_ESI_ENI_INFORMATION_INITIAL command. The information required by ESI (EtherCAT 4081 ERR_ESI_ENI_FILE_INITIAL Slave Information) file cannot be generated. ESI (EtherCAT Slave Information) file cannot 4082 ERR_ESI_ENI_FILE_SAVE be saved.
  • Page 448 EtherCAT Programming Guide Error Code Description Returned value Name of the error code Description (Decimal) This API can be executed only when the 4359 ERR_ECAT_NEED_STOP specified axis is not moving. The cycle communication command buffer of 4608 ERR_ECAT_RING_BUFFER_FULL mailbox is full.
  • Page 449 5128 ERR_ECAT_GROUP_ALM An alarm has occurred on one of the axes. 5129 ERR_ECAT_GROUP_DATA_ BUFFER The buffer is full. (799 data) No response is sent from the EtherCAT kernel 5130 ERR_ECAT_GROUP_TIMEOUT during group operation. 5376 ERR_ECAT_SERVO_PARA_EMPTY This servo parameter does not exist.
  • Page 450 EtherCAT Programming Guide Error Code Description Returned value Name of the error code Description (Decimal) This function fails to access the security 12290 ERR_ECAT_SECURITY_CONNECT kernel. 32825 ERR_PATH_ECAT_NEED_ENABLE This API requires to be enabled. This API cannot be executed when E-cam is...
  • Page 451 61443 ERR_ECAT_NO_CARD_DLL_ FOUND DLL file of motion card is in error. Connection between EtherCAT DLL file and 61444 ERR_ECAT_NO_ESI_DLL_FOUND ESI file (EtherCAT Slave Information) is in error. ERR_ECAT_SAME_CARD_ 61445 Repeated RTSS or motion card number. NUMBER A non-existing card number of EtherCAT is...
  • Page 452 EtherCAT Programming Guide Error Code Description Returned value Name of the error code Description (Decimal) 65535 ERR_ECAT_LOADLIB_EMPTY Fail to call DLL resource in RTSS. 34-9 March, 2017...
  • Page 453 Code in HEX Name of error ERR_ECAT_HW_PWM_INITIAL code Description Fail to initialize EtherCAT master. Communication for EtherCAT master cannot be created. Please check if the Troubleshooting hardware connection is normal. Code in DEC Code in HEX Name of error ERR_ECAT_HW_HAS_INITIALIZED...
  • Page 454 0x17 Name of error ERR_ECAT_DEVICE_OPEN code Description The setting for initializing EtherCAT Master is in error. An error has occurred when initializing EtherCAT Master. Please check if the Troubleshooting hardware connection is normal. Code in DEC Code in HEX 0x18...
  • Page 455 Error Code Description EtherCAT Programming Guide The module information that is loaded during the initial stage of EtherCAT Description Master initialization is in error. Troubleshooting Check if the specific DAT file does exist. Code in DEC Code in HEX 0x19...
  • Page 456 Name of error ERR_ECAT_MASTER_GET_SERIAL_NO_WRONG code Description Fail to acquire the serial number of Delta PAC or EtherCAT motion card. Please contact Delta to check if the latest FPGA firmware is used on your Troubleshooting Delta PAC or EtherCAT motion card.
  • Page 457 EtherCAT Programming Guide Code in DEC Code in HEX 0x81 Name of error ERR_ECAT_PIPELINE_CREATE code EtherCAT kernel – Fail to create the scheduler function due to system Description configuration error. Troubleshooting Code in DEC Code in HEX 0x82 Name of error...
  • Page 458 Code in DEC 3840 Code in HEX 0xF00 Name of error ERR_ESI_INITIAL code Initialization failure of ESI (EtherCAT Slave Information) file or the ESI file has Description not been initialized. Troubleshooting Re-initialize the EtherCAT master. Code in DEC 3841 Code in HEX...
  • Page 459 0xF04 Name of error ERR_ESI_NO_OBJECT_INFO code Description The data of Object section cannot be created. Troubleshooting Check if the file format of ESI (EtherCAT Slave Information) is correct. Code in DEC 3845 Code in HEX 0xF05 Name of error ERR_ESI_CREATE_SYNC_MANAGER...
  • Page 460 Name of error ERR_ESI_CREATE_DISTRIBUTED_CLOCK code Description The DC time information in the ESI file cannot be set. Troubleshooting Check if the file format of ESI (EtherCAT Slave Information) is correct. Code in DEC 4080 Code in HEX 0xFF0 Name of error...
  • Page 461 3. Check if the communication of the servo drive or module is normal. 4. Restart the servo drive or the module and try again. 5. Use the default setting of EtherCAT Master through EcNavi and then try again. 6. If the issue persists, please contact Delta.
  • Page 462 Name of error ERR_ECAT_NEED_RESET code Description This API cannot be executed after the EtherCAT Master is initialized. Please refer to the example in Section 3.1 to execute EtherCAT initialization Troubleshooting for motion card. Code in DEC 4354 Code in HEX...
  • Page 463 Error Code Description EtherCAT Programming Guide Code in DEC 4357 Code in HEX 0x1105 Name of error ERR_ECAT_NEED_SVON code Description The motor has to be enabled before executing the API. Troubleshooting Use “ECAT_Slave_Motion_Set_Svon” to enable the motor. Code in DEC...
  • Page 464 The firmware version of this module is not supported. The current version of the module or servo drive is not included in the DAT file. Troubleshooting Please contact Delta to get the latest xml file and DAT file 34-21 March, 2017...
  • Page 465 Error Code Description EtherCAT Programming Guide Code in DEC 4616 Code in HEX 0x1208 Name of error ERR_ECAT_SPEED_CONTINUE_MODE code Description One of the axes is not set to continuous speed mode. Troubleshooting Please enable the continuous speed mode for the axis.
  • Page 466 3. Check if the communication of the servo drive or module is normal. 4. Restart the servo drive or module and try again. 5. Use the default setting of EtherCAT Master through EcNavi and then try again. 6. If the issue persists, please contact Delta.
  • Page 467 3. Check if the communication of the servo drive or module is normal. 4. Restart the servo drive or module and try again. 5. Use the default setting of EtherCAT Master through EcNavi and then try again. 6. If the issue persists, please contact Delta.
  • Page 468 EtherCAT Programming Guide Error Code Description Description SDO command buffer is full. Please wait until enough SDO buffer space is available and execute the API Troubleshooting again. Code in DEC 5120 Code in HEX 0x1400 Name of error ERR_ECAT_GROUP_NUMBER code Description The input number of grouped axes is over 10 the maximum.
  • Page 469 Error Code Description EtherCAT Programming Guide Code in DEC 5125 Code in HEX 0x1405 Name of error ERR_ECAT_GROUP_ALREADY_USED code Description This group number is in use. The group you selected has been enabled or stopped; this command is not Troubleshooting supported.
  • Page 470 0x140A Name of error ERR_ECAT_GROUP_TIMEOUT code Description No response is sent from the EtherCAT kernel during group operation. Please check if the communication and operation is normal. If you cannot find Troubleshooting the cause, please contact Delta. Code in DEC...
  • Page 471 Error Code Description EtherCAT Programming Guide Code in DEC 5888 Code in HEX 0x1700 Name of error ERR_ECAT_MPG_ENABLE code This MPG group has been enabled. Please disable it first before executing the Description API. The same MPG group can only be enabled once at a time. Please disable it Troubleshooting and carry on the execution.
  • Page 472 EtherCAT Programming Guide Error Code Description Code in DEC 32826 Code in HEX 0x803a Name of error ERR_PATH_ECAT_ECAM_ENABLE code Description This API cannot be executed when E-cam is enabled. Troubleshooting Code in DEC 32827 Code in HEX 0x803b Name of error...
  • Page 473 3. Check if the communication of the servo drive or module is normal. 4. Restart the servo drive or module and try again. 5. Use the default setting of EtherCAT Master through EcNavi and then try again. 6. If the issue persists, please contact Delta.
  • Page 474 Description Fail to enable communication status of RTX thread Please check the following: Troubleshooting 1. Power on the PAC again and execute the API. 2. If the issue persists, please contact Delta. Code in DEC 53258 Code in HEX 0xD00a...
  • Page 475 Code in DEC 57345 Code in HEX 0xE001 Name of error ERR_CARD_NO_RESPONSE code Description No response is sent from the motion card after the command is sent. Troubleshooting API timeout is usually caused by software error. Please contact Delta. 34-32 March, 2017...
  • Page 476 Re-initialize the system for the update. Code in DEC 57351 Code in HEX 0xE007 Name of error ERR_CARD_UPGRADE_NO_RESPONSE code Description No response returned during the update. Troubleshooting Re-initialize the system. If the issue persists, please contact Delta. 34-33 March, 2017...
  • Page 477 57355 Code in HEX 0xE00B Name of error ERR_CARD_UPGRADE_FAILED code Description System update failure Troubleshooting Firmware update failure. Please contact Delta. Code in DEC 61440 Code in HEX 0xF000 Name of error ERR_ECAT_DLL_IS_USED code Description EtherCAT_DLL file has been opened.
  • Page 478 61444 Code in HEX 0xF004 Name of error ERR_ECAT_NO_ESI_DLL_FOUND code Connection between EtherCAT DLL file and ESI file (EtherCAT Slave Description Information) is in error. Troubleshooting Please check if the files are in the same directory. Code in DEC 61445...
  • Page 479 0xF009 Name of error ERR_ECAT_NOT_SUPPORT code Description This DMCNET type API is not supported by EtherCAT. Troubleshooting Use the EtherCAT type API that serves the similar function. Code in DEC 65535 Code in HEX 0xFFFF Name of error ERR_ECAT_LOADLIB_EMPTY code Description Fail to call DLL resource in RTSS.
  • Page 480 Revision History Release date Version Chapter Revision Contents V1.0 March, 2017 (First edition) March, 2017...
  • Page 481 Revision History EtherCAT Programming Guide (This page is intentionally left blank.) March, 2017...

Table of Contents