0% found this document useful (0 votes)
32 views

DELTA EtherCAT Program Guide

DELTA

Uploaded by

coronaqc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

DELTA EtherCAT Program Guide

DELTA

Uploaded by

coronaqc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 481

Delta EtherCAT Programming Guide

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

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
TEL: 65-6747-5155 / FAX: 65-6744-9228

Delta Electronics (India) Pvt. Ltd.


Programming Guide
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.
www.deltaww.com
Table of Contents
Introduction to API Library
1.1 How to use function libraries? ···············································································1-2
1.2 Start a new project······························································································1-2
1.2.1 Using VC······································································································1-2
1.2.2 Using VB ······································································································1-2
1.2.3 Using VB.Net ································································································1-2
1.2.4 Using C# ······································································································1-3

EtherCAT Introduction
2.1 Maximum number of the slave device ·····································································2-2
2.2 Initialize RTX runtime environment ·········································································2-3
2.3 Introduction to RTSS Task Manager ·······································································2-4

EtherCAT Operation Example


3.1 EtherCAT Initialization ·························································································3-3
3.1.1 Function list ··································································································3-3
3.1.2 Application examples ······················································································3-3
3.2 Motion control of homing ······················································································3-6
3.2.1 Function list ··································································································3-6
3.2.2 Application examples ······················································································3-6
3.3 Torque control····································································································3-9
3.3.1 Function list ··································································································3-9
3.3.2 Application examples ······················································································3-9
3.4 Constant speed control ······················································································ 3-12
3.4.1 Function list ································································································ 3-12
3.4.2 Application examples ···················································································· 3-12
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
3.7.1 Function list ································································································ 3-38
3.7.2 Application examples ···················································································· 3-38
3.8 EtherCAT Slave IO control (digital output) ······························································ 3-40
3.8.1 Function list ································································································ 3-40
3.8.2 Application examples ···················································································· 3-40
3.9 Application of EtherCAT analog input module (R1-EC-8124) ······································ 3-42
3.9.1 Function list ································································································ 3-42
3.9.2 Application examples ···················································································· 3-42
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 ···············································································4-2
4.2 API list and descriptions ·······················································································4-2

EtherCAT Master Configuration


5.1 _ECAT_Master_Set_CycleTime············································································· 5-3
5.2 _ECAT_Master_Get_CycleTime ············································································5-4
5.3 _ECAT_Master_NodeID_Alias_Enable····································································5-5
5.4 _ECAT_Get_SerialNo··························································································5-6
5.5 _ECAT_Master_Get_DLL_SeqID ···········································································5-7
5.6 _ECAT_Autoconfig_Open_File ··············································································5-8
5.7 _ECAT_Autoconfig_Save_File ··············································································5-9
5.8 _ECAT_Autoconfig_Set_Slave_DCTime ································································ 5-10
5.9 _EACT_Autoconfig_Clear_ConfigFile ··································································· 5-11
5.10 _ECAT_Autoconfig_Set_NodeID_Alias ································································ 5-12
5.11 _ECAT_Autoconfig_Get_NodeID_Alias································································ 5-14
5.12 _ECAT_Autoconfig_Save_NodeID_Alias ····························································· 5-15

Master Initialization
6.1 _ECAT_Master_Open ························································································· 6-3
6.2 _ECAT_Master_Initial ··························································································6-4
6.3 _ECAT_Master_Reset ·························································································6-5
6.4 _ECAT_Master_Close ·························································································6-6
6.5 _ECAT_Master_Get_CardSeq ··············································································6-7

March, 2017
6.6 _ECAT_Master_Get_SlaveNum ············································································6-8
6.7 _ECAT_Master_Get_Slave_Info ············································································6-9
6.8 _ECAT_Master_Get_DC_Status ·········································································· 6-11
6.9 _ECAT_Master_Get_Connect_Status ··································································· 6-12
6.10 _ECAT_Master_Get_Api_BufferLength································································ 6-13
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 ····································································7-7
7.6 _ECAT_Slave_SDO_Wait_All_Done·······································································7-8
7.7 _ECAT_Slave_SDO_Get_ErrorCode ······································································7-9
7.8 _ECAT_Slave_SDO_Check_Done ······································································· 7-11
7.9 _ECAT_Slave_PDO_Get_OD_Data ····································································· 7-12
7.10 _ECAT_Slave_PDO_Set_OD_Data ···································································· 7-13
7.11 _ECAT_Slave_PDO_Get_Information ································································· 7-14
7.12 _ECAT_Slave_PDO_Get_Detail_Mapping ··························································· 7-15
7.13 _ECAT_Slave_PDO_Get_Rx_Data ···································································· 7-16
7.14 _ECAT_Slave_PDO_Get_Tx_Data ····································································· 7-17
7.15 _ECAT_Slave_PDO_Set_Tx_Data ····································································· 7-18
7.16 _ECAT_Slave_PDO_Set_Tx_Detail_Data ···························································· 7-19

General Operation of Motion Axis


8.1 _ECAT_Slave_Motion_Set_Svon ···········································································8-3
8.2 _ECAT_Slave_Motion_Ralm ·················································································8-4
8.3 _ECAT_Slave_Motion_Sd_Stop ············································································8-5
8.4 _ECAT_Slave_Motion_Emg_Stop ··········································································8-6
8.5 _ECAT_Slave_Motion_Set_Alm_Reaction ·······························································8-7
8.6 _ECAT_Slave_Motion_Set_Position ·······································································8-8
8.7 _ECAT_Slave_Motion_Set_Command ····································································8-9
8.8 _ECAT_Slave_Motion_Set_MoveMode ·················································· 8-10
8.9 _ECAT_Slave_Motion_Get_MoveMode································································· 8-11
8.10 _ECAT_Slave_Motion_Get_ControlWord ····························································· 8-12

March, 2017
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 ···················································· 8-25
8.22 _ECAT_Slave_Motion_Set_TouchProbe_QuickStart ·············································· 8-28
8.23 _ECAT_Slave_Motion_Set_TouchProbe_QuickDone ·············································· 8-30
8.24 _ECAT_Slave_Motion_Set_TouchProbe_Disable ·················································· 8-32
8.25 _ECAT_Slave_Motion_Get_TouchProbe_Status···················································· 8-33
8.26 _ECAT_Slave_Motion_Get_TouchProbe_Position ················································· 8-35

Cyclic Synchronous Position Mode (CSP)


9.1 _ECAT_Slave_CSP_Start_Move ········································································ 9-5
9.2 _ECAT_Slave_CSP_Start_V_Move ·····································································9-7
9.3 _ECAT_Slave_CSP_Start_Arc_Move ···································································9-8
9.4 _ECAT_Slave_CSP_Start_Arc2_Move ······························································· 9-10
9.5 _ECAT_Slave_CSP_Start_Arc3_Move ······························································· 9-12
9.6 _ECAT_Slave_CSP_Start_Spiral_Move ······························································ 9-14
9.7 _ECAT_Slave_CSP_Start_Spiral2_Move ···························································· 9-15
9.8 _ECAT_Slave_CSP_Start_Sphere_Move ···························································· 9-17
9.9 _ECAT_Slave_CSP_Start_Heli_Move ································································ 9-18
9.10 _ECAT_Slave_CSP_Start_Multiaxes_Move ························································· 9-20
9.11 _ECAT_Slave_CSP_Start_Msbrline_Move ··························································· 9-21
9.12 _ECAT_Slave_CSP_Set_Gear ·········································································· 9-25
9.13 _ECAT_Slave_CSP_Set_Softlimit ······································································ 9-26
9.14 _ECAT_Slave_CSP_TargetPos_Change ····························································· 9-27
9.15 _ECAT_Slave_CSP_Velocity_Change ································································ 9-28
9.16 _ECAT_Slave_CSP_Feedrate_Overwrite····························································· 9-29
9.17 _ECAT_Slave_CSP_Speed_Continue_Enable ······················································ 9-33
9.18 _ECAT_Slave_CSP_Speed_Continue_Set_Mode ················································· 9-34
9.19 _ECAT_Slave_CSP_Speed_Continue_Set_Combine_ Ratio···································· 9-37
9.20 _ECAT_Slave_CSP_Scurve_Rate ······································································ 9-38
9.21 _ECAT_Slave_CSP_Liner_Speed_Master ··························································· 9-39
9.22 _ECAT_Slave_CSP_Mask_Axis ········································································ 9-41

March, 2017
9.23 _ECAT_Slave_CSP_Sync_Config ······································································ 9-42
9.24 _ECAT_Slave_CSP_Sync_Move ······································································· 9-43
9.25 _ECAT_Slave_CSP_Start_Mabrline_Move··························································· 9-44
9.26 _ECAT_Slave_CSP_Start_2Segment_Move ························································ 9-46
9.27 _ECAT_Slave_CSP_Start_PVT_Move ································································ 9-48
9.28 _ECAT_Slave_CSP_Start_PVTComplete_Move ··················································· 9-50
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 ······························································· 9-60

Cyclic Synchronous Velocity Mode (CSV)


10.1 _ECAT_Slave_CSV_Start_Move········································································ 10-2
10.2 _ECAT_Slave_CSV_Multi_Start_Move ································································ 10-3

Cyclic Synchronous Torque Mode (CST)


11.1 _ECAT_Slave_CST_Start_Move ········································································ 11-2
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

March, 2017
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 ············································· 17-10
17.7 _ECAT_Slave_User_Motion_Control_Ralm ························································ 17-11
17.8 _ECAT_Slave_User_Motion_Control_Svon ························································ 17-12
17.9 _ECAT_Slave_User_Motion_Control_Get_Alm ··················································· 17-13

Operation of DI/DO Module


18.1 _ECAT_Slave_DIO_Get_Input_Value·································································· 18-3
18.2 _ECAT_Slave_DIO_Get_Output_Value ······························································· 18-4
18.3 _ECAT_Slave_DIO_Set_Output_Value································································ 18-5
18.4 _ECAT_Slave_DIO_Get_Single_Input_Value························································ 18-6
18.5 _ECAT_Slave_DIO_Get_Single_Output_Value ····················································· 18-7
18.6 _ECAT_Slave_DIO_Set_Single_Output_Value ······················································ 18-8
18.7 _ECAT_Slave_DIO_Set_Output_Error_Mode ······················································· 18-9
18.8 _ECAT_Slave_DIO_Set_Output_Error_Value ····················································· 18-10

Operation of AI/AO Module


19.1 _ECAT_Slave_AIO_Get_Input_Value ·································································· 19-3
19.2 _ECAT_Slave_AIO_Set_Output_Value ································································ 19-4
19.3 _ECAT_Slave_AIO_Get_Output_Value ······························································· 19-5

Operation of Pulse Module (For R1-EC5621D0 Series)


20.1 _ECAT_Slave_R1_EC5621_Set_Output_Mode····················································· 20-3
20.2 _ECAT_Slave_R1_EC5621_Set_Input_Mode ······················································· 20-4
20.3 _ECAT_Slave_R1_EC5621_Set_ORG_Inverse ···················································· 20-5
20.4 _ECAT_Slave_R1_EC5621_Set_QZ_Inverse ······················································· 20-6

March, 2017
20.5 _ECAT_Slave_R1_EC5621_Set_Home_SpMode ·················································· 20-7
20.6 _ECAT_Slave_R1_EC5621_Set_MEL_Inverse ····················································· 20-8
20.7 _ECAT_Slave_R1_EC5621_Set_PEL_Inverse······················································ 20-9
20.8 _ECAT_Slave_R1_EC5621_Set_Svon_Inverse ·················································· 20-10
20.9 _ECAT_Slave_R1_EC5621_Set_Home _Slow_Down ·········································· 20-11
20.10 _ECAT_Slave_R1_EC5621_Get_IO_Status ····················································· 20-12
20.11 _ECAT_Slave_R1_EC5621_Get_Single_IO_Status ············································ 20-13

Operation of Pulse Module (For R1-ECx62xD0 Series)


21.1 _ECAT_Slave_R1_ECx62x_Set_Output_Mode ····················································· 21-3
21.2 _ECAT_Slave_R1_ECx62x_Set_Input_Mode ······················································· 21-4
21.3 _ECAT_Slave_R1_ECx62x_Set_ORG_Inverse ····················································· 21-5
21.4 _ECAT_Slave_R1_ECx62x_Set_QZ_Inverse ······················································· 21-6
21.5 _ECAT_Slave_R1_ECx62x_Set_Home_SpMode ·················································· 21-7
21.6 _ECAT_Slave_R1_ECx62x_Set_MEL_Inverse ····················································· 21-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 ················································· 22-7
22.6 _ECAT_Slave_DeltaServo_Get_Compare_Enable ················································· 22-8
22.7 _ECAT_Slave_DeltaServo_Set_Compare_Config ·················································· 22-9

Analog Input Settings (For R1-EC8124D0)


23.1 _ECAT_Slave_R1_EC8124_Set_Input _RangeMode ············································· 23-3
23.2 _ECAT_Slave_R1_EC8124_Set_Input _ConvstFreq_Mode ····································· 23-4
23.3 _ECAT_Slave_R1_EC8124_Set_Input_Enable ····················································· 23-5
23.4 _ECAT_Slave_R1_EC8124_Get_Input _RangeMode ············································· 23-6
23.5 _ECAT_Slave_R1_EC8124_Set_Input _AverageMode ··········································· 23-7

Analog Output Settings (For R1-EC9144D0 Series)


24.1 _ECAT_Slave_R1_EC9144_Set_Output _RangeMode ··········································· 24-3

March, 2017
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················································································ 26-3
26.2 _ECAT_GPIO_Get_Output ··············································································· 26-4
26.3 _ECAT_GPIO_Get_Input·················································································· 26-5

High-Speed Pulse Compare Function


27.1 _ECAT_Compare_Set_Channel_Position ···························································· 27-4
27.2 _ECAT_Compare_Get_Channel_Position ···························································· 27-5
27.3 _ECAT_Compare_Set_Ipulser_Mode ·································································· 27-6
27.4 _ECAT_Compare_Set_Channel_Direction ··························································· 27-7
27.5 _ECAT_Compare_Set_Channel_Trigger_Time ····················································· 27-8
27.6 _ECAT_Compare_Set_Channel_One_Shot·························································· 27-9
27.7 _ECAT_Compare_Set_Channel_Source···························································· 27-10
27.8 _ECAT_Compare_Set_Channel_Enable ···························································· 27-11
27.9 _ECAT_Compare_Channel0_Position ······························································· 27-12
27.10 _ECAT_Compare_Set_Channel0_Trigger _By_GPIO ········································· 27-13
27.11 _ECAT_Compare_Set_Channel1_Output_Enable ·············································· 27-14
27.12 _ECAT_Compare_Set_Channel1_Output_Mode ················································ 27-15
27.13 _ECAT_Compare_Get_Channel1_IO_Status ···················································· 27-17
27.14 _ECAT_Compare_Set_Channel1_GPIO_Out ···················································· 27-18
27.15 _ECAT_Compare_Set_Channel1_Position_Table ·············································· 27-19
27.16 _ECAT_Compare_Set_Channel1_Position _Table_Level ····································· 27-21
27.17 _ECAT_Compare_Get_Channel1_Position _Table_Count···································· 27-24
27.18 _ECAT_Compare_Set_Channel_Polarity ························································· 27-25
27.19 _ECAT_Compare_Reuse_Channel1_Position _Table ········································· 27-26
27.20 _ECAT_Compare_Reuse_Channel1_Position _Table_Level································· 27-27

March, 2017
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 ······························································ 29-6
29.6 _ECAT_Security_Get_Check_UserPassword _State ·············································· 29-7
29.7 _ECAT_Security_Write_UserPassword ······························································· 29-8
29.8 _ECAT_Security_Get_Write_UserPassword_State ················································ 29-9

Operating MRAM on PAC


30.1 _ECAT_Master_MRAM_Write_Word_Data ··························································· 30-2
30.2 _ECAT_Master_MRAM_Read_Word_Data ·························································· 30-3
30.3 _ECAT_Master_MRAM_Write_DWord_Data························································· 30-4
30.4 _ECAT_Master_MRAM_Read_DWord_Data ························································ 30-5

Retentive Digital Output of the Module (For 70E2 Series)


31.1 _ECAT_Slave_R1_EC70E2_Set_Output_Enable ·················································· 31-2

Retentive Digital Output of the Module (For 70X2 Series)


32.1 _ECAT_Slave_R1_EC70X2_Set_Output_Enable ·················································· 32-2

MPG Operation (For R1-EC5614D0 Series)


33.1 _ECAT_Slave_R1_EC5614_Set_MJ_Config ························································ 33-3
33.2 _ECAT_Slave_R1_EC5614_Set_MJ_Enable ························································ 33-5
33.3 _ECAT_Slave_R1_EC5614_Get_IO_Status ························································· 33-6
33.4 _ECAT_Slave_R1_EC5614_Get_MPG_Counter ··················································· 33-7

Error Code Description


34.1 List of error code ···························································································· 34-2
34.2 Error code description ···················································································· 34-10

March, 2017
(This page is intentionally left blank.)

March, 2017
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.

1.1 How to use function libraries?······························································· 1-2


1.2 Start a new project ············································································· 1-2
1.2.1 Using VC ··················································································· 1-2
1.2.2 Using VB ··················································································· 1-2
1.2.3 Using VB.Net ·············································································· 1-2
1.2.4 Using C# ··················································································· 1-3

March, 2017 1-1


Introduction to API Function Library EtherCAT Programming Guide

1.1 How to use function libraries?


When the installation program is completed, two function libraries will be found in the folder

1 named “lib”. They can be used in Visual Studio C and Borland C++ respectively.

Function library

EtherCatDll.lib
Development environment

Visual Studio C++

BCBEtherCAT_DLL.lib Borland C++Builder 6

1.2 Start a new project


1.2.1 Using VC

(1) Place following instructions in the user-built project:


#include “EtherCat_DLL.h”
#include “EtherCat_DLL_Err.h”
(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.

1.2.3 Using VB.Net

Place “EtherCat_DLL.vb” and “EtherCat_DLL_Err.vb” in the project created by users to control


EtherCAT DLL with API.

1-2 March, 2017


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. Serious errors (i.e. blue screen) will occur if this option is not ticked.
1

Figure 1.2.4.1 Settings for C# project

March, 2017 1-3


Introduction to API Function Library EtherCAT Programming Guide

(This page is intentionally left blank.)

1-4 March, 2017


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.

2.1 Maximum number of the slave device ···················································· 2-2


2.2 Initialize RTX runtime environment ························································ 2-3
2.3 Introduction to RTSS Task Manager ······················································ 2-4

March, 2017 2-1


EtherCAT Introduction EtherCAT Programming Guide

2.1 Maximum number of the slave device


Delta EtherCAT master has two types of operation system, RTX real-time operating system from

2
PAC and EtherCAT PCI motion card. Since the operational efficiency among both differs from
one another, the connected slave number is different.
When EtherCAT master runs in RTX real-time operating system, the default of its communication
cycle is 1 ms (1K) and can connect up to remote modules and 64 motion axes, including servo
drives and pulse modules. There is no limitation on quantity of the device that connects to
EtherCAT master. However, if the communication cycle is shorter, the suggested maximum
number of the connected slave will be reduced in accordance with proportion. Please refer to
table 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.

EtherCAT master runs in RTX real-time operating system of Delta PAC


Max. number of the connected Max. number of the connected
Communication cycle (ms)
remote module (1 ms) motion axis (1 ms)
4 ms 100 64

2 ms 100 64

1 ms 100 64

0.5 ms 50 32

0.25 ms 25 16

0.125 ms 22 8

Table 2.1.1 Suggested number of the slave

EtherCAT master runs in Delta PCI EtherCAT motion card


Communication cycle (ms) Max. number of the connected Max. number of the connected
remote module (1 ms) motion axis (1 ms)
4 ms 64 32

2 ms 64 32

1 ms 64 32

0.5 ms 32 16

0.25 ms 16 8

0.125 ms 8 4

Table 2.1.2 Suggested number of the slave

2-2 March, 2017


EtherCAT Programming Guide EtherCAT Introduction

2.2 Initialize RTX runtime environment


For running the real-time operating system uploaded by synchronous function of EtherCAT

2
communication, RTX has one CPU and one Ethernet communication port. If you are applying a
Delta EtherCAT motion card, such as PCI-L221PPI, then there is nothing to do with RTX system.
When the host computer has started up, the RTX runtime environment will not be automatically
loaded into the system. 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.
(1) Open [RTX Properties]
File location: [Start] > [All programs] > [IntervalZero] > [RTX 2012] > [RTX Properties]
(2) Enable RTX devices
After opening [RTX Properties], select the Control tab and check the Driver status. If the driver
status shows “Stopped”, press the Start key to have the RTX devices start running.

Figure 2.2.1 RTX devices in Stopped status

March, 2017 2-3


EtherCAT Introduction EtherCAT Programming Guide

(3) 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.

Figure 2.3.1 Interface of RTSS Task Manager

2-4 March, 2017


EtherCAT Programming Guide EtherCAT Introduction

If there is any file missing in Task Manager, users can reload the missing file.
(1) Click the Start Task key, and the RtssRun window will pop out.

Figure 2.3.2 RtssRun window

(2) Click Browse and select the missing file, which is placed in C:\Windows\system32\.

Figure 2.3.3 Select the missing file

March, 2017 2-5


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

2-6 March, 2017


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 ··································································· 3-3
3.2 Motion control of homing ····································································· 3-6
3.2.1 Function list ················································································ 3-6
3.2.2 Application examples ··································································· 3-6
3.3 Torque control ··················································································· 3-9
3.3.1 Function list ················································································ 3-9
3.3.2 Application examples ··································································· 3-9
3.4 Constant speed control ····································································· 3-12
3.4.1 Function list ·············································································· 3-12
3.4.2 Application examples ································································· 3-12
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
3.7.1 Function list ·············································································· 3-38
3.7.2 Application examples ································································· 3-38
3.8 EtherCAT Slave IO control (digital output) ············································· 3-40
3.8.1 Function list ·············································································· 3-40
3.8.2 Application examples ································································· 3-40
3.9 Application of EtherCAT analog input module (R1-EC-8124) ····················· 3-42
3.9.1 Function list ·············································································· 3-42
3.9.2 Application examples ································································· 3-42
3.10 Application of EtherCAT analog output module (R1-EC-9144) ·················· 3-44

March, 2017 3-1


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 3.11.1 Function list ············································································ 3-47


3.11.2 Application examples ································································ 3-48

3-2 March, 2017


EtherCAT Programming Guide EtherCAT Operation Example

3.1 EtherCAT initialization


3.1.1 Function list

3
Function name

_ECAT_Master_Open

_ECAT_Master_Get_CardSeq

_ECAT_Master_Initial

_ECAT_Master_Get_SlaveNum

_ECAT_Master_Reset

_ECAT_Master_Close

_ECAT_Master_Check_Initial_Done

 Properties

Hardware EtherCAT RTX (PAC) EtherCAT motion card

Supported Y Y

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 3-3


EtherCAT Operation Example EtherCAT Programming Guide

(2) Initialize interface card

3 Figure 3.1.2.3

Press the Initial key to execute the following program:


for(i=0; i< gESCExistCards; i++)
{
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);
MessageBox(strMsg);
}
}
RetCode = _ECAT_Master_Check_Initial_Done(gESCCardNo, &InitialDone);
/* Get the Initial status. */
// Display the Initial Status:
// InitialDone = 1: Display “Pre Initial”
// InitialDone = 0: Display “Initial Done”
// InitialDone = 99: Display “Initial Error”

(3) Set the information of the connected modules

Figure 3.1.2.5

Press the Find Slave key to execute the following program:


RetCode = _ECAT_Master_Get_SlaveNum(gESCCardNo, &SlaveNum);
// Get the number of the connected modules.
When the above program completes, the number of the found Slave devices will be
displayed in Slave Num field.

3-4 March, 2017


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++)
3
{
_ECAT_Master_Reset(gpESCCardNoList[i]);
// Reset the interface card.
}
_ECAT_Master_Close();
// End the operation of motion control card.

March, 2017 3-5


EtherCAT Operation Example EtherCAT Programming Guide

3.2 Motion control of homing


3.2.1 Function list

3
Function name

_ECAT_Slave_Home_Config

_ECAT_Slave_Home_Move

_ECAT_Slave_Motion_Sd_Stop

 Properties

Hardware EtherCAT RTX (PAC) EtherCAT motion card

Supported Y Y

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.
Press the Find Slave key (as shown in figure 3.2.2.1) to start searching the connecting
modules.
For more information about the interface card initialization, please see “Activate interface
card” and “Initialize interface card” in section 3.1.2.

3-6 March, 2017


EtherCAT Programming Guide EtherCAT Operation Example

(2) Enter the parameter for motion control

3
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”
in the API function.
Timer: Check the Timer box to display the current motion status.
StrVel.: Input motion speed for homing (pulse sent per second). The parameter
“FirstSpeed” in the API function.
MaxVel.: Input the motion speed after homing to the next index pulse (pulse sent per
second). The parameter “SecondSpeed” in the API function.
Acc.: Input the duration to accelerate to the target speed. The parameter “Tacc” in the API
function.

(3) Set the parameters for homing (homing mode and offset value)

Figure 3.2.2.3

Mode: Homing mode 1 ~ 35. The parameter “Mode” in the API function.
Offset: Homing offset. The parameter “Offset” in the API function.

(4) Set the servo motor to ON/OFF state (servo on/servo off)

Figure 3.2.2.4

Press the SVON key (as shown in figure 3.2.2.4) to execute the following program:
RetCode = _ECAT_Slave_Motion_Set_Svon(gESCCardNo, gNodeID, gSlotID,ON_OFF);
// ON_OFF
// 0: Servo OFF
// 1: Servo ON

March, 2017 3-7


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,

3 StrVel, MaxVel, Tacc);


/* Set homing mode: 1 ~ 35, offset and speed parameters, but the servo will not operate
now. */
RetCode = _ECAT_Slave_Home_Move(gESCCardNo, gNodeID, gSlotID);
/* Start homing according to the set parameters. */

(6) Stop homing


To stop homing, press the STOP key (as shown in figure 3.2.2.4) to execute the following
program:
RetCode = _ECAT_Slave_Motion_Sd_Stop(gESCCardNo, gNodeID, gSlotID, Tdec);
/* Interrupt homing process. */

(7) Exit program


Press the Exit key to exit and close the program.
Execute “_ECAT_Master_Reset” and “_ECAT_Master_Close” to exit the function. Detailed
description about these two API is presented in section 3.1.2 Exit program.

3-8 March, 2017


EtherCAT Programming Guide EtherCAT Operation Example

3.3 Torque control


3.3.1 Function list

3
Function name

_ECAT_Slave_PT_Start_Move

_ECAT_Slave_Motion_Emg_Stop

 Properties

Hardware EtherCAT RTX (PAC) EtherCAT motion card

Supported Y Y

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.
Press the Find Slave key (as shown in figure 3.3.2.1) to start searching the connecting
modules.
For more information about the interface card initialization, please see “Activate interface
card” and “Initialize interface card” in section 3.1.2.

March, 2017 3-9


EtherCAT Operation Example EtherCAT Programming Guide

(2) Set Node ID and Slot ID for the servo drive and enable motion status display

3 Figure 3.3.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”
in the API function.
Timer: Check the Timer box to display the current motion status.

(3) Enter the Slop and Ratio values

Figure 3.3.2.3

Slop: Input the required time for the rated torque. (unit: ms)
Ratio: Input the permillage of the rated torque value. For example, if the ratio value is 20,
the rated torque will be 2%.

(4) Set the servo motor to ON/OFF state (servo on/servo off)

Figure 3.3.2.4

Press the SVON key (as shown in figure 3.3.2.4) to execute the following program:
RetCode = _ECAT_Slave_Motion_Set_Svon(gESCCardNo, gNodeID, gSlotID, ON_OFF);
// ON_OFF:
// 0: Servo OFF.
// 1: Servo ON.

(5) Torque control


Press the Move key (as shown in figure 3.3.2.4) to execute the following program:
RetCode = _ECAT_Slave_PT_Start_Move(gESCCardNo, gNodeID, gSlotID, Torque,
Slope);
/* Set torque parameters and enable torque control. */
// The motor will run in forward direction if the torque value is greater than 0, and run in
reverse direction if the value is smaller than 0.

3-10 March, 2017


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);

3
/* 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);
// 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).

Motion status:
RetCode = _ECAT_Slave_Motion_Get_StatusWord(gESCCardNo, gNodeID, gSlotID,
&Status);
// Get the current motion status (IO Sts. field).
RetCode = _ECAT_Slave_Motion_Get_Mdone(gESCCardNo, gNodeID, gSlotID,
&MCDone);
// Get the current status of the motor (Motion field).

(7) Reset feedback and clear alarm


Press the RESET key (as shown in figure 3.3.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).
RetCode = _ECAT_Slave_Motion_Set_Command(gESCCardNo,gNodeID,gSlotID,0);
// Then, clear the command.

Press the RALM key (as shown in figure 3.3.2.4) to execute the alarm clearing command:
RetCode = _ECAT_Slave_Motion_Ralm(gESCCardNo, gNodeID, gSlotID);
// Clear the alarm of slave station.

(8) Exit program


Press the Exit key to exit and close the program.
Execute “_ECAT_Master_Reset” and “_ECAT_Master_Close” to exit the function. Detailed
description about these two API is presented in section 3.1.2 Exit program.

March, 2017 3-11


EtherCAT Operation Example EtherCAT Programming Guide

3.4 Constant speed control


3.4.1 Function list

3
Function name
_ECAT_Slave_PV_Start_Move
_ECAT_Slave_Motion_Sd_Stop

 Properties

Hardware EtherCAT RTX (PAC) EtherCAT motion card

Supported Y Y

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.
Press the Find Slave key (as shown in figure 3.4.2.1) to start searching the connecting
modules.
For more information about the interface card initialization, please see “Activate interface
card” and “Initialize interface card” in section 3.1.2.

3-12 March, 2017


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.
3
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 motion status.

(3) Enter the acceleration/deceleration time and rotation speed per minute (rpm).

Figure 3.4.2.3

Velocity: Input the target speed. The parameter “RPM” in the API function. *The actual
rpm value is 0.1 time of the variable Velocity.
Acc: Input the duration from current speed to target speed. The parameter “Tacc” in the
API function.
Dec: Input the duration to decelerate from current speed to 0. The parameter “Tdec” in the
API function.

(4) Set the servo motor to ON/OFF state (servo on/servo off)

Figure 3.4.2.4

Press the SVON key (as shown in figure 3.4.2.4) to execute the following program:
RetCode = _ECAT_Slave_Motion_Set_Svon(gESCCardNo, gNodeID, gSlotID, ON_OFF);
// ON_OFF:
// 0: Servo OFF.
// 1: Servo ON.

March, 2017 3-13


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,

3 Tacc, Tdec);
/* Set the parameters of speed mode (the acceleration and deceleration time) and enable
speed control. */
// The servo motor will run in forward direction if the rpm value is greater than 0, and will
run in reverse direction when the rpm value is smaller than 0.

Press the STOP key (as shown in figure 3.4.2.4) to execute the following program:
RetCode = _ECAT_Slave_Motion_Emg_Stop(gESCCardNo, gNodeID, gSlotID);

(6) Status display

Figure 3.4.2.5

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).

Motion status:
RetCode = _ECAT_Slave_Motion_Get_Current_Speed(gESCCardNo,gNodeID, gSlotID,
&Spd);
// Get the current moving speed (SPD. field).
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)

3-14 March, 2017


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).
RetCode = _ECAT_Slave_Motion_Set_Command(gESCCardNo,gNodeID,gSlotID,0);
// Then clear the command.
3
Press the RALM key (as shown in figure 3.4.2.4) to execute the alarm clearing command:
RetCode = _ECAT_Slave_Motion_Ralm(gESCCardNo, gNodeID, gSlotID);
// Clear the alarm of slave station.

(8) Exit program


Press the Exit key to exit and close the program.
Execute “_ECAT_Master_Reset” and “_ECAT_Master_Close” to exit the function. Detailed
description about these two API is presented in section 3.1.2 Exit program.

March, 2017 3-15


EtherCAT Operation Example EtherCAT Programming Guide

3.5 Motion control in PP mode


3.5.1 Function list

3
Function name

_ECAT_Slave_PP_Start_Move

_ECAT_Slave_Motion_Sd_Stop

 Properties

Hardware EtherCAT RTX (PAC) EtherCAT motion card

Supported Y Y

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.
Press the Find Slave key (as shown in figure 3.5.2.1) to start searching the connecting
modules.
For more information about the interface card initialization, please see “Activate interface
card” and “Initialize interface card” in section 3.1.2.

3-16 March, 2017


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.
3
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 motion status.

(3) Enter the parameter for motion control

Figure 3.5.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.
*The servo drive accelerates to the initial speed set in StrVel at its max. speed. Then, it
accelerates to the constant speed set in MaxVel with the acceleration time set in Acc.
MaxVel.: Input the constant speed. The parameter “MaxVel” in the API function.
Acc.: Input the duration from initial speed to constant speed. The parameter “Tacc” in the
API function.
Dec.: Input the duration to decelerate from the constant speed to 0. The parameter “Tdec”
in the API function.
ABS.: Check this box to have the motion conducted according to the absolute coordinates
set in Dist.

March, 2017 3-17


EtherCAT Operation Example EtherCAT Programming Guide

(4) Set the servo motor to ON/OFF state (servo on/servo off)

3 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:
// 0: Servo OFF
// 1: Servo ON

(5) Start to control the motion speed


Press the ← or → key (as shown in figure 3.5.2.4) to execute the following program:
RetCode = _ECAT_Slave_PP_Start_Move(gESCCardNo, gNodeID, gSlotID, Dist, StrVel,
MaxVel, Tacc, Tdec, gbIsABS);
// gblsABS
// 0: relative movement
// 1: absolute movement

(6) Stop the motion


Press the STOP key (as shown in figure 3.5.2.4) to enable emergency stop:
RetCode = _ECAT_Slave_Motion_Emg_Stop(gESCCardNo, gNodeID, gSlotID);
In this example, the movement is stopped urgently by setting the deceleration time to 0.

(7) Status display

Figure 3.5.2.5

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).

3-18 March, 2017


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);
3
// 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:
RetCode = _ECAT_Slave_Motion_Set_Position(gESCCardNo, gNodeID, gSlotID, 0);
// Clear feedback first (Value showed in servo drive panel will be set to 0).
RetCode = _ECAT_Slave_Motion_Set_Command(gESCCardNo, gNodeID, gSlotID, 0);
// Then, clear the command.

Press the RALM key (as shown in figure 3.5.2.4) to execute the alarm clearing command:
RetCode = _ECAT_Slave_Motion_Ralm(gESCCardNo, gNodeID, gSlotID);
// Clear the alarm of slave station

(9) Exit program


Press the Exit key to exit and close the program.
Execute “_ECAT_Master_Reset” and “_ECAT_Master_Close” to exit the function. Detailed
description about these two API is presented in section 3.1.2 Exit program.

March, 2017 3-19


EtherCAT Operation Example EtherCAT Programming Guide

3.6 Motion control in CSP mode


3.6.1 Function list

3
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

Hardware EtherCAT RTX (PAC) EtherCAT motion card

Supported Y Y

3-20 March, 2017


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.
For more information about the interface card initialization, please see “Activate interface
card” and “Initialize interface card” in section 3.1.2.

(2) Select Node ID and Slot ID for the servo drive and enable motion status display

Figure 3.6.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”
in the API function.
Timer: Check the Timer box to display the current motion status.

March, 2017 3-21


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)
Arc2: Type 2 arc interpolation control (with the known end point and angle)
Arc3: Type 3 arc interpolation control (with the known circle center and end point)
Spiral: Type 1 spiral interpolation control (with the known circle center and angle)
Spiral2: Type 2 spiral interpolation control (with the known end point and circle
number)
Three-axis motion control:
Helix: Helical interpolation control
Line3: Linear interpolation control
Sphere: Three-axis sphere motion control

3-22 March, 2017


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.
EndVel: Input the end speed when it reaches the target position. The parameter “EndVel”
in the API function.
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.
S-Curve: Check this box to use S-Curve for the speed curve. Otherwise, it will use
T-Curve.
ABS.: Check this box to have the motion conducted according to absolute coordinates set
in Dist.

(5) Set the servo motor to ON/OFF state (servo on/servo off)

Figure 3.6.2.4

March, 2017 3-23


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);

3 // ON_OFF:
// 0: Servo OFF
//1: Servo ON

(6) Select P To P and start the point to point motion control


Press the ← or → key (as shown in figure 3.6.2.4) to execute the following program:
RetCode = _ECAT_Slave_CSP_Start_Move(gESCCardNo, gNodeID[0], gSlotID[0],
Dist[0], StrVel, ConstVel, EndVel, Tacc, Tdec, gbIsSCurve, gbIsABS);
// gblsSCurve
// 1: T-Curve
// 2: S-Curve
// gblsABS
// 0: Relative movement
// 1: Absolute movement

(7) Change the position or speed in P To P mode

Figure 3.6.2.5
Press the ← or → key (as shown in figure 3.6.2.4) to select P To P motion control. To
replace the current position with a new position, press the Change key in Position Change
section (as shown in figure 3.6.2.5) to execute the following program:
RetCode = _ECAT_Slave_CSP_TargetPos_Change(gESCCardNo, gNodeID[0],
gSlotID[0], NewPos);
// Replace the current position with a new position.

To replace the current speed with a new speed, press the Change key in Velocity Change
section (as shown in figure 3.6.2.5) to execute the following program:
RetCode = _ECAT_Slave_CSP_Velocity_Change(gESCCardNo, gNodeID[0], gSlotID[0],
NewSpd, NewTdec);
// Replace the current speed with a new speed.

3-24 March, 2017


EtherCAT Programming Guide EtherCAT Operation Example

(8) Set the Gear or software limit in P To P mode

3
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
execute the following program:
RetCode = _ECAT_Slave_CSP_Set_Gear(gESCCardNo, gNodeID[0], gSlotID[0],
Numerator, Denominator, Enable);
// Set new gear values.

To set the software limit, press the Set key in the Set Soft Limit section (as shown in figure
3.6.2.6) to execute the following program:
RetCode = _ECAT_Slave_CSP_Set_Softlimit(gESCCardNo, gNodeID[0], gSlotID[0],
MLimit, PLimit, Enable);
// Set software limit values.

(9) Set the value for Feedrate Overwrite in P To P mode.

Figure 3.6.2.7
Press the ← or → key (as shown in figure 3.6.2.4) to execute P To P motion control.
To set the value of Feedrate Overwrite, drag the scrollbar (as shown in figure 3.6.2.7)
to execute the following program:
RetCode = _ECAT_Slave_CSP_Feedrate_Overwrite(gESCCardNo, gNodeID[0],
gSlotID[0], 2, NewSpd, 0.1);
// Mode=2; Users can change the speed and the speed (vector) of all motion commands
whether the command is being executed.
// Speed ratio

March, 2017 3-25


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,

3 StrVel, MaxVel, Tacc, gbIsSCurve);


// gblsSCurve
// 1: T-Curve
// 2: S-Curve

(11) Two-axis motion mode (Line2, Spiral, Spiral2) and its settings

Figure 3.6.2.8

Line2 parameter settings: Two-axis linear interpolation


Dist1: Input the moving distance of axis X. The parameter “DistX” in the API function.
Dist2: Input the moving distance of axis Y. The parameter “DistY” 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.
EndVel: Input the end speed when it reaches the target position. The parameter “EndVel”
in the API function.
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.
S-Curve: Check this box to use S-Curve for the speed curve. Otherwise, it will use
T-Curve.
ABS.: Check this box to have the motion conducted according to absolute coordinates set
in Dist.

3-26 March, 2017


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.
3
Inter: Input the relative distance between the known spiral pitches. The parameter
“Spiral_Interval” in the API function.
Angle: Input the angle of the spiral movement. The parameter “Angle” 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.
EndVel: Input the end speed when it reaches the target position. The parameter “EndVel”
in the API function.
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.
S-Curve: Check this box to use S-curve for the speed curve. Otherwise, it will use
T-Curve.
ABS.: Check this box to have the motion conducted according to absolute coordinates set
in Dist.

Spiral2 parameter settings: Type 2 of spiral interpolation (with the know end point and
circle number)
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.
EndX: Input the target position of X-coordinate. The parameter “EndPoint” in the API
function.
EndY: Input the target position of Y-coordinate. The parameter “EndPoint” in the API
function.
Num: Input the circle number of the spiral movement. The parameter “CycleNum” in the
API function.
Dir: Input the moving direction (0: Clockwise, 1: Anticlockwise). The parameter “Dir” 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.
EndVel: Input the end speed when it reaches the target position. The parameter “EndVel”
in the API function.

March, 2017 3-27


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”

3 in the API function.


S-Curve: Check this box to use S-curve for the speed curve. Otherwise, it will use
T-Curve.
ABS.: Check this box to have the motion conducted according to absolute coordinates set
in Dist.

(12) Set the servo motor to ON/OFF state (servo on/servo off)
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

(13) Select Line2 for two-axis linear motion control


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, 2, gNodeID,
gSlotID, Dist, StrVel, MaxVel, EndVel, Tacc, Tdec, gbIsSCurve, gbIsABS);
// gblsSCurve
// 1: T-Curve
// 2: S-Curve
// gblsABS
// 0: Relative movement
// 1: Absolute movement

(14) Select Spiral for two-axis arc motion control (center 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_Spiral_Move(gESCCardNo,gNodeID, gSlotID,
CenPoint, Spiral_Interval, Angle, StrVel, MaxVel, EndVel, Tacc, Tdec, gbIsSCurve,
gbIsABS);
// gblsSCurve
// 1: T-Curve
// 2: S-Curve
// gblsABS
// 0: Relative movement
// 1: Absolute movement

3-28 March, 2017


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);
// gblsSCurve
3
// 1: T-Curve
// 2: S-Curve
// gblsABS
// 0: Relative movement
// 1: Absolute movement

(16) Two-axis motion mode (Arc, Arc2, Arc3) and the settings

Figure 3.6.2.9

Arc parameter settings: Type 1 of arc interpolation (with the known arc’s 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.
Angle: Set the arc angle. The parameter “Angle” 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.
EndVel: Input the end speed when it reaches the target position. The parameter “EndVel”
in the API function.
TPhase1: Input the duration from initial speed to constant speed. The parameter

March, 2017 3-29


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.

3 S-Curve: Check this box to use S-curve for the speed curve. Otherwise, it will use
T-Curve.
ABS.: Check this box to have the motion conducted according to absolute coordinates set
in Dist.

Arc2 parameter settings: Type 2 of arc interpolation (with the known arc’s end point and
angle)
EndX: Input the target position of X-coordinate. The parameter “EndPoint” in the API
function.
EndY: Input the target position of Y-coordinate. The parameter “EndPoint” in the API
function.
Angle: Set the arc angle. The parameter “Angle” 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.
EndVel: Input the end speed when it reaches the target position. The parameter “EndVel”
in the API function.
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.
S-Curve: Check this box to use S-curve for the speed curve. Otherwise, it will use
T-Curve.
ABS.: Check this box to have the motion conducted according to absolute coordinates set
in Dist.

Arc3 parameter settings: Type 3 of arc interpolation (with the known arc’s circle center
and end point)
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.
EndX: Input the target position of X-coordinate. The parameter “EndPoint” in the API
function.
EndY: Input the target position of Y-coordinate. The parameter “EndPoint” in the API
function.
Dir: Input the moving direction (0: Clockwise, 1: Anticlockwise). The parameter “Dir” in the
API function.

3-30 March, 2017


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”
in the API function.
TPhase1: Input the duration from initial speed to constant speed. The parameter
“TPhase1” in the API function.
3
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.
ABS.: Check this box to have the motion conducted according to absolute coordinates set
in Dist.

(17) Set the servo motor to ON/OFF state (servo on/servo off)
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

(18) Select Arc for two-axis arc motion (circle center and angle)
Press the ← or → key (as shown in figure 3.6.2.4) to execute the following program:
RetCode = _ECAT_Slave_CSP_Start_Arc_Move(gESCCardNo, gNodeID, gSlotID,
CenPoint, Angle, StrVel, ConstVel, EndVel, Tacc, Tdec, gbIsSCurve, gbIsABS);
// gblsSCurve
// 1: T-Curve
// 2: S-Curve
// gblsABS
// 0: Relative movement
// 1: Absolute movement

March, 2017 3-31


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,

3 gSlotID, EndPoint, Angle, StrVel, MaxVel, EndVel, Tacc, Tdec, gbIsSCurve,


gbIsABS);
// gblsSCurve
// 1: T-Curve
// 2: S-Curve
// gblsABS
// 0: Relative movement
// 1: Absolute movement

(20) Select Spiral2 for two-axis arc motion (circle center and end point)
Press the ← or → key (as shown in figure 3.6.2.4) to execute the following program:
RetCode = _ECAT_Slave_CSP_Start_Arc3_Move(gESCCardNo, gNodeID, gSlotID,
CenPoint,EndPoint,Dir,StrVel, ConstVel,EndVel,Tacc,Tdec,gbIsSCurve, gbIsABS);
// gblsSCurve
// 1: T-Curve
// 2: S-Curve
// gblsABS
// 0: Relative movement
// 1: Absolute movement

(21) Three-axis motion mode (Heli, Line3, Sphere) and the settings

Figure 3.6.2.10

3-32 March, 2017


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.
Depth: Input the depth of the specified axis (the overall height of Z-axis). The parameter
3
“Depth” in the API function.
Pitch: Specify the pitch of the helix. The parameter “Pitch” in the API function.
Dir: Input the moving direction (0: Clockwise, 1: Anticlockwise). The parameter “Dir” 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.
EndVel: Input the end speed when it reaches the target position.The parameter “EndVel” in
the API function.
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.
S-Curve: Check this box to use S-curve for the speed curve. Otherwise, it will use T-Curve.
ABS.: Check this box to have the motion conducted according to absolute coordinates set in
Dist.

Line3 parameter settings: Linear interpolation.


Dist1: The moving distance of X-axis. The parameter “DistArray” in the API function.
Dist2: The moving distance of Y-axis. The parameter “DistArray” in the API function.
Dist3: The moving distance of Z-axis. The parameter “DistArray” 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.
EndVel: Input the end speed when it reaches the target position. The parameter “EndVel” in
the API function.
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.
S-Curve: Check this box to use S-curve for the speed curve. Otherwise, it will use T-Curve.
ABS.: Check this box to have the motion conducted according to absolute coordinates in
Dist.

March, 2017 3-33


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.

3 PosY1: The point to be passed through on Y-axis (between starting and end point). The
parameter “Target1Point” in the API function.
PosZ1: The point to be passed through on Z-axis (between starting and end point). The
parameter “Target1Point” in the API function.
PosX2: The target coordinate of X-axis. The parameter “Target2Point” in the API function.
PosY2: The target coordinate of Y-axis. The parameter “Target2Point” in the API function.
PosZ2: The target coordinate of Z-axis. The parameter “Target2Point” 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.
EndVel: Input the end speed when it reaches the target position. The parameter “EndVel” in
the API function.
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.
S-Curve: Check this box to use S-curve for the speed curve. Otherwise, it will use T-Curve.
ABS.: Check this box to have the motion conducted according to absolute coordinates in
Dist.

(22) Set the servo motor to ON/OFF state (servo on/servo off)
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

(23) Select Heli for three-axis helical motion


Press the ← or → key (as shown in figure 3.6.2.4) to execute the following program:
RetCode = _ECAT_Slave_CSP_Start_Heli_Move(gESCCardNo, gNodeID, gSlotID,
CenPoint,Depth,Pitch,Dir,StrVel,ConstVel,EndVel,Tacc,Tdec,gbIsSCurve,gbIsABS);
// gblsSCurve
// 1: T-Curve
// 2: S-Curve
// gblsABS
// 0: Relative movement
// 1: Absolute movement

3-34 March, 2017


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);
// gblsSCurve
// 1: T-Curve
// 2: S-Curve
// gblsABS
// 0: Relative movement
// 1: Absolute movement.

(25) Select Sphere for three-axis sphere motion


Press the ← or → key (as shown in figure 3.6.2.4) to execute the following program:
RetCode = _ECAT_Slave_CSP_Start_Sphere_Move(gESCCardNo, gNodeID, gSlotID,
Dist, Dist2, StrVel, ConstVel, EndVel, Tacc, Tdec, gbIsSCurve, gbIsABS);
// gblsSCurve
// 1: T-Curve
// 2: S-Curve
// gblsABS
// 0: Relative movement
// 1: Absolute movement.

March, 2017 3-35


EtherCAT Operation Example EtherCAT Programming Guide

(26) Status display

3
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).
Motion status:
RetCode = _ECAT_Slave_Motion_Get_Current_Speed(gESCCardNo,gNodeID, gSlotID,
&Spd);
// Get the moving speed (SPD. field).
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).
RetCode = _ECAT_Slave_Motion_Get_Buffer_Length(gESCCardNo, gNodeID, gSlotID,
&BufLen);
// Get the current buffer status (Buffer field).

(27) Reset the feedback position and clear the alarm


Press the RESET key (as shown in figure 3.6.2.4) to execute the following program:
RetCode = _ECAT_Slave_Motion_Set_Position(gESCCardNo, gNodeID, gSlotID, 0);
// Clear feedback first (Value in servo drive panel will be set to 0).
RetCode = _ECAT_Slave_Motion_Set_Command(gESCCardNo, gNodeID, gSlotID, 0);
// Then, clear the command.

Press the RALM key (as shown in figure 3.6.2.4) to execute the alarm clearing command:
RetCode = _ECAT_Slave_Motion_Ralm(gESCCardNo, gNodeID, gSlotID);
// Clear the alarm of slave station.

3-36 March, 2017


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. 3
(29) Exit program
Press the Exit key to exit and close the program.
Execute “_ECAT_Master_Reset” and “_ECAT_Master_Close” to exit the function. Detailed
description about these two API is presented in section 3.1.2 Exit program.

March, 2017 3-37


EtherCAT Operation Example EtherCAT Programming Guide

3.7 Digital input module


3.7.1 Function list

3
Function name

_ECAT_Slave_DIO_Get_Input_Value

 Properties

Hardware EtherCAT RTX (PAC) EtherCAT motion card

Supported Y Y

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.
Press the Find Slave key (see figure 3.7.2.1) to start searching the connecting modules.
For more information about the interface card initialization, please see “Activate interface
card” and “Initialize interface card” in section 3.1.2.

(2) Set Node ID and Slot ID for the module and enable contact status display

Figure 3.7.2.2

Select Node ID and Slot ID and check the Timer box to display the contact status.
Set NodeID: Specify the Node ID to be executed.The parameter “NodeID” and “SlotID” in
the API function.
Timer: Check the Timer box to display the current contact status.

3-38 March, 2017


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.


3

Figure 3.7.2.3

(4) Exit program


Press the Exit key to exit and close the program.
Execute “_ECAT_Master_Reset” and “_ECAT_Master_Close” to exit the function. Detailed
description about these two API is presented in section 3.1.2 Exit program.

March, 2017 3-39


EtherCAT Operation Example EtherCAT Programming Guide

3.8 Digital output module


3.8.1 Function list

3
Function name

_ECAT_Slave_DIO_Set_Output_Value

_ECAT_Slave_DIO_Get_Output_Value

 Properties

Hardware EtherCAT RTX (PAC) EtherCAT motion card

Supported Y Y

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.
Press the Find Slave key (see figure 3.8.3.1) to start searching the connecting modules.
For more information about the interface card initialization, please see “Activate interface
card” and “Initialize interface card” in section 3.1.2.

(2) Set Node ID and Slot ID for the module and enble contact status display

Figure 3.8.3.2

Select Node ID and Slot ID and check the Timer box to display the contact status.
Set NodeID: Specify the Node ID to be executed. The parameters “NodeID” and SlotID” in
the API function.

3-40 March, 2017


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:
3
RetCode = _ECAT_Slave_DIO_Get_Output_Value(gESCCardNo,gNodeID,gSlotID,
&gValue);

As shown in the below figure, DO0 ~ DO15 are the output signals of Y00 ~ Y15 of
R1-EC-70X2 module Port 0.

Figure 3.8.3.3

(4) Exit program


Press the Exit key to exit and close the program.
Execute “_ECAT_Master_Reset” and “_ECAT_Master_Close” to exit the function. Detailed
description about these two API is presented in section 3.1.2 Exit program.

March, 2017 3-41


EtherCAT Operation Example EtherCAT Programming Guide

3.9 Analog input module


3.9.1 Function list

3
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 Y Y

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.
Press the Find Slave key (see figure 3.9.2.1) to start searching the connecting modules.
For more information about the interface card initialization, please see “Activate interface
card” and “Initialize interface card” in section 3.1.2.

(2) Set Node ID for the module and enable contact status display

Figure 3.9.2.2

Select Node ID and check the Timer box to display the contact status.

3-42 March, 2017


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. 3


Figure 3.9.2.3

AD Channel: Select the AD channel (CH 0 ~ 3). The parameter “SlotNo” in the API
function.
AD Mode: Select the AD range. The parameter “RangeMode” in the API function.
Avg Range: Select the sample rate for the wave display. The parameter “AvgMode” in the
API function.
Conversion Time: Select the conversion time. The parameter “Mode” in the API function.

(4) When selecting AD Channel and AD Mode (as shown in figure 3.9.2.3), the following
program is executed:

RetCode = _ECAT_Slave_AIO_Set_Input_RangeMode(gESCCardNo,gNodeID, gSlotID,


Mode);
// SlotID is the channel of analog input

When selecting Avg Range (as shown in figure 3.9.2.3), the following program is
executed:
RetCode = _ECAT_Slave_R1_EC8124_Set_Input_AverageMode(gESCCardNo,
gNodeID, gSlotID, AvgMode);

When selecting Conversion Time (as shown in figure 3.9.2.3), the following program is
executed:
RetCode = _ECAT_Slave_AIO_Set_Input_ConvstFreq_Mode(gESCCardNo, gNodeID,
gSlotID, Mode);

To display Data field (as shown in figure 3.9.2.3), execute the following program:
RetCode = _ECAT_Slave_AIO_Get_Input_Value(gESCCardNo,gNodeID,gSlotID,
&Value);

(5) Exit program


Press the Exit key to exit and close the program.
Execute “_ECAT_Master_Reset” and “_ECAT_Master_Close” to exit the function. Detailed
description about these two API is presented in section 3.1.2 Exit program.

March, 2017 3-43


EtherCAT Operation Example EtherCAT Programming Guide

3.10 Analog output module


3.10.1 Function list

3
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 Y Y

3.10.2 Application examples

Program interface

Figure 3.10.2.1

3-44 March, 2017


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.
For more information about the interface card initialization, please see “Activate interface
3
card” and “Initialize interface card” in section 3.1.2.

(2) Set Node ID for the module and enable contact status display

Figure 3.10.2.2

Select Node ID and check the Timer box to display the contact status.
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 DA Channel and DA mode:

Figure 3.10.2.3

DA Channel: Select the No. of DA Channel (0 ~ 3). The parameter “SlotNo” in the API
function.
DA Mode: Select DA range. The parameter “Mode” in the API function.
Value: Displays the command value of the analog output set by the scrollbar. The
parameter “Value” in the API function.
OutValue: Displays the actual value of analog output. The parameter “Value” in the API
function.
Apply: Press the Apply key and the set voltage in Value will be converted to the actual
output voltage.
Over Range: When this box is checked, the output voltage value will increase by 10%.
Return Code: Displays the DA status.

March, 2017 3-45


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,

3 gSlotID, Mode);
/* Set DA output range */

When the Apply key (as shown in 3.10.2.3) is pressed, the following program will be
executed:
RetCode = _ECAT_Slave_AIO_Set_Output_Value(gESCCardNo, gNodeID, gSlotID,
Value);
/* Set DA output value */

If the Get button in the Return Code section (as shown in 3.10.2.3) is pressed, the
following program will be executed:
RetCode = _ECAT_Slave_R1_EC9144_Get_Output_ReturnCode(gESCCardNo,
gNodeID, gSlotID, &RtCode);
/* Get DA status. */

To acquire the value of analog output module and display in Out Value field (as shown in
3.10.2.3), execute the program below.
RetCode = _ECAT_Slave_AIO_Set_Output_Value(gESCCardNo, gNodeID, gSlotID,
Value);
/* Acquire the value of the analog output module. */

(5) Exit program


Press the Exit key to exit and close the program.
Execute “_ECAT_Master_Reset” and “_ECAT_Master_Close” to exit the function. Detailed
description about these two API is presented in section 3.1.2 Exit program.

3-46 March, 2017


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
3
_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

Hardware EtherCAT RTX (PAC) EtherCAT motion card

Supported N Y

March, 2017 3-47


EtherCAT Operation Example EtherCAT Programming Guide

3.11.2 Application examples

Program interface

Figure 3.11.2.1

(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.
Press the Find Slave key (as shown in figure 3.11.2.1) to start searching the connecting
modules.
For more information about the interface card initialization, please see “Activate interface
card” and “Initialize interface card” in section 3.1.2.

3-48 March, 2017


EtherCAT Programming Guide EtherCAT Operation Example

(2) Select the Card No., Node ID, and QEP

3
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.)
QEP2: Select channel 2 for pulse input. (It should correspond to the physical wiring of QA2
and QB2.)

(3) Select Polarity and Compare Type

Figure 3.11.2.3

High: Select this option to carry out the following program: 1: High (high-level trigger)
rt = _ECAT_Compare_Set_Channel_Polarity (gu16_CardNo, 1);

Low: Select this option to carry out the following program: 0: Low (low-level trigger)
rt = _ECAT_Compare_Set_Channel_Polarity (gu16_CardNo, 0);

Type: Select the differential signal channel for the triggered signal.
rt = _ECAT_Compare_Set_Channel_Source (gu16_CardNo, u16_Channel, gu16_Qep);
// u16_Channel:
// 0 = Channel 0 (CMP_1) for outputting the differential signal. (Compare the pulse at a
fixed pulse interval.)
// 1 = Channel 1 (CMP_2) for outputting the differential signal. (Compare the pulse at
user-defined pulse intervals.)
// gu16_Qep
// 0 = When setting QEP1, this parameter is 0, which means the compared pulse is from
the first QA and QB.
// 1 = When setting QEP2, this parameter is 1, which means the compared pulse is from
the second QA and QB.

March, 2017 3-49


EtherCAT Operation Example EtherCAT Programming Guide

TCount: Number of the compared times.


rt = _ECAT_Compare_Get_Channel1_Position_Table_Count (gu16_CardNo,
&u32_Count);

3 /* 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);
// 1: Enable
// 0: Disable

Inpulse Type: Select between AB Phase or CW_CCW mode. The following program is
executed:
rt = _ECAT_Compare_Set_Ipulser_Mode (gu16_CardNo, mode);
// 0: AB Phase
// 1: CW_CCW

Reset: Press this key to clear the pulse count of QEP1 and QEP2, and the following
program will be executed:
rt = _ECAT_Compare_Set_Channel_Position (gu16_CardNo, u16_Channel, 0);
// 0 represents the pulse number. It means to set the accumulated pulse position to 0.

QEP1 Inverse: Pulse incremental way of QAQB 1. Press this key and the following
program will be executed:
rt = _ECAT_Compare_Set_Channel_Direction (gu16_CardNo, 0, dir);
// 0: Signal source QA1, QB1
// dir:
// 0: Incremented pulse count
// 1: Decremented pulse count

QEP2 Inverse: Pulse incremental way of QAQB 2. Press this key and the following
program will be executed:
rt = _ECAT_Compare_Set_Channel_Direction (gu16_CardNo, 1, dir);
// 1: Signal source QA 2, QB 2
// dir:
// 0 = Incremented pulse count
// 1 = Decremented pulse count

3-50 March, 2017


EtherCAT Programming Guide EtherCAT Operation Example

(5) Settings for pulse comparison

3
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.
Interval: Set the interval for signal to be compared. For example, if the value is set to 10,
signal will be triggered every 10 pulses. And the lasting time is determined by Trigger
Time.
ABS.: Check this box to compare the pulse based on the absolute coordinates.
Level: Check this box and the following program will be executed according to channel 1
(CMP_2), which is used to output differential signal:
rt = _ECAT_Compare_Set_Channel1_Output_Mode (gu16_CardNo, gbLevelValue);
// gbLevelValue: Channel 2 output mode of triggering signal.
// 0: Normal type (Users can define the pulse position).
// 1: User-defined type (Users can define the pulse position and determine the triggering
signal is low or high).

One Shot: Press this key, trigger the signal once and the following program will be
executed:
rt = _ECAT_Compare_Set_Channel_Trigger_Time (gu16_CardNo, u16_Channel,
time_us);
// time_us = The lasting time of this triggered signal; unit: us
rt = _ECAT_Compare_Set_Channel_One_Shot (gu16_CardNo, u16_Channel);
// Actual triggered signal outputted
Set: Select from >>> and <<< (direction) and the following program will be executed:
rt = _ECAT_Compare_Get_Channel_Position (gu16_CardNo, gu16_Qep, &i32_Pos )
// gu16_Qep: Pulse source for comparision
// &i32_Pos: Returns current incremented pulse (current position)

Select Type 0 for applying channel 0 (CMP_1) as the differential signal output channel to
output the triggered signal. (Compare the pulse at a fixed pulse interval)
rt = _ECAT_Compare_Channel0_Position (gu16_CardNo, i32_StartPoint, 0,
u32_CompareCount);
// i32_StartPoint: The starting position for pulse comparison
// u32_CompareCount: Pulse count for comparison

March, 2017 3-51


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

3 Type 0. Users can define different intervals according to the demand.)


Disable the differential signal output function of channel 2 first:
rt = _ECAT_Compare_Set_Channel1_Output_Enable (gu16_CardNo, 0);
// 0: Disable
// 1: Enable

If you do not check the Level box, the following program will be executed:
rt = _ECAT_Compare_Set_Channel1_Position_Table (gu16_CardNo,
&pi32_PointTable[0], u32_CompareCount);
// &pi32_PointTable: Data array. It is used for storing the compared pulse.
// u32_CompareCount: Pulse count comparison, which should be identical to the size of
data array.

Pulse comparison:

Figure 3.11.2.6 Compare the pulse at a fixed pulse interval

If you check the Level box, the following program will be executed:
rt = _ECAT_Compare_Set_Channel1_Position_Table_Level (gu16_CardNo,
&pi32_PointTable[0], &pu32_LevelTable[0], u32_CompareCount);
// &pi32_PointTable: Data array. It is used for storing the compared pulse.
// &pu32_LevelTable: Data array. It is used for storing the triggered level.
// u32_CompareCount: Cout of pulse comparison, which should be identical to the size of
data array.

Pulse comparison:

Figure 3.11.2.7 Compare the pulse at user-defined pulse intervals

3-52 March, 2017


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:


3
Figure 3.11.2.8

Reset: Press this key to reset the command.


P2PMove: Press this key to move forward or backward. And the generated pulse will be
compared by the motion card.
STOP: Press this key to stop the motion.
Command: Display the motion’s current position.

(7) Exit program


Press the Exit key to exit and close the program.
Execute “_ECAT_Master_Reset” and “_ECAT_Master_Close” to exit the function. Detailed
description about these two API is presented in section 3.1.2 Exit program.

March, 2017 3-53


EtherCAT Operation Example EtherCAT Programming Guide

(This page is intentionally left blank.)

3-54 March, 2017


API List of Dynamic-Link
Library
This chapter lists all the APIs, data type and setting range of Delta EtherCAT
Dynamic-link library.

4
4.1 Data Type and Setting Range······························································· 4-2
4.2 API list and descriptions······································································ 4-2

March, 2017 4-1


API List of EtherCAT Dynamic-Link Library EtherCAT Programming Guide

4.1 Data type and value range


The “TYPE_DEF.H” file located in the “inc\VC\” folder (installation directory) defines the
general data type. See the following table. The data type, name, and rage are defined

4 as follows.

Data Type Description Range


U8 8-bit ASCII character 0 ~ 255
I16 16-bit signed integer -32768 ~ 32767
U16 16-bit unsigned integer 0 ~ 65535
I32 32-bit signed long integer -2147483648 ~ 2147483647
U32 32-bit unsigned long integer 0 ~ 4294967295
F32 32-bit single-precision floating-point -3.402823E38 ~ 3.402823E38

-1.797683134862315E308 ~
F64 64-bit double-precision floating point
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.
_ECAT_Master_NodeID_Alias_Enable
*Set before initialization.
_ECAT_Master_Get_SerialNo Get the serial No. of PAC or the motion card.

_ECAT_Master_Get_DLL_SeqID Acquire the sequence ID of the current DLL.


Read and apply the configuration file of the
_ECAT_Autoconfig_Open_File communication topology and DC data for system
initialization. *Set before initialization.
Save the current communication topology and DC
_ECAT_Autoconfig_Save_File
data to the configuration file.
_ECAT_Autoconfig_Set_Slave_DCTime Set the DC time of each node.
Clear the currently imported EtherCAT master
_EACT_Autoconfig_Clear_ConfigFile
configuration.
Set user-defined station alias of each node. *Set after
_ECAT_Autoconfig_Set_NodeID_Alias
initialization.
Acquire the user-defined station alias of each node.
_ECAT_Autoconfig_Get_NodeID_Alias
*Set after initialization.
Save the user-defined station alias to the module
_ECAT_Autoconfig_Save_NodeID_Alias
memory block.

4-2 March, 2017


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.

4
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.
Disable all functions of EtherCAT master and
_ECAT_Master_Close
kernels and release the memory
_ECAT_Master_Get_CardSeq Acquire motion card No.
Acquire slave quantity on the communication bus
_ECAT_Master_Get_SlaveNum
of the specified EtherCAT master
_ECAT_Master_Get_Slave_Info Acquire EtherCAT slave information
Acquire the motion card's DC status, time and
_ECAT_Master_Get_DC_Status
time offset
_ECAT_Master_Get_Connect_Status Acquire EtherCAT master’s connection status
Acquire the command amount of each slave that
_ECAT_Master_Get_Api_BufferLength
has not been completed
Acquire the time spent on Tx and Rx every cycle
_ECAT_Master_Get_Cycle_SpendTime
and the maximum consuming time in the log
Check whether the DLL initialization has been
_ECAT_Master_Check_Initial_Done
completed.
_ECAT_Master_Get_Initial_ErrorCode Acquire the error code when error occurs
Acquire the current connection status of EtherCAT
_ECAT_Master_Check_Working_Counter
communication
Acquire the corresponding message of each
_ECAT_Master_Get_Return_Code_Message
return code

EtherCAT CoE Standard Communication

_ECAT_Slave_SDO_Send_Message Issue SDO command (CANopen) to the slave


Acquire the current SDO data (CANopen) of the
_ECAT_Slave_SDO_Read_Message
slave
Issue SDO command (CANopen) to the slave
_ECAT_Slave_SDO_Quick_Send_Message
without waiting for the response
Issue SDO read command (CANopen) to the
_ECAT_Slave_SDO_Quick_Read_Message
slave without waiting for the response
_ECAT_Slave_SDO_Read_Response Read the returned data from the slave.
Wait multiple slaves to complete all the SDO
_ECAT_Slave_SDO_Wait_All_Done
commands.
Acquire the error code of
ERR_ECAT_SDO_Return that returned during the
execution of SDO Send_Message or
_ECAT_Slave_SDO_Get_ErrorCode
Read_Message. Please refer to CANopen
protocol or the definition of each device for error
code.
Check if the specified slave has completed all the
_ECAT_Slave_SDO_Check_Done
SDO commands
Read the data of an OD index in the PDO
_ECAT_Slave_PDO_Get_OD_Data
mapping
Send the data of an OD index in the PDO
_ECAT_Slave_PDO_Set_OD_Data
mapping

March, 2017 4-3


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

4
_ECAT_Slave_PDO_Get_Detail_Mapping
device
_ECAT_Slave_PDO_Get_Rx_Data Acquire all slave Rx data of the PDO mapping

_ECAT_Slave_PDO_Get_Tx_Data Acquire all slave Tx data of the PDO mapping

_ECAT_Slave_PDO_Set_Tx_Detail_Data Configure all slave Tx data of the PDO mapping

General Operation of Motion Axis

_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.
Set the deceleration time for motor to decelerate
_ECAT_Slave_Motion_Sd_Stop
to stop
This is for emergency stop of the axis. The motor
_ECAT_Slave_Motion_Emg_Stop
will stop with its maximum deceleration
_ECAT_Slave_Motion_Set_Alm_Reaction Set the action when alarm occurs

_ECAT_Slave_Motion_Set_Position Specify current feedback position of the axis

_ECAT_Slave_Motion_Set_Command Set the motion command data of the axis

_ECAT_Slave_Motion_Set_MoveMode Set the motion mode of the axis

_ECAT_Slave_Motion_Get_MoveMode Acquire the information of current motion mode

_ECAT_Slave_Motion_Get_ControlWord Acquire the current control word of the axis

_ECAT_Slave_Motion_Get_StatusWord Acquire the current status word of the axis.

_ECAT_Slave_Motion_Get_Mdone Acquire the current status of motion done

_ECAT_Slave_Motion_Get_Position Acquire the current position of the axis.

_ECAT_Slave_Motion_Get_Command Acquire the current command information

_ECAT_Slave_Motion_Get_Target_Command Acquire the target command data of the axis

_ECAT_Slave_Motion_Get_Actual_Position Acquire the actual position command of the axis

Acquire the current command data. The data will


_ECAT_Slave_Motion_Get_Actual_Command
vary with to the applied motion mode.
_ECAT_Slave_Motion_Get_Current_Speed Acquire the current speed of the axis

_ECAT_Slave_Motion_Get_Torque Acquire the feedback torque from the motor


Acquiring the quantity of the commands that have
_ECAT_Slave_Motion_Get_Buffer_Length
not been carried out
Set the mode of the first Touch Probe function
_ECAT_Slave_Motion_Set_TouchProbe_Config
(Touch Probe 1)
Enable the first Touch Probe function (Touch
_ECAT_Slave_Motion_Set_TouchProbe_QuickStart
Probe 1)
Execute the first Touch Probe function (Touch
_ECAT_Slave_Motion_Set_TouchProbe_QuickDone
Probe 1) again
Disable the first Touch Probe function (Touch
_ECAT_Slave_Motion_Set_TouchProbe_Disable
Probe 1)
Acquire the current status of the first Touch Probe
_ECAT_Slave_Motion_Get_TouchProbe_Status
function (Touch Probe 1)
Acquire the current position of first Touch Probe
_ECAT_Slave_Motion_Get_TouchProbe_Position
function (Touch Probe 1)

4-4 March, 2017


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

4
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
Execute two-axis arc motion, moving from current
_ECAT_Slave_CSP_Start_Arc2_Move position and the specified circle center to form the
specified arc’s angle
Execute two-axis arc motion, moving from the
_ECAT_Slave_CSP_Start_Arc3_Move current position and specified circle center to the
specified end point
Execute two-axis spiral motion, moving from
_ECAT_Slave_CSP_Start_Spiral_Move current position and the specified circle center to
form the specified angle
Execute two-axis spiral motion, moving from
_ECAT_Slave_CSP_Start_Spiral2_Move current position and the specified circle center to
the end point with the specified cycle number.
Execute three-axis sphere motion and moving
from current position and the known circle center
_ECAT_Slave_CSP_Start_Sphere_Move
to the target position with three-dimensional
vector
Set three-axis helical motion, moving from current
_ECAT_Slave_CSP_Start_Heli_Move position and the known circle center to the
specified height in Z-axis direction
_ECAT_Slave_CSP_Start_Multiaxes_Move Execute multi-axis linear motion
Execute multi-axis point to point motion with
_ECAT_Slave_CSP_Start_Msbrline_Move
smooth speed
_ECAT_Slave_CSP_Set_Gear Set the E-gear ratio

_ECAT_Slave_CSP_Set_Softlimit Set the software limit

_ECAT_Slave_CSP_TargetPos_Change Set a new target position

_ECAT_Slave_CSP_Velocity_Change Set a new target speed


For the advanced setting of speed change for
_ECAT_Slave_CSP_Feedrate_Overwrite
single axis

_ECAT_Slave_CSP_Speed_Continue_Enable Enable or disable the continuous speed function

_ECAT_Slave_CSP_Speed_Continue_Set_Mode Set the continuous speed mode


_ECAT_Slave_CSP_Speed_Continue_Set_Combine Set the percentage of for starting blending speed
_Ratio of two commands.
Set the ratio of S-curve and T-curve during
_ECAT_Slave_CSP_Scurve_Rate
acceleration and deceleration
Set the speed (vector) of advanced interpolation
_ECAT_Slave_CSP_Liner_Speed_Master
function
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
axes
Enable the function of synchronous motion of
_ECAT_Slave_CSP_Sync_Move
multiple axes
Set to smooth the operation of point-to-point
_ECAT_Slave_CSP_Start_Mabrline_Move
motion of multiple axes

March, 2017 4-5


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

4
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
_ECAT_Slave_CSP_Start_PVTComplete_Move single-axis motion, moving through multiple points
at fixed time.
_ECAT_Slave_CSP_Virtual_Set_Enable Enable function of virtual position
Set the virtual position and replacing the current
_ECAT_Slave_CSP_Virtual_Set_Command
position with the specified position
_ECAT_Slave_CSP_Get_SoftLimit_Status Acquire the status of software limit

_ECAT_Slave_CSP_Pitch_Set_Interval Set the interval of the pitch error compensation

_ECAT_Slave_CSP_Pitch_Set_Mode Set the mode of pitch error compensation

_ECAT_Slave_CSP_Pitch_Set_Org Set the start position of pitch error compensation.


Set the relative position of each interval for pitch
_ECAT_Slave_CSP_Pitch_Set_Rel_Table
error compensation
Set the absolute position of each interval for pitch
_ECAT_Slave_CSP_Pitch_Set_Abs_Table
error compensation
_ECAT_Slave_CSP_Pitch_Set_Enable Enable function of pitch error compensation.

Cyclic Synchronous Velocity Mode (CSV)

_ECAT_Slave_CSV_Start_Move Execute single-axis motion with the setting speed

Execute multi-axes synchronous motion with the


_ECAT_Slave_CSV_Multi_Start_Move
setting speed

Cyclic Synchronous Torque Mode (CST)

_ECAT_Slave_CST_Start_Move Execute single-axis motion with the setting torque

Execute multi-axis synchronous motion with the


_ECAT_Slave_CST_Multi_Start_Move
setting torque

Homing

_ECAT_Slave_Home_Config Set the homing mode

_ECAT_Slave_Home_Move Execute homing

_ECAT_Slave_Home_Status Acquire the current homing status

Profile Position Mode (PP)

_ECAT_Slave_PP_Start_Move Execute single-axis linear motion in PP mode

_ECAT_Slave_PP_Advance_Config Advanced setting of PP mode

4-6 March, 2017


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
4
_ECAT_Slave_VL_Start_Move
speed. (Delta inverter only)

Profile Torque Mode (PT)


Execute the single-axis motion with constant torque
_ECAT_Slave_PT_Start_Move
in PT mode
_ECAT_Slave_PT_Advance_Config Advanced setting of PT mode

Group Motion Control

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
Mode
_ECAT_Slave_User_Motion_Control_ Svon and

_ECAT_Slave_User_Motion_Control_Get_Alm to

confirm the status of each axis.

_ECAT_Slave_User_Motion_Control_Get_Enable_
Acquire the status in the current group.
Mode

_ECAT_Slave_User_Motion_Control_Set_Type Set the motion mode in the specified group.

_ECAT_Slave_User_Motion_Control_Set_Data Set the data of each axis in the specified group.

_ECAT_Slave_User_Motion_Control_Clear_Data Clear the data of each axis in the specified group.

Read the data number that have not been


_ECAT_Slave_User_Motion_Control_Get_DataCnt
processed in the specified group.

_ECAT_Slave_User_Motion_Control_ Ralm Reset the alarm of all axes in the specified group.

_ECAT_Slave_User_Motion_Control_ Svon Enable/disable all axes in the specified group.

Acquire the current alarm status in the specified


_ECAT_Slave_User_Motion_Control_Get_Alm
group.

Operation of DI/DO module


_ECAT_Slave_DIO_Get_Input_Value Acquire the DI status

_ECAT_Slave_DIO_Get_Output_Value Acquire the DO status

_ECAT_Slave_DIO_Set_Output_Value Set the DO status

_ECAT_Slave_DIO_Get_Single_Input_Value Acquire the input value of the specified channel

_ECAT_Slave_DIO_Get_Single_Output_Value Acquire the output value of the specified channel

_ECAT_Slave_DIO_Set_Single_Output_Value Set the output value of the specified channel

March, 2017 4-7


API List of EtherCAT Dynamic-Link Library 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

4 _ECAT_Slave_DIO_Set_Output_Error_Value
communication is disconnected

Set the output status of each channel on remote DO

module when EtherCAT communication is

disconnected and the retentive function is enabled

Operation of AI/AO Module

_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

Operation of Pulse Module (R1-EC5621D0 series)

_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).
Set the contact type (NC/NO) of encoder’s Z pulse
_ECAT_Slave_R1_EC5621_Set_QZ_Inverse
(QZ).

_ECAT_Slave_R1_EC5621_Set_Home_SpMode Apply the special mode when homing.

Set the contact type (NC/NO) of the negative limit


_ECAT_Slave_R1_EC5621_Set_MEL_Inverse
switch (MEL).
Set the contact type (NC/NO) of the positive limit
_ECAT_Slave_R1_EC5621_Set_PEL_Inverse
switch (PEL).
Set the contact type (NC/NO) of the servo enable
_ECAT_Slave_R1_EC5621_Set_Svon_Inverse
switch (Svon).
It sets the deceleration time after the motor reaches
_ECAT_Slave_R1_EC5621_Set_Home_Slow_Down
the origin

_ECAT_Slave_R1_EC5621_Get_IO_Status Acquire the status of all I/O points

_ECAT_Slave_R1_EC5621_Get_Single_IO_Status Acquire the status of single I/O point.

Operation of Pulse Module (R1-ECx62xD0 series)


_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
_ECAT_Slave_R1_ECx62x_Set_ORG_Inverse
(ORG)
Set the contact type (NC/NO) of encoder’s Z pulse
_ECAT_Slave_R1_ECx62x_Set_QZ_Inverse
signal (QZ)
_ECAT_Slave_R1_ECx62x_Set_Home_SpMode Apply the special mode when homing
Set the contact type (NC/NO) of the negative limit
_ECAT_Slave_R1_ECx62x_Set_MEL_Inverse
switch (MEL)
Set the contact type (NC/NO) of the positive limit
_ECAT_Slave_R1_ECx62x_Set_PEL_Inverse
switch (PEL)

4-8 March, 2017


EtherCAT Programming Guide API List of EtherCAT Dynamic-Link Library

Operation of Pulse Module (R1-ECx62xD0 series)


Set the contact type (NC/NO) of the servo enable
_ECAT_Slave_R1_ECx62x_Set_Svon_Inverse
switch (Svon)
It sets the deceleration time after the motor reaches

4
_ECAT_Slave_R1_ECx62x_Set_Home_Slow_Down
the Home switch
_ECAT_Slave_R1_ECx62x_Get_IO_Status Acquire the status of all I/O points

_ECAT_Slave_R1_ECx62x_Get_Single_IO_Status Acquire the status of single I/O point

Operation of delta servo drive


_ECAT_Slave_DeltaServo_Write_Parameter Write servo parameter values to Delta servo drives
Read servo parameter values from Delta servo
_ECAT_Slave_DeltaServo_Read_Parameter
drives
Read servo parameter attributes from Delta servo
_ECAT_Slave_DeltaServo_Read_Parameter_Info
drives
_ECAT_Slave_DeltaServo_Set_Velocity_Limit Set Delta servo motor’s max. speed

Write the pulse compare parameter, which is


_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

Analog Input Settings (R1-EC8124D0 series)


Set the sampling range of Delta analog input
_ECAT_Slave_R1_EC8124_Set_Input_RangeMode
module
_ECAT_Slave_R1_EC8124_Set_Input_ConvstFreq_ Set the sampling rate of Delta analog input
Mode module
Enable/Disable the analog input sampling function
_ECAT_Slave_R1_EC8124_Set_Input_Enable
of Delta analog input module

Acquire the sampling range of Delta analog input


_ECAT_Slave_R1_EC8124_Get_Input_RangeMode
module

Set the average times for the analog input filter of


_ECAT_Slave_R1_EC8124_Set_Input_AverageMode
Delta analog input module.

Analog Output Settings (R1-EC9144D0 series)


Set the output range of Delta analog output
_ECAT_Slave_R1_EC9144_Set_Output_RangeMode
module

_ECAT_Slave_R1_EC9144_Set_Output _Enable Enable/Disable the analog output of Delta module

Acquire the operation status of Delta analog


_ECAT_Slave_R1_EC9144_Get_Output_ReturnCode
output module

March, 2017 4-9


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

4 _ECAT_Slave_Record_Data_Get_Cnt
_ECAT_Slave_Record_Data_ReadData
_ECAT_Slave_Record_Clear_Data
Acquire the data entry number of specified axis
Acquire the recorded data of specified axis
Delete the saved record of specified axis
Enable/Disable the recoding function of specified
_ECAT_Slave_Record_Multi_Set_Enable
multiple axes
_ECAT_Slave_Record_Multi_Clear_Data Delete the saved record of specified multiple axes

Operation of Local Digital I/O


Control the output status of the GPIO on the motion
_ECAT_GPIO_Set_Output
card
Read the output status of the GPIO on the motion
_ECAT_GPIO_Get_Output
card
_ECAT_GPIO_Get_Input Read the input status of the GPIO on the motion card

High-Speed Pulse Compare Function

_ECAT_Compare_Set_Channel_Position Overwrite a position value for the specified channel

Acquire the current position value of the specified


_ECAT_Compare_Get_Channel_Position
channel

Set the mode of pulse input for the specified


_ECAT_Compare_Set_Ipulser_Mode
channel

_ECAT_Compare_Set_Channel_Direction Set the pulse direction of the specified channel

Set the trigger retaining time for the specified


_ECAT_Compare_Set_Channel_Trigger_Time
channel

Force the trigger manually once for the specified


_ECAT_Compare_Set_Channel_One_Shot
channel

_ECAT_Compare_Set_Channel_Source Set the compare source for the specified channel.

Enable/disable the compare function for the


_ECAT_Compare_Set_Channel_Enable
specified channel

Set the parameters for triggering the signal at a


_ECAT_Compare_Channel0_Position
fixed pulse interval of channel 0

Set the parameters for triggering the signal at a


_ECAT_Compare_Set_Channel0_Trigger_By_GPIO fixed pulse interval of channel 0, which is enabled /
disabled by GPIO

Enable/Disable the trigger function of channel 1


_ECAT_Compare_Set_Channel1_Output_Enable
(user-defined pulse intervals)

_ECAT_Compare_Set_Channel1_Output_Mode Set the output mode of channel 1


_ECAT_Compare_Get_Channel1_IO_Status Acquire the operation status of channel 1

_ECAT_Compare_Set_Channel1_GPIO_Out Set the output status of the PIN15 on CN2 of GPIO

4-10 March, 2017


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
evel
_ECAT_Compare_Get_Channel1_Position_Table_C
Set the pulse data of channel 1 and its user-defined
active level for triggering signals

Acquire the current trigger counts of channel 1


4
_ECAT_Compare_Set_Channel_Polarity Set the trigger level of the compare function

_ECAT_Compare_Reuse_Channel1_Position_Table Re-execute the compare function of channel 1 once

_ECAT_Compare_Reuse_Channel1_Position_Table Re-execute the compare function of channel 1 once,


which the trigger level is user-defined
_Level

Dynamic Link Library Information

_ECAT_Master_Get_DLL_Path Acquire the directory of the EtherCat_DLL.dll file


Acquire the version information of the
_ECAT_Master_Get_DLL_Version
EtherCat_DLL.dll file
Acquire the directory of the ECAT_RTX_DLL.dll or
_ECAT_Master_Get_DLL_Path_Single
PCI_L221.dll file
Acquire the version information of the
_ECAT_Master_Get_DLL_Version_Single
ECAT_RTX_DLL.dll or PCI_L221.dll file

Software Protection
_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
_ECAT_Security_Get_Write_Verifykey_State
verification key
_ECAT_Security_Check_UserPassword Check the user password

_ECAT_Security_Get_Check_UserPassword_State Acquire the status of verifying the user password

_ECAT_Security_Write_UserPassword Write in the user password into the verification IC


Acquire the status and result of writing in the user
_ECAT_Security_Get_Write_UserPassword_State
password

Operating MRAM in PAC


Write the U16 data (Word) to the specified address
_ECAT_Master_MRAM_Write_Word_Data
of MRAM in PAC
Read the U16 data (Word) from the specified
_ECAT_Master_MRAM_Read_Word_Data
address of MRAM in PAC
Write the U32 data (DWord) into the specified
_ECAT_Master_MRAM_Write_DWord_Data
address of MRAM in PAC
Read the U32 data (DWord) from the specified
_ECAT_Master_MRAM_Read_DWord_Data
address of MRAM in PAC

March, 2017 4-11


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

4 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)

_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

4-12 March, 2017


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 ··························································· 5-4
5.3 _ECAT_Master_NodeID_Alias_Enable ··················································· 5-5
5.4 _ECAT_Get_SerialNo ········································································· 5-6
5.5 _ECAT_Master_Get_DLL_SeqID ·························································· 5-7
5.6 _ECAT_Autoconfig_Open_File ····························································· 5-8
5.7 _ECAT_Autoconfig_Save_File······························································ 5-9
5.8 _ECAT_Autoconfig_Set_Slave_DCTime ··············································· 5-10
5.9 _EACT_Autoconfig_Clear_ConfigFile ···················································5-11
5.10 _ECAT_Autoconfig_Set_NodeID_Alias ················································· 5-12
5.11 _ECAT_Autoconfig_Get_NodeID_Alias ················································· 5-14
5.12 _ECAT_Autoconfig_Save_NodeID_Alias ··············································· 5-15

March, 2017 5-1


EtherCAT Master Configuration EtherCAT Programming Guide

API list of EtherCAT master configuration

Function name Description


Set the cycle time of the EtherCAT master

5 _ECAT_Master_Set_CycleTime

_ECAT_Master_Get_CycleTime
communication. *Set before initialization.
Acquire the cycle time of the EtherCAT master
communication.
Determine whether to enable user-defined station.
_ECAT_Master_NodeID_Alias_Enable
*Set before initialization.
_ECAT_Master_Get_SerialNo Get the serial No. of PAC or the motion card.

_ECAT_Master_Get_DLL_SeqID Acquire the sequence ID of the current DLL.


Read and apply the configuration file of the
_ECAT_Autoconfig_Open_File communication topology and DC data for system
initialization. *Set before initialization.
Save the current communication topology and DC
_ECAT_Autoconfig_Save_File
data to the configuration file.
_ECAT_Autoconfig_Set_Slave_DCTime Set the DC time of each node.
Clear the currently imported EtherCAT master
_EACT_Autoconfig_Clear_ConfigFile
configuration.
Set user-defined station alias of each node. *Set after
_ECAT_Autoconfig_Set_NodeID_Alias
initialization.
Acquire the user-defined station alias of each node.
_ECAT_Autoconfig_Get_NodeID_Alias
*Set after initialization.
Save the user-defined station alias to the module
_ECAT_Autoconfig_Save_NodeID_Alias
memory block.

5-2 March, 2017


EtherCAT Programming Guide EtherCAT Master Configuration

5.1 _ECAT_Master_Set_CycleTime
 Syntax
U16 PASCAL _ECAT_Master_Set_CycleTime (U16 CardNo, U16 Mode)

 Purpose
This is for setting the cycle time of the EtherCAT master communication. *Set before initialization.
5
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).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Communication cycle time (us)

0: 2000 us

1: 1000 us
Mode U16 Option
2: 500 us

3: 250 us

4: 125 us

 Example
U16 Status;
U16 CardNo=0;
U16 Cardnum=0;

Status = _ECAT_Master_Open (&Cardnum);


if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);
// Execute the API after enabling the motion card and before initialization.
U16 Mode = 3;
Status = _ECAT_Master_Set_CycleTime (CardNo, Mode);

Status = _ECAT_Master_Initial(CardNo);
}

March, 2017 5-3


EtherCAT Master Configuration EtherCAT Programming Guide

5.2 _ECAT_Master_Get_CycleTime
 Syntax
U16 PASCAL _ECAT_Master_Get_CycleTime (U16 CardNo, U16 *CycleTime)

5  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 Data type Property Description

CardNo U16 Number Card No.

Communication cycle time (unit: us);

The Master currently only supports cycle times of


CycleTime U16* Time (us)
2000, 1000, 500, 250, 125. For the slave cycle time,

please refer to the description of each Slave.

 Example
U16 Status;
U16 CardNo=0;
U16 Cardnum=0;
U16 CycleTime =0;
Status = _ECAT_Master_Open (&Cardnum);
if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);
// Acquire the Master’s CycleTime setting information.
Status = _ECAT_Master_Get_CycleTime (CardNo, &CycleTime);
}

5-4 March, 2017


EtherCAT Programming Guide EtherCAT Master Configuration

5.3 _ECAT_Master_NodeID_Alias_Enable
 Syntax
U16 PASCAL _ECAT_Master_NodeID_Alias_Enable (U16 CardNo, U16 Enable)

 Purpose
This is for determining whether to enable user-defined station.
5
*Set before initialization. If there is any EtherCAT slave that has not been assigned with an alias,
error message (0x1004) will occur.
Note:
1. Please make sure no repeated slave station alias is on the bus.
2. If you are using any of the Delta R1-EC series modules, please refer to Chapter 5.10
_ECAT_Autoconfig_Set_NodeID_Alias to set the station number of all R1-EC series modules on
the EtherCAT bus. Once the setting is complete, refer to section 5.12
_ECAT_Autoconfig_Save_NodeID_Alias to save this setting to the module’s memory. Then,
re-initialize EtherCAT bus.
3. If there is a repeated station alias or one of the station aliases is not set, an API error message
(0x1004) will occur.
4. 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).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

0: Disable user-defined station alias.


Enable U16 Option
1: Enable user-defined station alias.

 Example
U16 Status;
U16 CardNo=0, Enable =1;
U16 MapNodeID;
U16 Cardnum=0;
Status = _ECAT_Master_Open (&Cardnum);
if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);
// Disable EtherCAT communication.
Status = _ECAT_Master_Reset(CardNo);
// Enable user-defined station alias.
Status = _ECAT_Master_NodeID_Alias_Enable (CardNo, Enable);
// Eanble the EtherCAT communication again.
Status = _ECAT_Master_Initial(CardNo);
}

March, 2017 5-5


EtherCAT Master Configuration EtherCAT Programming Guide

5.4 _ECAT_Get_SerialNo
 Syntax
U16 PASCAL _ECAT_Get_SerialNo (U16 CardNo, U32* SerialNo)

5  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
Name Data type Property Description

CardNo U16 Number Card No.

SerialNo U32 Number Serial No.

 Example
U16 Status;
U16 CardNo=0;
U32 SerialNo=0;
U16 Cardnum=0;

Status = _ECAT_Master_Open (&Cardnum);


if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);

Status = _ECAT_Get_SerialNo (CardNo, &SerialNo);


}

5-6 March, 2017


EtherCAT Programming Guide EtherCAT Master Configuration

5.5 _ECAT_Master_Get_DLL_SeqID
 Syntax
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).
5
Note: This API can only be executed after the EtherCAT Master has been started by _ECAT_Master_Open
(section 6.1).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

SeqID U16* Value Sequence ID of the current DLL.

 Example
U16 Status;
U16 CardNo = 0;
U16 SeqID = 0;
U16 Cardnum=0;

Status = _ECAT_Master_Open (&Cardnum);


if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);

Status = _ECAT_Master_Get_DLL_SeqID (CardNo, &SeqID);


}

March, 2017 5-7


EtherCAT Master Configuration EtherCAT Programming Guide

5.6 _ECAT_Autoconfig_Open_File
 Syntax
U16 PASCAL _ECAT_Autoconfig_Open_File (U16 CardNo, I8 *FilePath)

5  Purpose
This is for reading and applying the configuration file of communication topology and DC data.
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.
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).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

FilePath I8* String The directory of the configuration file

 Example
U16 Status;
U16 CardNo=0;
I8 FilePath[255];
U16 Cardnum=0;

Status = _ECAT_Master_Open (&Cardnum);


if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);

strcpy(FilePath, "C:\\EtherCAT_Information.dat");
Status = _ECAT_Autoconfig_Open_File (CardNo, FilePath);

Status = _ECAT_Master_Initial(CardNo);
}

5-8 March, 2017


EtherCAT Programming Guide EtherCAT Master Configuration

5.7 _ECAT_Autoconfig_Save_File
 Syntax
U16 PASCAL _ECAT_Autoconfig_Save_File (U16 CardNo, I8 *FilePath)

 Purpose
This is for saving the communication topology and DC data to the configuration file.
5
Before initializing the master (_ECAT_Master_InitialEtherCAT in section 6.2), you can use
“_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).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Save the communication topology and DC data to the


FilePath I8* String
configuration file

 Example
U16 Status;
U16 CardNo=0;
I8 FilePath[255];
U16 Cardnum=0;

Status = _ECAT_Master_Open (&Cardnum);


if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);

strcpy(FilePath, "C:\\EtherCAT_Information.dat");
Status = _ECAT_Autoconfig_Save_File (CardNo, FilePath);
}

March, 2017 5-9


EtherCAT Master Configuration EtherCAT Programming Guide

5.8 _ECAT_Autoconfig_Set_Slave_DCTime
 Syntax
U16 PASCAL _ECAT_Autoconfig_Set_Slave_DCTime (U16 CardNo, U16 NodeID,

5 U16 Mode)

 Purpose
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” in section 6.2).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

Set DC time for each node.

0: 2000 us

1: 1000 us
Mode U16 Option
2: 500 us

3: 250 us

4: 125 us

 Example
U16 Status;
U16 CardNo=0,NodeID=1;
U16 Mode=1; // 1ms
U16 Cardnum=0;

Status = _ECAT_Master_Open (&Cardnum);


if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);

Status = _ECAT_Autoconfig_Set_Slave_DCTime (CardNo, NodeID, Mode);

Status = _ECAT_Master_Initial(CardNo);
}

5-10 March, 2017


EtherCAT Programming Guide EtherCAT Master Configuration

5.9 _EACT_Autoconfig_Clear_ConfigFile
 Syntax
U16 PASCAL _EACT_Autoconfig_Clear_ConfigFile (U16 CardNo)

 Purpose
This is for clearing the configuration file loaded via _ECAT_Autoconfig_Open_File. It is mainly
5
used when a wrong file has been opened or the changes are not compatible with the previous
settings.
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).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

 Example
U16 Status;
U16 CardNo=0;
U16 Cardnum=0;

Status = _ECAT_Master_Open (&Cardnum);


if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);

Status = _EACT_Autoconfig_Clear_ConfigFile (CardNo);

Status = _ECAT_Master_Initial(CardNo);
}

March, 2017 5-11


EtherCAT Master Configuration EtherCAT Programming Guide

5.10 _ECAT_Autoconfig_Set_NodeID_Alias
 Syntax
U16 PASCAL _ECAT_Autoconfig_Set_NodeID_Alias (U16 CardNo, U16 NodeID, U16

5 MapNodeID)

 Purpose
This is for configuring user-defined station alias of each node. *Set after initialization.

Note:
1. This API is only applicable to Delta R1-EC series remote modules.
2. After executing this API, users still need to validate the new station alias. To validate it, please set the
station alias of each node first and by using “_ECAT_Autoconfig_Save_NodeID_Alias” (refer to section
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” in section 5.12) and
( “_ECAT_Master_NodeID_Alias_Enable” in section 5.3) also before ( “_ECAT_Master_Initial” in section
6.2).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

MapNodeID U16 Number Specify Node ID

 Example
U16 Status;
U16 CardNo=0,NodeID=1;
U16 MapNodeID = 2;
U16 Cardnum=0;
Status = _ECAT_Master_Open (&Cardnum);
if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);
// Reset EtherCAT communication
Status = _ECAT_Master_Reset(CardNo);
// Specified first node of slave device as station 2
Status = _ECAT_Autoconfig_Set_NodeID_Alias (CardNo, NodeID, MapNodeID);
// Save user-defined alias to all of the connected device, and then EtherCAT
communication will stop automatically.
Status = _ECAT_Autoconfig_Save_NodeID_Alias (CardNo);
// ………….waiting for reboot all of the device manually………….
bool module_reboot = false;
While(!module_reboot)

5-12 March, 2017


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
}

March, 2017 5-13


EtherCAT Master Configuration EtherCAT Programming Guide

5.11 _ECAT_Autoconfig_Get_NodeID_Alias
 Syntax
U16 PASCAL _ECAT_Autoconfig_Get_NodeID_Alias (U16 CardNo, U16 RealNodeID, U16

5 *MapNodeID)

 Purpose
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” in section 5.10), you will need to apply API
“_ECAT_Autoconfig_Save_NodeID_Alias” (in section 5.12) to save specified alias to each slave device.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

RealNodeID U16 Number Node ID

MapNodeID U16* Number Specify Node ID

 Example
U16 Status;
U16 CardNo=16,NodeID=1;
U16 MapNodeID;U16 Cardnum=0;
Status = _ECAT_Master_Open (&Cardnum);
if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);

Status = _ECAT_Autoconfig_Get_NodeID_Alias (CardNo, NodeID, &MapNodeID);


}

5-14 March, 2017


EtherCAT Programming Guide EtherCAT Master Configuration

5.12 _ECAT_Autoconfig_Save_NodeID_Alias
 Syntax
U16 PASCAL _ECAT_Autoconfig_Save_NodeID_Alias (U16 CardNo)

 Purpose
This is for saving the user-defined station alias to the module memory block. After executing this
5
API, EtherCAT communication will be disconnected automatically and reboot of all slave devices
is required.
Note:
1. This API is only applicable to Delta R1-EC series remote modules.
2. Please use API “_ECAT_Autoconfig_Set_NodeID_Alias” (section 5.10), to configure all of the
user-defined alias and save them to the devices. After then, users can get the new configuration by API
“_ECAT_Autoconfig_Get_NodeID_Alias” (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 EtherCAT communication is initialized
( “_ECAT_Master_Initial” in section 6.2).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

 Example
U16 Status;
U16 CardNo=0,NodeID=1;
U16 MapNodeID = 2;
U16 Cardnum=0;
Status = _ECAT_Master_Open (&Cardnum);
if (Cardnum>0)
{
Status = _ECAT_Master_Get_CardSeq (0, &CardNo);
// Reset EtherCAT communication
Status = _ECAT_Master_Reset(CardNo);
// Specified first node of slave device as station 2
Status = _ECAT_Autoconfig_Set_NodeID_Alias (CardNo, NodeID, MapNodeID);
// Save user-defined alias to all of the connected device, and then EtherCAT
communication will stop automatically.
Status = _ECAT_Autoconfig_Save_NodeID_Alias (CardNo);
// ………….waiting for reboot all of the device manually………….
bool module_reboot = false;
While(!module_reboot)
{
}

March, 2017 5-15


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

5 }
Status = _ECAT_Master_Initial(CardNo);

5-16 March, 2017


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.

6.1 _ECAT_Master_Open ········································································ 6-3


6.2 _ECAT_Master_Initial ········································································· 6-4
6.3 _ECAT_Master_Reset ········································································ 6-5
6.4 _ECAT_Master_Close ········································································ 6-6
6.5 _ECAT_Master_Get_CardSeq ····························································· 6-7
6.6 _ECAT_Master_Get_SlaveNum ··························································· 6-8
6.7 _ECAT_Master_Get_Slave_Info ··························································· 6-9
6.8 _ECAT_Master_Get_DC_Status ··························································6-11
6.9 _ECAT_Master_Get_Connect_Status ·················································· 6-12
6.10 _ECAT_Master_Get_Api_BufferLength ················································· 6-13
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

March, 2017 6-1


Master Initialization EtherCAT Programming Guide

API list of master initialization

Function name Description

6
Check the number of motion cards and EtherCAT
_ECAT_Master_Open
kernels, as well as creating memory block
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
_ECAT_Master_Close
release the memory
_ECAT_Master_Get_CardSeq Acquire motion card No.
Acquire slave quantity on the communication bus of the
_ECAT_Master_Get_SlaveNum
specified EtherCAT master

_ECAT_Master_Get_Slave_Info Acquire EtherCAT slave information

_ECAT_Master_Get_DC_Status Acquire the motion card's DC status, time and time offset

_ECAT_Master_Get_Connect_Status Acquire EtherCAT master’s connection status


Acquire the command amount of each slave that has not
_ECAT_Master_Get_Api_BufferLength
been completed
Acquire the time spent on Tx and Rx every cycle and the
_ECAT_Master_Get_Cycle_SpendTime
maximum consuming time in the log

_ECAT_Master_Check_Initial_Done Check whether the DLL initialization has been completed

_ECAT_Master_Get_Initial_ErrorCode Acquire the error code when error occurs


Acquire the current connection status of EtherCAT
_ECAT_Master_Check_Working_Counter
communication
_ECAT_Master_Get_Return_Code_Message Acquire the corresponding message of each return code

6-2 March, 2017


EtherCAT Programming Guide Master Initialization

6.1 _ECAT_Master_Open
 Syntax
U16 PASCAL _ECAT_Master_Open(U16 *Cardnum)

 Purpose
This is for checking the number of motion cards and EtherCAT kernels, as well as creating
6
memory block.
Note:
1. This is the most essential API for controlling Delta EtherCAT master. Please execute this API before
starting using other functions.
2. If the acquired quantity is 0, it means the environment for executing the program does not support
EtherCAT communication.
3. To avoid blue screen death, DO NOT use this API in the thread when using C# to develop RTX
environment.

 Parameter
Name Data type Property Description

Quantity of the motion control cards or EtherCAT


CardNo U16 Number
kernels

 Example
U16 Status;
U16 Cardnum=0;

Status = _ECAT_Master_Open(&Cardnum);

March, 2017 6-3


Master Initialization EtherCAT Programming Guide

6.2 _ECAT_Master_Initial
 Syntax
U16 PASCAL _ECAT_Master_Initial(U16 CardNo)

6  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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

 Example
U16 Status;
U16 CardNo = 0;
U16 Cardnum = 0;
U16 InitDone = 100;

Status = _ECAT_Master_Open(&Cardnum);
for (U16 CardSeq = 0; CardSeq < Cardnum; CardSeq ++)
{
Status = _ECAT_Master_Get_CardSeq (CardSeq, &CardNo);

Status = _ECAT_Master_Initial(CardNo);

while (InitDone != 0)
{
Status = _ECAT_Master_Check_Initial_Done(CardNo, &InitDone);
if (InitDone == 99)
{
// Error
Status = _ECAT_Master_Get_Initial_ErrorCode(CardNo);
break;
}
}
}

6-4 March, 2017


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.
6
 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

 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);

Status = _ECAT_Master_Initial(CardNo);

Status = _ECAT_Master_Reset(CardNo);
}

March, 2017 6-5


Master Initialization EtherCAT Programming Guide

6.4 _ECAT_Master_Close
 Syntax
U16 PASCAL _ECAT_Master_Close()

6  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);

Status = _ECAT_Master_Initial(CardNo);

Status = _ECAT_Master_Reset(CardNo);
}

Status = _ECAT_Master_Close();

6-6 March, 2017


EtherCAT Programming Guide Master Initialization

6.5 _ECAT_Master_Get_CardSeq
 Syntax
U16 PASCAL _ECAT_Master_Get_CardSeq (U16 CardSeq, U16 * CardNo)

 Purpose
This is for acquiring motion card No.
6
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.

 Parameter
Name Data type Property Description

CardSeq U16 Number Sequence ID of the motion card.

CardNo U16* Number Card No.

 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);

Status = _ECAT_Master_Initial(CardNo);

Status = _ECAT_Master_Reset(CardNo);
}

Status = _ECAT_Master_Close();

March, 2017 6-7


Master Initialization EtherCAT Programming Guide

6.6 _ECAT_Master_Get_SlaveNum
 Syntax
U16 PASCAL _ECAT_Master_Get_SlaveNum(U16 CardNo, U16 *Slavenum)

6  Purpose
This is for acquiring slave quantity on the communication bus of the specified EtherCAT master.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

EtherCAT slave quantity that connected to the


Slavenum U16* Quantity
specified master.

 Example
U16 Status;
U16 CardNo=16, Slavenum=0;

Status = _ECAT_Master_Get_SlaveNum(CardNo, &Slavenum);

6-8 March, 2017


EtherCAT Programming Guide Master Initialization

6.7 _ECAT_Master_Get_Slave_Info
 Syntax
U16 PASCAL _ECAT_Master_Get_Slave_Info(U16 CardNo, U16 SeqID, U16 *NodeID, U32
*VenderID, U32 *ProductCode, U32 *RevisionNo, U32 *DCTime)


6
Purpose
This is for acquiring EtherCAT slave information.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

SeqID U16 Number Module’s physical sequence ID.

NodeID U16* Number The module's corresponding node ID.

VenderID U32* Number Vendor ID.

ProductCode U32* Number Product code.

RevisionNo U32* Number Version No.

DCTime U32* Time DC time of the module.

 Example
U16 Status;
U16 CardNo=16, SeqID =2, NodeID =2;
U32 VenderID, ProductCode, RevisionNo, DCTime;

Status = _ECAT_Master_Get_Slave_Info(CardNo, SeqID, NodeID , &VenderID, &ProductCode,


&RevisionNo, & DCTime);

 Description
EtherCAT master has certain restriction on the supported modules. If your slave module (not
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. (See Figure 6.7.1)
VenderID: 1A05 or 1DD
ProductCode: 00005500
RevisionNo: 00100000

March, 2017 6-9


Master Initialization EtherCAT Programming Guide

Figure 6.7.1 Contents of XML document

6-10 March, 2017


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)


6
Purpose
This is for acquiring the motion card's DC status, time and time offset.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

DC current status.

State U32* Status 0: Synchronizing

1: Initial synchronization completed

The current synchronized DC time (it is about half of


Time I32* Time (us)
the cycle time when system is stabilized)

OffsetTime I32* Time (us) The offset time of DC time clock

 Example
U16 Status;
U16 CardNo=16;
U32 Status;
I32 Time, OffsetTime;

Status = _ECAT_Master_Get_DC_Status(CardNo, &State, &Time, &OffsetTime);

March, 2017 6-11


Master Initialization EtherCAT Programming Guide

6.9 _ECAT_Master_Get_Connect_Status
 Syntax
U16 PASCAL _ECAT_Master_Get_Connect_Status(U16 CardNo, U16 * MasterStatus)

6  Purpose
This is for acquiring EtherCAT master’s connection status.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Master’s current status

1: Init mode

MasterStatus U16* Status 2: Pre-OP mode

4: Safe-OP mode

8: OP mode

 Example
U16 Status;
U16 CardNo=16;
U16 MasterStatus=0;

Status = _ECAT_Master_Get_Connect_Status(CardNo, &MasterStatus);

6-12 March, 2017


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)


6
Purpose
This is for acquiring the command amount of each slave that has not been completed.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

SlaveNo U16 Number Node ID

BuffLength U16* Value The accumulated Buffer length of API instructions.

 Example
U16 Status;
U16 CardNo=16, SlaveNo=1, BuffLength;

Status = _ECAT_Master_Get_Api_BufferLength(CardNo, SlaveNo , &BuffLength);

March, 2017 6-13


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

6 *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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Tx_Time F64* Time (us) Acquire the time spent on Tx (us)

Tx_MaxTime F64* Time (us) Acquire the maximum consumed time of Tx in the log

Rx_Time F64* Time (us) Acquire the time spent on Rx (us)

Rx_MaxTime F64* Time (us) Acquire the maximum consumed time of Rx in the log

 Example
U16 Status;
U16 CardNo=16;
F64 Tx_Time, Tx_MaxTime, Rx_Time, Rx_MaxTime;

Status = _ECAT_Master_Get_Cycle_SpendTime(CardNo, &Tx_Time, &Tx_MaxTime, &Rx_Time,


&Rx_MaxTime);

6-14 March, 2017


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.
6
 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

0: Completed

InitDone U16* Status 1: Initializing

99: Error

 Example
U16 Status;
U16 CardNo = 0;
U16 Cardnum = 0;
U16 InitDone = 100;

Status = _ECAT_Master_Open(&Cardnum);
for (U16 CardSeq = 0; CardSeq < Cardnum; CardSeq ++)
{
Status = _ECAT_Master_Get_CardSeq (CardSeq, &CardNo);

Status = _ECAT_Master_Initial(CardNo);

while (InitDone != 0)
{
Status = _ECAT_Master_Check_Initial_Done(CardNo, &InitDone);
if (InitDone == 99)
{
// Error
Status = _ECAT_Master_Get_Initial_ErrorCode(CardNo);
break;
}
}
}

March, 2017 6-15


Master Initialization EtherCAT Programming Guide

6.13 _ECAT_Master_Get_Initial_ErrorCode
 Syntax
U16 PASCAL _ECAT_Master_Get_Initial_ErrorCode(U16 CardNo)

6  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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

 Example
U16 Status;
U16 CardNo = 0;
U16 Cardnum = 0;
U16 InitDone = 100;

Status = _ECAT_Master_Open(&Cardnum);
for (U16 CardSeq = 0; CardSeq < Cardnum; CardSeq ++)
{
Status = _ECAT_Master_Get_CardSeq (CardSeq, &CardNo);

Status = _ECAT_Master_Initial(CardNo);

while (InitDone != 0)
{
Status = _ECAT_Master_Check_Initial_Done(CardNo, &InitDone);
if (InitDone == 99)
{
// Error
Status = _ECAT_Master_Get_Initial_ErrorCode(CardNo);
break;
}
}
}

6-16 March, 2017


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)


6
Purpose
This is for acquiring the current connection status of EtherCAT communication.

 Parameter
Name Data type Property Description

CardNo U16 Number (No.) Card No.

0: Normal
Abnormal_Flag U16* Status
1: Error

The current EtherCAT slave quantity detected during

communication. In normal condition, the detected

number is identical to that obtained via


Working_Slave_Cnt U16* Quantity
_ECAT_Master_Get_SlaveNum. When error occurs,

this number can be used to locate the error regarding

physical wiring.

 Example
U16 Status;
U16 CardNo=16;
U16 Abnormal_Flag, Working_Slave_Cnt;

Status = _ECAT_Master_Check_Working_Counter(CardNo, &Abnormal_Flag,


&Working_Slave_Cnt);

March, 2017 6-17


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);

6  Purpose
This is for acquiring the corresponding message of each return code.

 Parameter
Name Data type Property Description

ReturnCode U16 Number Return code

Message I8* String Corresponding message for each return code

 Example
U16 Status, Rt;
U16 CardNo = 0;
U16 Cardnum = 0;
U16 InitDone = 100;
I8 Message[500]= {0};

Status = _ECAT_Master_Open(&Cardnum);
for (U16 CardSeq = 0; CardSeq < Cardnum; CardSeq ++)
{
Status = _ECAT_Master_Get_CardSeq (CardSeq, &CardNo);
Status = _ECAT_Master_Initial(CardNo);
while (InitDone != 0)
{
Status = _ECAT_Master_Check_Initial_Done(CardNo, &InitDone);
if (InitDone == 99)
{
// Error
Status = _ECAT_Master_Get_Initial_ErrorCode(CardNo);
Rt = _ECAT_Master_Get_Return_Code_Message(Status, Message);
break;
}
}
}

6-18 March, 2017


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 ··········································· 7-5
7.4 _ECAT_Slave_SDO_Quick_Read_Message ··········································· 7-6
7.5 _ECAT_Slave_SDO_Read_Response ··················································· 7-7
7.6 _ECAT_Slave_SDO_Wait_All_Done ······················································ 7-8
7.7 _ECAT_Slave_SDO_Get_ErrorCode ····················································· 7-9
7.8 _ECAT_Slave_SDO_Check_Done ······················································ 7-11
7.9 _ECAT_Slave_PDO_Get_OD_Data ···················································· 7-12
7.10 _ECAT_Slave_PDO_Set_OD_Data ··················································· 7-13
7.11 _ECAT_Slave_PDO_Get_Information················································· 7-14
7.12 _ECAT_Slave_PDO_Get_Detail_Mapping··········································· 7-15
7.13 _ECAT_Slave_PDO_Get_Rx_Data ···················································· 7-16
7.14 _ECAT_Slave_PDO_Get_Tx_Data ···················································· 7-17
7.15 _ECAT_Slave_PDO_Set_Tx_Data ···················································· 7-18
7.16 _ECAT_Slave_PDO_Set_Tx_Detail_Data ··········································· 7-19

March, 2017 7-1


EtherCAT CoE Standard Communication EtherCAT Programming Guide

An OD (Object Dictionary) represents different parameters for the slaves, such as motor’s
current position. And each OD consists of one index and one sub-index, which signify the
communication address in hexadecimal format and property respectively.

7 PDO (Process Data Object) is the communication method defined by CANopen. It is the cyclic
communication between the Master and all Slaves. Before the communication (initialization)
starts, the Master will define one PDO mapping table, which consists of several ODs. Then, the
PDO mapping table will be sent to each Slave according to the set cycle on a regular basis. In
the same cycle, the Slave executes the command or sends the status to the Master in
accordance with the PDO mapping table.

SDO (Service Data Objects) is also the communication method defined by CANopen. Different
from PDO, the communication time is determined by users. The Slave gives response only when
the 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

_ECAT_Slave_SDO_Send_Message Issue SDO command (CANopen) to the slave

_ECAT_Slave_SDO_Read_Message Acquire the current SDO data (CANopen) of the slave


Issue SDO command (CANopen) to the slave without
_ECAT_Slave_SDO_Quick_Send_Message
waiting for the response
Issue SDO read command (CANopen) to the slave
_ECAT_Slave_SDO_Quick_Read_Message
without waiting for the response
_ECAT_Slave_SDO_Read_Response Read the returned data from the slave.
Wait multiple slaves to complete all the SDO
_ECAT_Slave_SDO_Wait_All_Done
commands.
Acquire the error code of ERR_ECAT_SDO_Return
that returned during the execution of SDO
_ECAT_Slave_SDO_Get_ErrorCode Send_Message or Read_Message. Please refer to
CANopen protocol or the definition of each device for
error code.
Check if the specified slave has completed all the
_ECAT_Slave_SDO_Check_Done
SDO commands
_ECAT_Slave_PDO_Get_OD_Data Read the data of an OD index in the PDO mapping

_ECAT_Slave_PDO_Set_OD_Data Send the data of an OD index in the PDO mapping


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

_ECAT_Slave_PDO_Get_Tx_Data Acquire all slave Tx data of the PDO mapping

_ECAT_Slave_PDO_Set_Tx_Detail_Data Configure all slave Tx data of the PDO mapping

7-2 March, 2017


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
7
This is for issuing SDO command (CANopen) to the slave.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Index U16 Index The index of CANopen object dictionary

SubIndex U16 Subindex The subindex of CANopen object dictionary

DataSize U16 byte Data size of the sent message. Unit: byte

Data U8* data Data of the sent message

 Example
U16 Status;
U16 CardNo=16,NodeID=1,SlotNo=0;
U16 Index=0x6040, SubIndex=0, DataSize=4;
U8 Data[4]={0};

Status = _ECAT_Slave_SDO_Send_Message(CardNo, NodeID, SlotNo,


Index, SubIndex, DataSize, Data);

March, 2017 7-3


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

7 Index, U16 SubIndex, U16 DataSize, U8 *Data)

 Purpose
This is for acquiring the current SDO data (CANopen) of the slave.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Index U16 Index The index of CANopen object dictionary

SubIndex U16 Subindex The subindex of CANopen object dictionary

DataSize U16 byte Data size of the received message. Unit: byte

Data U8* data Data of the received message

 Example
U16 Status;
U16 CardNo=16,NodeID=1,SlotNo=0;
U16 Index=0x1000, SubIndex=0, DataSize=4;
U8 Data[4] = {0};

Status =_ECAT_Slave_SDO_Read_Message(CardNo, NodeID, SlotNo, Index, SubIndex,


DataSize, &Data[0]);

7-4 March, 2017


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
7
This is for issuing SDO command (CANopen) to the slave without waiting for the response.

 Parameter
Name Data type Property Description

CardNo U16 Number (No.) Card No.

NodeID U16 Number (No.) Node ID

SlotNo U16 Number (No.) Slot ID

Index U16 Index The index of CANopen object dictionary

SubIndex U16 Subindex The subindex of CANopen object dictionary

DataSize U16 byte Data size of the received message. Unit: Byte

Data U8* data Data of the received message

 Example
U16 Status;
U16 CardNo=16,NodeID=1,SlotNo=0;
U16 Index=0x6040, SubIndex=0, DataSize=4;
U8 Data[4] = {0};

Status = _ECAT_Slave_SDO_Quick_Send_Message (CardNo, NodeID, SlotNo,


Index, SubIndex, DataSize, &Data[0]);

March, 2017 7-5


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

7 SlotNo, U16 Index, U16 SubIndex, U16 DataSize)

 Purpose
This is for issuing SDO read command (CANopen) to the slave without waiting for the response.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Index U16 Index The index of CANopen object dictionary

SubIndex U16 Subindex The subindex of CANopen object dictionary

DataSize U16 byte Data size of the received message. Unit: Byte.

 Example
U16 Status;
U16 CardNo=16,NodeID=1,SlotNo=0;
U16 Index=0x6040, SubIndex=0, DataSize=4;

Status = _ECAT_Slave_SDO_Quick_Read_Message (CardNo, NodeID, SlotNo,


Index, SubIndex, DataSize);

7-6 March, 2017


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
7
This is for reading the returned data from the slave.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

0: Completed

Done U16* Status 1: In execution

2: Error

Data U8 Data Data of the received message

ErrorCode U32* Number Error code

 Example
U16 Status;
U16 CardNo=16,NodeID=1,SlotNo=0;
U16 Index=0x6040, SubIndex=0, DataSize=4;
U8 Data[4] = {0};
U32 ErrorCode;

Status = _ECAT_Slave_SDO_Read_Response (CardNo, NodeID, SlotNo,


&Done, Data, &ErrorCode);

March, 2017 7-7


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,

7 U16* NodeID, U16* SlotNo)

 Purpose
This is for waiting multiple slaves to complete all SDO commands.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNum U16 quantity The quantity of the engaged axis

NodeID U16* Number Node ID

SlotNo U16* Number Slot ID

 Example
U16 Status;
U16 AxisNum = 2;
U16 CardNo=16, NodeID[2] = {0,1} ,SlotNo[2] = {0,0};

Status = _ECAT_Slave_SDO_Wait_All_Done(CardNo, AxisNum ,NodeID, SlotNo);

7-8 March, 2017


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

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

ErrorCode U32* Number Error code

 Example
U16 Status;
U16 CardNo=16,NodeID=1,SlotNo=0;
U32 ErrorCode;

Status = _ECAT_Slave_SDO_Get_ErrorCode(CardNo, NodeID, SlotNo, &ErrorCode);

March, 2017 7-9


EtherCAT CoE Standard Communication EtherCAT Programming Guide

List of error code


Code Description

0x0503 0000 Toggle bit not alternated.

7 0x0504 0000

0x0504 0001

0x0504 0002
SDO protocol timed out

Client/server command specifier not valid or unknown.

Invalid block size

0x0504 0003 Invalid sequence numbe

0x0504 0004 CRC error

0x0504 0005 Out of memory

0x0601 0000 Unsupported access to an object

0x0601 0001 Attempt to read a write-only object

0x0601 0002 Attempt to write to a read-only object

0x0602 0000 Object not listed in object directory

0x0604 0041 Object cannot be mapped to PDO

0x0604 0042 Number and length of objects to be transferred longer than PDO length.

0x0604 0043 General parameter incompatibility

0x0604 0047 General internal device incompatibility

0x0606 0000 Access denied because of hardware error

0x0607 0010 Data type does not match, unsuitable PDO/SDO parameter length

0x0607 0012 Data type does not match, PDO/SDO parameter length exceeded

Data type does not match, PDO/SDO


0x0607 0013
parameter length not long enough

0x0609 0011 Subindex does not exist

0x0609 0030 Parameter value range exceeded

0x0609 0031 Value of parameter written too high

0x0609 0032 Value of parameter written too low

0x0609 0036 Maximum value is less than minimum value

0x0800 0000 General error

0x0800 0020 Data cannot be transferred/saved to the application

0x0800 0021 Data cannot be transferred/saved to the application due to local control.

Data cannot be transferred/saved to the application due to current device


0x0800 0022
status

0x0800 0023 Dynamic generation of object directory error or no object directory available

7-10 March, 2017


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
7
This is for checking if the specified slave has completed all the SDO commands.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Definition

Done U16* Status 0: Completed

1: Processing

 Example
U16 Status;
U16 CardNo=16, NodeID = 1 ,SlotNo = 0, Done;

Status = _ECAT_Slave_SDO_Check_Done (CardNo, NodeID, SlotNo, &Done);

March, 2017 7-11


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

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

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

OD Format to be read

IOType U16 Type 0: Rx

1: Tx

ODIndex U16 Index OD index of the data

ODSubIndex U16 Subindex OD subindex of the data

ByteSize U16 byte The size of the data space

Data U8* Data Acquire the data contents of the specified OD index

 Example
U16 Status;
U8 Data = 0;
U16 CardNo=16, NodeID = 1 ,SlotNo = 0, IOType = 0;
U16 ODIndex = 0x1810, ODSubIndex = 0x01, ByteSize = 0x43;

Status = _ECAT_Slave_PDO_Get_OD_Data (CardNo, NodeID, SlotNo, IOType, ODIndex,


ODSubIndex, ByteSize, &Data);

7-12 March, 2017


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

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

ODIndex U16 Index OD index of the data

ODSubIndex U16 Subindex OD subindex of the data

Data U8* data The data contents of the specified OD index

 Example
U16 Status;
U8 Data = 0;
U16 CardNo=16, NodeID = 1 ,SlotNo = 0, IOType = 0;
U16 ODIndex = 0x1780, ODSubIndex = 0x01

Status = _ECAT_Slave_PDO_Set_OD_Data (CardNo, NodeID, SlotNo, ODIndex, ODSubIndex,


&Data);

March, 2017 7-13


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,

7 U16 IOType, U16 *ODCnt, U16 *StartIndex)

 Purpose
This is for acquiring the basic information of each slave device PDO.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

OD format to be read

IOType U16 Type 0: Master Rx

1: Master Tx

ODCnt U16* Quantity OD number of this IO type in the slave.

StartIndex U16* Index The starting index of the slave device.

 Example
U16 Status;
U16 CardNo=16, NodeID = 1 ,SlotNo = 0, IOType = 0;
U16 ODCnt, StartIndex;

Status = _ECAT_Slave_PDO_Get_Information(CardNo, NodeID, SlotNo, IOType,


&ODCnt, &StartIndex);

7-14 March, 2017


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)
7
 Purpose
This is for acquiring the details of PDO mapping in the slave device.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

OD format to be read

IOType U16 Type 0: Master Rx

1: Master Tx

ODSeqID U16 Number OD sequence ID

ODIndex U16* Index OD index of the data

ODSubIndex U16* Subindex OD subindex of the data

ByteSize U16* byte The size of the data space

ODStartIndex U16* Index The starting index of the OD

 Example
U16 Status;
U16 CardNo=16, NodeID = 1 ,SlotNo = 0, IOType = 0, ODSeqID = 0, ODCnt , StartIndex;
U16 ODIndex[8]={0}, ODSubIndex[8]={0}, ODBitSize[8]={0}, ODStartIndex[8]={0};

Status = _ECAT_Slave_PDO_Get_Information(CardNo, NodeID, SlotNo, IOType, &ODCnt,


&StartIndex);

for (ODSeqID = 0; ODSeqID < ODCnt; ODSeqID++)


{
Status = _ECAT_Slave_PDO_Get_Detail_Mapping(CardNo, NodeID, SlotNo,
IOType, ODSeqID, &ODIndex[ODSeqID], &ODSubIndex[ODSeqID],
&ODBitSize[ODSeqID],&ODStartIndex[ODSeqID]);
}

March, 2017 7-15


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)

7  Purpose
This is for acquiring all slave Rx data of the PDO mapping.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

All the salve Rx data. The max. data size is 1536


Data BYTE data
(0x600).

 Example
U16 Status;
U16 CardNo=16;
BYTE Data[0x600] = {0};

Status = _ECAT_Slave_PDO_Get_Rx_Data(CardNo, &Data);

7-16 March, 2017


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.
7
 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

All the slave Tx data. The max. data size is 1536


Data BYTE data
(0x600).

 Example
U16 Status;
U16 CardNo=16;
BYTE Data[0x600] = {0};

Status = _ECAT_Slave_PDO_Get_Tx_Data(CardNo, &Data);

March, 2017 7-17


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)

7  Purpose
This is for configuring all slave Tx data of the PDO mapping.

 Parameter
Name Data type Property Description

CardNo U16 Number (No.) Card No.

All the slave Tx data. The max. data size is 1536


Data BYTE data
(0x600).

 Example
U16 Status;
U16 CardNo=16;
BYTE Data[0x600] = {0};
Status = _ECAT_Slave_PDO_Get_Tx_Data(CardNo, &Data);

// Directly edit the data in TxData


Data[0x001] = 0x01;

Status = _ECAT_Slave_PDO_Set_Tx_Data(CardNo, &Data);

7-18 March, 2017


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
7
This is for configuring all the slave Tx data of the PDO mapping.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

StartIndex U16 index The starting index of the slave.

ByteSize U16 byte Tx data size to be transmitted

Data U8* Data Tx data to be transmitted

 Example
U16 Status;
U16 CardNo=16, NodeID = 1 ,SlotNo = 0, IOType = 1;
U16 ODCnt, StartIndex = 0x60, ByteSize = 4;
U8 Data[4]={0, 1, 0, 1};

Status = _ECAT_Slave_PDO_Get_Information(CardNo, NodeID, SlotNo, IOType,


&ODCnt, &StartIndex);

Status = _ECAT_Slave_PDO_Set_Tx_Detail_Data(CardNo, NodeID, SlotNo, StartIndex,


ByteSize, &Data);

March, 2017 7-19


EtherCAT CoE Standard Communication EtherCAT Programming Guide

(This page is intentionally left blank.)

7-20 March, 2017


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 ···························································· 8-4
8.3 _ECAT_Slave_Motion_Sd_Stop ························································ 8-5
8.4 _ECAT_Slave_Motion_Emg_Stop ····················································· 8-6
8.5 _ECAT_Slave_Motion_Set_Alm_Reaction ··········································· 8-7
8.6 _ECAT_Slave_Motion_Set_Position··················································· 8-8
8.7 _ECAT_Slave_Motion_Set_Command ··············································· 8-9
8.8 _ECAT_Slave_Motion_Set_MoveMode ············································ 8-10
8.9 _ECAT_Slave_Motion_Get_MoveMode ············································ 8-11
8.10 _ECAT_Slave_Motion_Get_ControlWord········································· 8-12
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 ······························· 8-25
8.22 _ECAT_Slave_Motion_Set_TouchProbe_QuickStart ·························· 8-28
8.23 _ECAT_Slave_Motion_Set_TouchProbe_QuickDone ························· 8-30
8.24 _ECAT_Slave_Motion_Set_TouchProbe_Disable ······························ 8-32
8.25 _ECAT_Slave_Motion_Get_TouchProbe_Status ······························· 8-33
8.26 _ECAT_Slave_Motion_Get_TouchProbe_Position ····························· 8-35

March, 2017 8-1


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.

8 _ECAT_Slave_Motion_Ralm
Reset the alarm of the axis. Before applying this
command, please clear the alarm first. Otherwise,
the alarm might occur again.
Set the deceleration time for motor to decelerate
_ECAT_Slave_Motion_Sd_Stop
to stop
This is for emergency stop of the axis. The motor
_ECAT_Slave_Motion_Emg_Stop
will stop with its maximum deceleration
_ECAT_Slave_Motion_Set_Alm_Reaction Set the action when alarm occurs

_ECAT_Slave_Motion_Set_Position Specify current feedback position of the axis

_ECAT_Slave_Motion_Set_Command Set the motion command data of the axis

_ECAT_Slave_Motion_Set_MoveMode Set the motion mode of the axis

_ECAT_Slave_Motion_Get_MoveMode Acquire the information of current motion mode

_ECAT_Slave_Motion_Get_ControlWord Acquire the current control word of the axis

_ECAT_Slave_Motion_Get_StatusWord Acquire the current status word of the axis.

_ECAT_Slave_Motion_Get_Mdone Acquire the current status of motion done

_ECAT_Slave_Motion_Get_Position Acquire the current position of the axis.

_ECAT_Slave_Motion_Get_Command Acquire the current command information

_ECAT_Slave_Motion_Get_Target_Command Acquire the target command data of the axis

_ECAT_Slave_Motion_Get_Actual_Position Acquire the actual position command of the axis

Acquire the current command data. The data will


_ECAT_Slave_Motion_Get_Actual_Command
vary with to the applied motion mode.
_ECAT_Slave_Motion_Get_Current_Speed Acquire the current speed of the axis

_ECAT_Slave_Motion_Get_Torque Acquire the feedback torque from the motor


Acquiring the quantity of the commands that have
_ECAT_Slave_Motion_Get_Buffer_Length
not been carried out
Set the mode of the first Touch Probe function
_ECAT_Slave_Motion_Set_TouchProbe_Config
(Touch Probe 1)
Enable the first Touch Probe function (Touch
_ECAT_Slave_Motion_Set_TouchProbe_QuickStart
Probe 1)
Execute the first Touch Probe function (Touch
_ECAT_Slave_Motion_Set_TouchProbe_QuickDone
Probe 1) again
Disable the first Touch Probe function (Touch
_ECAT_Slave_Motion_Set_TouchProbe_Disable
Probe 1)
Acquire the current status of the first Touch Probe
_ECAT_Slave_Motion_Get_TouchProbe_Status
function (Touch Probe 1)
Acquire the current position of first Touch Probe
_ECAT_Slave_Motion_Get_TouchProbe_Position
function (Touch Probe 1)

8-2 March, 2017


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
8
This is for setting the servo to On/Off state.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

0: Servo Off
Enable U16 Option
1: Servo On

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U16 Enable=1;

Status = _ECAT_Slave_Motion_Set_Svon(CardNo, AxisNo, SlotNo, Enable);

March, 2017 8-3


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)

8  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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;

Status = _ECAT_Slave_Motion_Ralm(CardNo, AxisNo, SlotNo);

8-4 March, 2017


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
8
This is for setting the deceleration time for motor to decelerate to stop.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

The specified deceleration time.

CSP, CSV, and CST mode are in the unit of second.

HOME, PP, PV and PT mode are using the unit of the

Tdec F64 Time drive inc/s^2.

inc represents the unit for the slave setting. Please

refer to the user manual of the applied slave. (OD:

0x6083 Sub 0).

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
F64 Tdec=0.1;

Status = _ECAT_Slave_Motion_Sd_Stop(CardNo, AxisNo, SlotNo, Tdec);

March, 2017 8-5


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)

8  Purpose
This is for emergency stop of the axis. The motor will stop with its maximum deceleration.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;

Status = _ECAT_Slave_Motion_Emg_Stop(CardNo, AxisNo, SlotNo);

8-6 March, 2017


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
8
This is for setting the action when alarm occurs.
Note: It is also applicable to group function (Please refer to Chapter 17).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Set the action when error (Fault) occurs.

0: It will not stop or interrupt the new command

automatically.

Fault_Type U16 Option 1: Stop the current action when the rising-edge signal

is triggered. It will not interrupt the new command

automatically.

2: Remain idle status until the error is cleared.

Set the action when warning occurs.

0: It will not stop nor interrupt new command


automatically.

Waring_Type U16 Option 1: Stop the current action when the rising edge

triggered. It will not interrupt the new command

automatically.

2: Remain at idle unless the warning is cleared.

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I16 Fault_Type = 2, Waring_Type = 1;

Status = _ECAT_Slave_Motion_Set_Alm_Reaction (CardNo, AxisNo, SlotNo, Fault_Type,


Waring_Type);

March, 2017 8-7


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

8 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. Please pay
extra attention when using this API.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

NewPosition I32 Value Specify current feedback position

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 NewPosition=2500000;

Status = _ECAT_Slave_Motion_Set_Position(CardNo, AxisNo, SlotNo, NewPosition);

8-8 March, 2017


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
8
This is for setting the motion command data of the axis. The unit (property) of the data will vary
with the applying motion mode.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Acquire the current command information:

In CSP mode, the data is the current position.

NewCommand I32 Value In CSV mode, the data is the current speed.

In CST mode, the data is the permillage of current

torque.

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 NewCommand=3000000;

Status = _ECAT_Slave_Motion_Set_Command(CardNo, AxisNo, SlotNo, NewCommand);

March, 2017 8-9


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,

8 U16 SlotNo, U16 MoveMode)

 Purpose
This is for setting the motion mode of the axis.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Motion mode of the axis

0: Idle mode

1: Profile Position (PP) mode

2. Velocity mode

3: Profile Velocity (PV) mode

MoveMode U16 Mode 4: Profile Torque (PT) mode

6: Home mode

7: Interpolated Position (IP)

8: Cyclic Synchronous Position (CSP) mode

9: Cyclic Synchronous Velocity (CSV) mode


10: Cyclic Synchronous Torque (CST) mode

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0, MoveMode=1;

Status = _ECAT_Slave_Motion_Set_MoveMode(CardNo, AxisNo, SlotNo, MoveMode);

8-10 March, 2017


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
8
This is for acquiring the information of current motion mode.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

1: Profile Position (PP) mode

2: Velocity mode

3: Profile Velocity (PV) mode

4: Profile Torque (PT) mode

Mode U8* Mode 6: Home mode

7: Interpolated Position (IP) mode

8: Cyclic Synchronous Position (CSP) mode

9: Cyclic Synchronous Velocity (CSV) mode

10: Cyclic Synchronous Torque (CST) mode

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U8 Mode;

Status = _ECAT_Slave_Motion_Get_MoveMode (CardNo, AxisNo, SlotNo, &Mode);

March, 2017 8-11


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,

8 U16 SlotNo, U16 *ControlWord)

 Purpose
This is for acquiring the current control word of the axis.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Control word of the axis

ControlWord U16* Data (Please refer to the figure below for the definition. For

the reserved items, see the description of each slave.)

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U16 ControlWord ;

Status = _ECAT_Slave_Motion_Get_ControlWord (CardNo, AxisNo, SlotNo, &ControlWord);

 Description
Definition of 6040H: CANopen communication

Figure 8.2.1 Corresponding bits of control word

Definitions of the control word bits

Bit Name

0 Switch On

1 Enable Voltage (Servo on)

2 Quick Stop

3 Enable Operation (Motor enabled)

8-12 March, 2017


EtherCAT Programming Guide General Operation of Motion Axis

Bit Name

4 Operation Mode Specific (Operation mode)

5 Operation Mode Specific (Operation mode)

8
Operation Mode Specific (Operation mode)

Fault reset (Clear servo alarm)

Halt
8
9 ~15 N/A

Operation Mode Specific represents by bit 4 ~ 6 are as follows. See the table below:
Position
Profile Position Profile Velocity Profile Torque
Bit Homing mode Interpolation
(PP) mode (PV) mode (PT) mode
mode
New Position
Start homing
Command
4 (Rising-edge N/A N/A N/A
(Rising-edge
triggered)
triggered)

Activate
5 N/A N/A N/A N/A
Immediately

0: Absolute motion
6 N/A N/A N/A N/A
1: Relative motion

Table 8.2.3 Definition of Operation Mode Specific

March, 2017 8-13


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 ,

8 U16 * StatusWord)

 Purpose
This is for acquiring the current status word of the axis.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Status word of the axis

(Please refer to the figure below for the definition of


StatusWord U16* Data
Control Word. For the reserved items, see the

description of each Slave.)

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U16 StatusWord;

Status = _ECAT_Slave_Motion_Get_StatusWord (CardNo, AxisNo, SlotNo, &StatusWord);

 Description
Definition of 6041H: CANopen communication

Figure 8.3.1 Corresponding bits of status word

Definitions of the status word bits


Bit Name

0 Ready to Switch On

1 Switched On

2 Operation Enabled (Motor enabled)

8-14 March, 2017


EtherCAT Programming Guide General Operation of Motion Axis

Bit Name

3 Fault (Servo error occurs; motor disabled)

4 Voltage Enabled (Servo on)

7
Quick Stop

Switch On Disabled

Warning
8
8 N/A

9 Remote

10 Target Reached (Target-reached signal)

Internal Limit Active (internal software limit; not


11
supported)

12 Operation Mode Specific (Operation mode)

13 Operation Mode Specific (Operation mode)

14 N/A

15 N/A

Operation Mode Specific represents by bit 12 ~ 13 are as follows. See the table below:
Position
Profile Position Profile Velocity Profile Torque
Bit Homing mode Interpolation
(PP) mode (PV) mode (PT) mode
mode
New position Executing

12 command Executing homing position Velocity is 0 N/A

available interpolation

Position following Homing error


13 N/A N/A N/A
overrange occurs

Table 8.3.3 Definition of Operation Mode Specific

March, 2017 8-15


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

8 *Mdone)

 Purpose
This is for acquiring the current status of motion done.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

In Cyclic Synchronous (CS) mode

0: Idle state

1: Accelerating

2: Constant speed (CSP) / Target speed reached

(CSV) / Target torque reached (CST)

Mdone U16* Status 3: Decelerating

5: MailBox processing

In Profile series mode

0: Idle state
1: Motion in progress

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U16 Mdone;

Status = _ECAT_Slave_Motion_Get_Mdone (CardNo, AxisNo, SlotNo, &Mdone);

8-16 March, 2017


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
8
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. The virtual position
here signifies the master’s position before compensation, which is the machine’s actual target
position desired by users.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Position I32* Value Get the current position of the axis.

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
I32 Position=0;

Status = _ECAT_Slave_Motion_Get_Position (CardNo, AxisNo, SlotNo, &Position);

March, 2017 8-17


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,

8 I32 *Command)

 Purpose
This is for acquiring the current command information. The data unit (property) will vary with the
applying motion mode.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Acquire the current command information:

In CSP mode, the data is the current position.

Command I32* Data In CSV mode, the data is the current speed.

In CST mode, the data is the permillage of current

torque.

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 Command=0;

Status = _ECAT_Slave_Motion_Get_Command (CardNo, AxisNo, SlotNo, &Command);

8-18 March, 2017


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
8
This is for acquiring the target command data of the axis.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

The command differs from the applied motion mode.

CSP, PP mode: Target position

TargetCommand I32* Value CSV, PV mode: Target speed

CST, PT mode: Target torque

Homing mode: Returned value will be 0.

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 TargetCommand = 0;

Status = _ECAT_Slave_Motion_Get_Target_Command (CardNo, AxisNo, SlotNo,


&TargetCommand);

March, 2017 8-19


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,

8 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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Axis No.

SlotNo U16 Number Node ID

ActualPosition I32* Value Get actual feedback position of the motor.

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 ActualPosition;

Status = _ECAT_Slave_Motion_Get_Actual_Position(CardNo, AxisNo, SlotNo,


&ActualPosition);

8-20 March, 2017


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
8
This is for acquiring the current command data. The data will vary with to the applied motion
mode.
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 the information of current command.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Axis No.

SlotNo U16 Number Node ID

Acquire the current command information:

In CSP mode, the data is the current position.

ActualCommand I32* Value In CSV mode, the data is the current speed.

In CST mode, the data is the permillage (‰) of current

torque.

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 ActualCommand;

Status = _ECAT_Slave_Motion_ Get_Actual_Command (CardNo, AxisNo, SlotNo,


&ActualCommand);

March, 2017 8-21


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,

8 U16 SlotNo, I32 *Speed)

 Purpose
This is for acquiring the current speed of the axis.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Speed I32* Value Current speed of the axis.

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 Speed;

Status = _ECAT_Slave_Motion_Get_Current_Speed (CardNo, AxisNo, SlotNo, &Speed);

8-22 March, 2017


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
8
This is for acquiring the feedback torque from the motor.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Get the feedback torque from the motor (Unit:


Torque I16* permillage
permillage ‰ ).

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I16 Torque = 0;

Status = _ECAT_Slave_Motion_Get_Torque (CardNo, AxisNo, SlotNo, &Torque);

March, 2017 8-23


General Operation of Motion Axis EtherCAT Programming Guide

8.20 _ECAT_Slave_Motion_Get_Buffer_Length
 Syntax
U16 PASCAL _ECAT_Slave_Motion_Get_Buffer_Length (U16 CardNo, U16 AxisNo,

8 U16 SlotNo, U16 *BufferLength)

 Purpose
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. It will start to be executed after the current
command is finished. When the buffer stores more than 20 commands, the new coming ones will
be ignored. This API can be used to check the buffer status.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Get the quantity of the command that has not been


BufferLength U16* Quantity
carried out.

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0, BufferLength = 0;

Status = _ECAT_Slave_Motion_Get_Buffer_Length (CardNo, AxisNo, SlotNo,


& BufferLength);

8-24 March, 2017


EtherCAT Programming Guide General Operation of Motion Axis

8.21 _ECAT_Slave_Motion_Set_TouchProbe_Config
 Syntax
U16 PASCAL _ECAT_Slave_Motion_Set_TouchProbe_Config(U16 CardNo, U16 AxisNo, U16
SlotNo, U16 TriggerMode, U16 Signal_Source)

 Purpose
8
This is for setting the mode of the first Touch Probe function.
Through the servo drive or pulse module which provides Touch Probe function, users can
acquire the pulse (position) when the high-speed digital (DI) signal is triggered.
Apart from setting the first Touch Probe function, this API can be used to enable the first Touch
Probe function simultaneously. (Set CANopen OD code-60B8 bit 0 to 1)

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

This parameter is to define how the Touch Probe

function is triggered:

Please refer to the definition of Slave CANopen 60B8


TriggerMode U16 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 U16 Option 60B8 bit2.

2. Please refer to Description below for Delta’s


product.

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U16 TriggerMode =1; // Continuous recording; It will record the pulse (position) once the signal is
triggered.
Signal_Source=1; // Motor’s Z pulse is regarded as the trigger signal of Touch Probe 1

Status = _ECAT_Slave_Motion_Set_TouchProbe_Config(CardNo, AxisNo, SlotNo,


TriggerMode, Signal_Source);
Status = _ECAT_Slave_Motion_Set_TouchProbe_QuickStart(CardNo, AxisNo, SlotNo);

March, 2017 8-25


General Operation of Motion Axis EtherCAT Programming Guide

 Description
CANopen defines two Touch Probe functions in OD-60B8. However, the applying method varies

8 with the applied servo drive. 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.)
Bit Value Description

0 Disable Touch Probe 1


0
1 Enable Touch Probe 1

0 Record the pulse (position) when signal is triggered for the first time

1 Continuous recording; as long as the signals is triggered, the pulse


1
(position) will be recorded

0 Regard the digital input as the trigger signal of Touch Probe 1


2
1 Regard the motor’s Z pulse as the trigger signal of Touch Probe 1

3 0 Reserved

Stop capturing the pulse (position) when the trigger signal for Touch
0
Probe 1 is rising-edge triggered.
4
Start capturing the pulse (position) when the trigger signal for Touch
1
Probe 1 is rising-edge triggered.

Stop capturing the pulse (position) when the trigger signal for Touch
0
Probe 1 is falling-edge triggered.
5
Start capturing the pulse (position) when the trigger signal for Touch
1
Probe 1 is falling-edge triggered.

6~7 0 Reserved

Disable touch probe 2


0
(This API does not support Touch Probe function 2.)
8
Enable touch probe 2
1
(This API does not support Touch Probe function 2.)

Record the pulse (position) when signal is triggered for the first time
0
(This API does not support Touch Probe function 2.)

9 Continuous recording; as long as the signals is triggered, the pulse

1 (position) will be recorded

(This API does not support Touch Probe function 2.)

Regard the digital input as the trigger signal of Touch Probe 2


0
(This API does not support Touch Probe function 2.)
10
Regard the motor’s Z pulse as the trigger signal of Touch Probe 2
1
(This API does not support Touch Probe function 2.)

11 0 Reserved

8-26 March, 2017


EtherCAT Programming Guide General Operation of Motion Axis

Bit Value Description

(This API does not support Touch Probe function 2.)

Stop capturing the pulse (position) when the trigger signal for Touch

12
0 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
8
1 Probe 2 is rising-edge triggered.

(This API does not support Touch Probe function 2.)

Stop capturing the pulse (position) when the trigger signal for Touch

0 Probe 2 is falling-edge triggered.

(This API does not support Touch Probe function 2.)


13
Start capturing the pulse (position) when the trigger signal for Touch

1 Probe 2 is falling-edge triggered.

(This API does not support Touch Probe function 2.)

Reserved
14 ~ 15 0
(This API does not support Touch Probe function 2.)

March, 2017 8-27


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,

8 U16 AxisNo, U16 SlotNo)

 Purpose
This is for enabling the first Touch Probe function (Touch Probe 1). Use this API to set OD code –
60B8 bit 4 to 1.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

 Example
U16 Status, TouchProbe_Status, 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 signal is regarded as the trigger signal of the first Touch
Probe function.
Status = _ECAT_Slave_Motion_Set_TouchProbe_Config(CardNo, AxisNo, SlotNo,
TriggerMode, Signal_Source);
Status = _ECAT_Slave_Motion_Set_TouchProbe_QuickStart(CardNo, AxisNo, SlotNo);
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;
}
}
// Users have to enable the Touch Probe function again to record the pulse.
Status = _ECAT_Slave_Motion_Set_TouchProbe_Disable(CardNo, AxisNo, SlotNo);
Status = _ECAT_Slave_Motion_Set_TouchProbe_QuickStart(CardNo, AxisNo, SlotNo);

8-28 March, 2017


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)
{
8
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.
1. When 60B8 bit 1 is set to 0, Touch Probe function will be triggered for a single time.
2. Since this API function is not enabled, when it is triggered for the 0th time, 60B9 bit 1 is not
triggered and the value of 60BA (the recorded pulse position) is invalid.
3. When it is triggered for the 1st time (60B8 bit 4 is on), 60B9 bit 1 is triggered and the captured
pulse position will be stored in OD code – 60BA.
4. When it is triggered for the second time and also this API is applied (60B8 bit 4 is on), the
recorded pulse position is still invalid. This is because setting 60B8 bit 1 to 0 means the
signal will be triggered for once only.
- If 60B8 bit 1 is set to 1, then the new pulse position will be recorded.
- To record this pulse position, please refer to Trigger for the 3rd time (see the figure below).
Users should use the API “_ECAT_Slave_Motion_Set_TouchProbe_Disable” ( section 8.24)
to disable the Touch Probe function and restart it.
- Apart from the method mentioned above, you can API
“_ECAT_Slave_Motion_Set_TouchProbe_QuickDone” (section 8.23) to restart Touch Probe
function.

March, 2017 8-29


General Operation of Motion Axis EtherCAT Programming Guide

Enable Touch Probe function


60B8 bit 0

Start Touch Probe function

8
60B8 bit 4 Start Touch Probe Start Touch Probe

Function enabled status


60B9 bit 0

Status of triggering signal


60B9 bit 1

Pulse position 60BA


Record position 1 Record position 2

Triggered signal
Trigger for Trigger for Trigger for Trigger for
the 0th time the 1st time the 2nd time the 3rd time

Figure 8.22.1 Touch Probe – Trigger the signal for once (60B8 bit 1 = 0)

8.23 _ECAT_Slave_Motion_Set_TouchProbe_QuickDone
 Syntax
U16 PASCAL _ECAT_Slave_Motion_Set_TouchProbe_QuickDone(U16 CardNo, U16 AxisNo,
U16 SlotNo)

 Purpose
This is for executing the 1st Touch Probe function again.
When OD code – 60B8 bit 1 is set to 0, this function will be executed once. To execute this
function repeatedly, users have to use _ECAT_Slave_Motion_Set_TouchProbe_Disable (section
8.24) to disable the function first. Then, use _ECAT_Slave_Motion_Set_TouchProbe_QuickStart
(section 8.22) to enable it again. For more user-friendly way, you can directly re-activate the first
Touch Probe function through this API.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

8-30 March, 2017


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.
8
U16 Signal_Source=1; // Motor’s Z pulse is regarded as trigger signal of the first Touch Probe
function.

Status = _ECAT_Slave_Motion_Set_TouchProbe_Config(CardNo, AxisNo, SlotNo,


TriggerMode, Signal_Source);
Status = _ECAT_Slave_Motion_Set_TouchProbe_QuickStart(CardNo, AxisNo, SlotNo);

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;
}
}
// This API simplifies the step of re-activating the Touch Probe function (TriggerMode=0).
Status = _ECAT_Slave_Motion_Set_TouchProbe_QuickDone(CardNo, AxisNo, SlotNo);
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;
}
}

March, 2017 8-31


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

8 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.
Note: When TriggerMode in API (_ECAT_Slave_Motion_Set_TouchProbe_Config) in section 8.21 is set to 0,

users have to apply this API (disable Touch Probe 1) before using the function

(_ECAT_Slave_Motion_Set_TouchProbe_QuickStart) in section 8.22.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;

Status = _ECAT_Slave_Motion_Set_TouchProbe_Disable(CardNo, AxisNo, SlotNo);

8-32 March, 2017


EtherCAT Programming Guide General Operation of Motion Axis

8.25 _ECAT_Slave_Motion_Get_TouchProbe_Status
 Syntax
U16 PASCAL _ECAT_Slave_Motion_Get_TouchProbe_Status(U16 CardNo, U16 AxisNo, U16
SlotNo, U16 *Status)

 Purpose
8
This is for acquiring the current status of the first Touch Probe function (Touch Probe 1).
This API can be used to read the value of OD code – 60B9.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

This API can acquire the current status of the first

Touch Probe function and read the value of OD code –

60B9.

State U16* Value 1. Please refer to the definition of Slave CANopen

60B9.

2. Please refer to Description below for Delta’s


product.

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U16 TouchProbe_Status;

Status = _ECAT_Slave_Motion_Get_TouchProbe_Status(CardNo, AxisNo, SlotNo, &


TouchProbe_Status);

 Description
CANopen defines the status of Touch Probe function in OD codes-60B9. However, the applying
method varies with the applied servo drive. 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.)

March, 2017 8-33


General Operation of Motion Axis EtherCAT Programming Guide

CANopen-OD 60B9:

Bit Value Description

0 Touch probe 1 is disabled

8 0

1
1

1
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

0 The signal of Touch Probe 1 is not falling-edge triggered


2
1 The signal of Touch Probe 1 has been falling-edge triggered

3~5 0 Reserved

0 Regard digital input signal as the trigger signal for Touch Probe 1
6
1 Regard motor’s Z pulse as the trigger signal for Touch Probe 1

7 0, 1 Update the captured value of the Touch Probe 1

Touch probe 2 is disabled


0
(Remote pulse module does not support this function)
8
Touch probe 2 is enabled
1
(Remote pulse module does not support this function)

The signal of Touch Probe 2 is not rising-edge triggered


0
(Remote pulse module does not support this function)
9
The signal of Touch Probe 2 has been rising-edge triggered
1
(Remote pulse module does not support this function)

The signal of Touch Probe 2 is not falling-edge triggered


0
(Remote pulse module does not support this function)
10
The signal of Touch Probe 2 has been falling-edge triggered
1
(Remote pulse module does not support this function)

Reserved
11 ~ 13 0
(Remote pulse module does not support this function)

Regard digital input signal as the trigger signal for Touch Probe 2
0
(Remote pulse module does not support this function)
14
Regard motor’s Z pulse as the trigger signal for Touch Probe 2
1
(Remote pulse module does not support this function)

Update the captured value of the Touch Probe 2


15 0, 1
(Remote pulse module does not support this function)

8-34 March, 2017


EtherCAT Programming Guide General Operation of Motion Axis

8.26 _ECAT_Slave_Motion_Get_TouchProbe_Position
 Syntax
U16 PASCAL _ECAT_Slave_Motion_Get_TouchProbe_Position(U16 CardNo, U16 AxisNo, U16
SlotNo, I32 *LatchPosition)

 Purpose
8
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

The captured position; When it captures the signal

again, this value will be updated. Please remember to

LatchPosition I32* Value save the captured position of each time.

Please refer to the returned value of Slave CANopen

60BA bit2.

 Example
U16 Status, TouchProbe_Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 LatchPosition = 0;
U16 TriggerMode =1; // Continuous recording; It will record the pulse (position) once the signal
is triggered.
U16 Signal_Source=1; // Motor’s Z pulse signal is regarded as the trigger signal of the first Touch
Probe.

Status = _ECAT_Slave_Motion_Set_TouchProbe_Config(CardNo, AxisNo, SlotNo,


TriggerMode, Signal_Source);
Status = _ECAT_Slave_Motion_Set_TouchProbe_QuickStart(CardNo, AxisNo, SlotNo);

while (1)
{
Status = _ECAT_Slave_Motion_Get_TouchProbe_Status(CardNo, AxisNo, SlotNo, &
TouchProbe_Status);
if (TouchProbe_Status & 0x2)

March, 2017 8-35


General Operation of Motion Axis EtherCAT Programming Guide

{
Status = _ECAT_Slave_Motion_Get_TouchProbe_Position(CardNo, AxisNo, SlotNo,
&LatchPosition);

8 }
}

8-36 March, 2017


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.

7
9.1 _ECAT_Slave_CSP_Start_Move ·························································· 9-5
9.2 _ECAT_Slave_CSP_Start_V_Move ······················································· 9-7
9.3 _ECAT_Slave_CSP_Start_Arc_Move ···················································· 9-8
9.4 _ECAT_Slave_CSP_Start_Arc2_Move ················································· 9-10
9.5 _ECAT_Slave_CSP_Start_Arc3_Move ················································· 9-12
9.6 _ECAT_Slave_CSP_Start_Spiral_Move ··············································· 9-14
9.7 _ECAT_Slave_CSP_Start_Spiral2_Move·············································· 9-15
9.8 _ECAT_Slave_CSP_Start_Sphere_Move ············································· 9-17
9.9 _ECAT_Slave_CSP_Start_Heli_Move ·················································· 9-18
9.10 _ECAT_Slave_CSP_Start_Multiaxes_Move········································· 9-20
9.11 _ECAT_Slave_CSP_Start_Msbrline_Move ·········································· 9-21
9.12 _ECAT_Slave_CSP_Set_Gear ························································· 9-25
9.13 _ECAT_Slave_CSP_Set_Softlimit ······················································· 9-26
9.14 _ECAT_Slave_CSP_TargetPos_Change············································· 9-27
9.15 _ECAT_Slave_CSP_Velocity_Change ················································ 9-28
9.16 _ECAT_Slave_CSP_Feedrate_Overwrite ············································ 9-29
9.17 _ECAT_Slave_CSP_Speed_Continue_Enable ······································· 9-33
9.18 _ECAT_Slave_CSP_Speed_Continue_Set_Mode ··································· 9-34
9.19 _ECAT_Slave_CSP_Speed_Continue_Set_Combine_ Ratio ··················· 9-37
9.20 _ECAT_Slave_CSP_Scurve_Rate ······················································· 9-38
9.21 _ECAT_Slave_CSP_Liner_Speed_Master············································· 9-39
9.22 _ECAT_Slave_CSP_Mask_Axis ························································ 9-41
9.23 _ECAT_Slave_CSP_Sync_Config ····················································· 9-42
9.24 _ECAT_Slave_CSP_Sync_Move ······················································ 9-43
9.25 _ECAT_Slave_CSP_Start_Mabrline_Move ·········································· 9-44
9.26 _ECAT_Slave_CSP_Start_2Segment_Move········································ 9-46
9.27 _ECAT_Slave_CSP_Start_PVT_Move ··············································· 9-48
9.28 _ECAT_Slave_CSP_Start_PVTComplete_Move ··································· 9-50

March, 2017 9-1


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 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 ·············································· 9-60

9-2 March, 2017


EtherCAT Programming Guide 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.

API list of cyclic synchronous position mode (CSP)


9
Function name Description

_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
Execute two-axis arc motion, moving from current
_ECAT_Slave_CSP_Start_Arc2_Move position and the specified circle center to form the
specified arc’s angle
Execute two-axis arc motion, moving from the
_ECAT_Slave_CSP_Start_Arc3_Move current position and specified circle center to the
specified end point
Execute two-axis spiral motion, moving from
_ECAT_Slave_CSP_Start_Spiral_Move current position and the specified circle center to
form the specified angle
Execute two-axis spiral motion, moving from
_ECAT_Slave_CSP_Start_Spiral2_Move current position and the specified circle center to
the end point with the specified cycle number.
Execute three-axis sphere motion and moving
from current position and the known circle center
_ECAT_Slave_CSP_Start_Sphere_Move
to the target position with three-dimensional
vector
Set three-axis helical motion, moving from current
_ECAT_Slave_CSP_Start_Heli_Move position and the known circle center to the
specified height in Z-axis direction
_ECAT_Slave_CSP_Start_Multiaxes_Move Execute multi-axis linear motion
Execute multi-axis point to point motion with
_ECAT_Slave_CSP_Start_Msbrline_Move
smooth speed
_ECAT_Slave_CSP_Set_Gear Set the E-gear ratio

_ECAT_Slave_CSP_Set_Softlimit Set the software limit

_ECAT_Slave_CSP_TargetPos_Change Set a new target position

_ECAT_Slave_CSP_Velocity_Change Set a new target speed


For the advanced setting of speed change for
_ECAT_Slave_CSP_Feedrate_Overwrite
single axis

_ECAT_Slave_CSP_Speed_Continue_Enable Enable or disable the continuous speed function

_ECAT_Slave_CSP_Speed_Continue_Set_Mode Set the continuous speed mode


_ECAT_Slave_CSP_Speed_Continue_Set_Combine Set the percentage of for starting blending speed
_Ratio of two commands.
Set the ratio of S-curve and T-curve during
_ECAT_Slave_CSP_Scurve_Rate
acceleration and deceleration
Set the speed (vector) of advanced interpolation
_ECAT_Slave_CSP_Liner_Speed_Master
function.

March, 2017 9-3


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.

9 _ECAT_Slave_CSP_Sync_Config

_ECAT_Slave_CSP_Sync_Move
Set the function of synchronous motion of multiple
axes
Enable the function of synchronous motion of
multiple axes
Set to smooth the operation of point-to-point
_ECAT_Slave_CSP_Start_Mabrline_Move
motion of multiple axes
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
_ECAT_Slave_CSP_Start_PVTComplete_Move single-axis motion, moving through multiple points
at fixed time.
_ECAT_Slave_CSP_Virtual_Set_Enable Enable function of virtual position
Set the virtual position and replacing the current
_ECAT_Slave_CSP_Virtual_Set_Command
position with the specified position
_ECAT_Slave_CSP_Get_SoftLimit_Status Acquire the status of software limit

_ECAT_Slave_CSP_Pitch_Set_Interval Set the interval of the pitch error compensation

_ECAT_Slave_CSP_Pitch_Set_Mode Set the mode of pitch error compensation

_ECAT_Slave_CSP_Pitch_Set_Org Set the start position of pitch error compensation.


Set the relative position of each interval for pitch
_ECAT_Slave_CSP_Pitch_Set_Rel_Table
error compensation
Set the absolute position of each interval for pitch
_ECAT_Slave_CSP_Pitch_Set_Abs_Table
error compensation
_ECAT_Slave_CSP_Pitch_Set_Enable Enable function of pitch error compensation.

9-4 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.1 _ECAT_Slave_CSP_Start_Move
 Syntax

9
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Dist I32 Pulse The specified moving distance

StrVel I32 Pulse / second The initial speed of the motion

ConstVel I32 Pulse / second The constant speed of the motion

EndVel I32 Pulse / second The end speed of the motion

Duration to change from initial speed to constant


TPhase1 F64 Second
speed

TPhase2 F64 Second Duration to change from constant speed to end speed

0: T-curve(Default)
Scurve U16 Option
2: S-curve

0: Relative movement (Default)


Abs_Rel U16 Option
1: Absolute movement

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
I32 Dist=12000000, Strvel=0, ConstVel =2000000, EndVel=0;
F64 TPhase1=0.1, TPhase2=0.1;
U16 Scurve=0, Abs_Rel=1;

Status = _ECAT_Slave_CSP_Start_Move (CardNo, AxisNo, SlotNo, Dist, Strvel, ConstVel,


EndVel, Tacc, Tdec, Scurve, Abs_Rel);

March, 2017 9-5


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

 Description
Linear interpolation of CSP command (acc/deceleration)
V(pps)

9 Constant
Velocity

Start End
Velocity Velocity

T(sec)
TPhase1 TPhase2

Figure 9.1.1 Perform lineter interpolation by referring to relative coordinates (T-curve)

V(pps)

Constant
Velocity

End
Start
Velocity
Velocity
T(sec)

TPhase1 TPhase2

Figure 9.1.2 Perform linear interpolation by referring to relative coordinates (S-curve)

9-6 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.2 _ECAT_Slave_CSP_Start_V_Move
 Syntax

9
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Moving direction

Dir U16 Option 0: Forward

1: Reverse

Strvel I32 Pulse / second Parameter of initial speed

MaxVel I32 Pulse / second Parameter of the constant speed

Tacc F64 Time (second) Acceleration time

0: T-curve(Default)
Scurve U16 Option
2: S-curve

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 Dir=1, Strvel=0, MaxVel=2000000;
F64 Tacc =0.1;
U16 Scurve=0, Abs_Rel=1;

Status = _ECAT_Slave_CSP_Start_V_Move (CardNo, AxisNo, SlotNo, Dir, Strvel,


MaxVel, Tacc, Scurve, Abs_Rel);

March, 2017 9-7


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.3 _ECAT_Slave_CSP_Start_Arc_Move
 Syntax

9
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)

 Purpose
This is for executing two-axis arc motion, moving from current position and the specified circle
center to form the specified arc’s angle.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Array for each axis (node ID); the array number should

Array for each equal to the axis number


AxisNo U16*
axis AxisNo Array[0] stores the first node

AxisNo Array[1] stores the second node

Array for each


SlotNo U16* Array for each axis (slot ID)
slot

Array of pulse
CenterPoint I32* Circle center
for each axis

Angle F64 Angle (°) Set the angle of an arc.

Strvel I32 Pulse / second Parameter of the motion initial speed

ConstVel I32 Pulse / second Parameter of the motion constant speed

EndVel I32 Pulse / second Parameter of the motion end speed

Duration to change from initial speed to constant


TPhase1 F64 Time (second)
speed

TPhase2 F64 Time (second) Duration to change from constant speed to end speed

0: T-curve(Default)
Scurve U16 Option
2: S-curve

0: Relative movement (Default)


Abs_Rel U16 Option
1: Absolute movement

9-8 March, 2017


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)

 Example
U16 Status;
U16 CardNo=0, AxisNoArray[2]={1,2}, SlotID[2]={0, 0};
I32 CenterPoint[2] ={50000,50000};
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_Arc_Move (CardNo, AxisNoArray, SlotID, CenterPoint,


Angle,Strvel, ConstVel, EndVel, TPhase1, TPhase2, Scurve, Abs_Rel);

March, 2017 9-9


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.4 _ECAT_Slave_CSP_Start_Arc2_Move
 Syntax

9
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Array for each axis (node ID); the array number should

Array for each equal to the axis number


AxisNo U16*
axis AxisNo Array[0] stores the first node

AxisNo Array[1] stores the second node

Array for each


SlotNo U16* Array for each axis (slot ID)
slot

Array of pulse
EndPoint I32* End point
for each axis

Set the angle of an arc.

When the angle > 0, it means the arc motion will be

Angle F64 Angle (°) carried out in clockwise direction.

When the angle < 0, it means the arc motion will be

carried out in counterclockwise direction.

Strvel I32 Pulse / second Parameter of the motion initial speed

ConstVel I32 Pulse / second Parameter of the motion constant speed

EndVel I32 Pulse / second Parameter of the motion end speed

Duration to change from initial speed to constant


TPhase1 F64 Time (second)
speed

TPhase2 F64 Time (second) Duration to change from constant speed to end speed

0: T-curve(Default)
Scurve U16 Option
2: S-curve

0: Relative movement (Default)


Abs_Rel U16 Option
1: Absolute movement

9-10 March, 2017


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;
9
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);

 Descirption
The specified angle cannot be exactly 360 degrees (or its multiple).

Figure 9.4.1 Regard the specified angle from current position as the inlucded angle and moves to the
specified end point

Figure 9.4.2 Desectipion of TPhase1 and TPhase2 (acc/deceleration)

March, 2017 9-11


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.5 _ECAT_Slave_CSP_Start_Arc3_Move
 Syntax

9
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)

 Purpose
This is for executing two-axis arc motion, moving from the current position and specified circle
center to the specified end point.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Array for each axis (node ID); the array number should

Array for each equal to the axis number


AxisNo U16*
axis AxisNo Array[0] stores the first node

AxisNo Array[1] stores the second node

Array for each


SlotNo U16* Array for each axis (slot ID)
slot

Array of pulse
CenterPoint I32* Circle center
for each axis

Array of pulse
EndPoint I32* End point
for each axis

Moving direction of the arc motion


Dir U16 Option
0: Clockwise; 1: counterclockwise

StrVel I32 Pulse / second Parameter of the motion initial speed

ConstVel I32 Pulse / second Parameter of the motion constant speed

EndVel I32 Pulse / second Parameter of the motion end speed

Duration to change from initial speed to constant


TPhase1 F64 Time (second)
speed

TPhase2 F64 Time (second) Duration to change from constant speed to end speed

0: T-curve(Default)
Scurve U16 Option
2: S-curve

0: Relative movement (Default)


Abs_Rel U16 Option
1: Absolute movement

9-12 March, 2017


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; 9
Status = _ECAT_Slave_CSP_Start_Arc3_Move(CardNo, AxisNoArray, SlotID, CenterPoint,
EndPoint, Angle, Strvel, ConstVel, EndVel, TPhase1, TPhase2, Scurve, Abs_Rel);

 Description
This command can be executed only when the arc is less than 360 degrees.

Figure 9.5.1 Move from current position and specified circle center to the specified end point
Note:
1. In the left figure, the axis reaches the specified position.
2. In the right figure, the axis cannot reach the specified position. It is because the distance between its
current position and specified position (arc radius) is different from the distance between the specified
end point and specified circle center.

Figure 9.3.2 Description of TPhase1 and TPhase2 (acc/deceleration)

March, 2017 9-13


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.6 _ECAT_Slave_CSP_Start_Spiral_Move
 Syntax

9
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)

 Purpose
This is for executing two-axis spiral motion, moving from current position and the specified circle
center to form the specified angle.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Array for each axis (node ID); the array number

Array for each should equal to the axis number


AxisNo U16*
axis AxisNo Array[0] stores the first node

AxisNo Array[1] stores the second node

SlotNo U16* Array for each


Array for each axis (slot ID)
slot

CenterPoint I32* Array of pulse


Circle center
for each axis

Sprial pitch

When the value > 0, it means the spiral rotates in


Array of pulse
Spiral_Interval I32* outward direction.
for each axis
When the value < 0, it means the spiral rotates in

inward direction.

Angle F64 Rotation angle of the spiral motion (360 degrees for 1
Angle
cycle)

Strvel I32 Pulse / second Parameter of the motion initial speed

ConstVel I32 Pulse / second Parameter of the motion constant speed

EndVel I32 Pulse / second Parameter of the motion end speed

Duration to change from initial speed to constant


TPhase1 F64 Time (second)
speed

TPhase2 F64 Time (second) Duration to change from constant speed to end speed

0: T-curve(Default)
Scurve U16 Option
2: S-curve

0: Relative movement (Default)


Abs_Rel U16 Option
1: Absolute movement

9-14 March, 2017


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;
9
Status = _ECAT_Slave_CSP_Start_Spiral_Move(CardNo, AxisNo, SlotID, CenterPoint,
Spiral_Interval, Angle , StrVel, ConstVel, EndVel, TPhase1, TPhase2, Scurve, Abs_Rel);

9.7 _ECAT_Slave_CSP_Start_Spiral2_Move
 Syntax
U16 PASCAL _ECAT_Slave_CSP_Start_Spiral2_Move(U16 CardNo, U16 *AxisNo,
U16 *SlotNo, I32 *CenterPoint, I32 EndPoint, U16 Dir, U16 CycleNum, I32 StrVel,
I32 ConstVel, I32 EndVel, F64 TPhase1, F64 TPhase2, U16 Scurve, U16 Abs_Rel)

 Purpose
This is for executing two-axis spiral motion, moving from current position and the specified circle
center to the end point with the specified cycle number.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Array for each axis (node ID); the array number

Array for each should equal to the axis number


AxisNo U16*
axis AxisNo Array[0] stores the first node

AxisNo Array[1] stores the second node

Array for each Array for each axis (slot ID); the array number should
SlotNo U16*
slot equal to the axis number

Array of pulse
CenterPoint I32* Circle center
for each axis

Array of pulse
EndPoint I32* End point
for each axis

Moving direction of spiral motion

Dir U16 Option 0: Clockwise

1: Counterclockwise

CycleNum U16 Number Cycle number of spiral motion

Strvel I32 Pulse / second Parameter of the motion initial speed

March, 2017 9-15


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

Name Data type Property Description

ConstVel I32 Pulse r / second Parameter of the motion constant speed

EndVel I32 Pulse / second Parameter of the motion end speed

9 TPhase1

TPhase2
F64

F64
Time (second)

Time (second)
The time it takes to change from initial speed to

constant speed

This time it takes to change from constant speed to

end speed

0: T-curve(Default)
Scurve U16 Option
2: S-curve

0: Relative movement (Default)


Abs_Rel U16 Option
1: Absolute movement

 Example
U16 Status, CardNo=0, AxisNo[2]={1,2}, SlotID[2]={0, 0},Dir=0, Scurve =0, Abs_Rel =0,
U16 CycleNum=2;
I32 CenterPoint[2] ={50000,50000}, EndPoint [2] ={60000,100000};
I32 StrVel=0, ConstVel =50000, EndVel=20000;
F64 TPhase1=0.2, TPhase2=0.1;
Status = _ECAT_Slave_CSP_Start_Spiral2_Move(CardNo, AxisNo, SlotID, CenterPoint,
EndPoint, Dir, CycleNum, StrVel, ConstVel, EndVel, TPhase1, TPhase2, Scurve, Abs_Rel);

9-16 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.8 _ECAT_Slave_CSP_Start_Sphere_Move
 Syntax

9
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)

 Purpose
This is for executing three-axis sphere motion, moving from current position and the known circle
center to the target position with three-dimensional vector.

 Parameter
Name Data type Property Description

CardNo U16 Number Card number

Array for each axis (node ID); the array number

should equal to the axis number


Array for each
AxisNo U16* AxisNo Array[0] stores the first node
axis
AxisNo Array[1] stores the second node

AxisNo Array[2] stores the third node

Array for each


SlotNo U16* Array for each axis (slot ID)
slot

Target1Point[0] stores any point on X-axis in the arc


Array of pulse
Target1Point I32* Target1Point[1] stores any point on Y-axis in the arc
for each axis
Target1Point[2] stores any point on Z-axis in the arc

Target2Point[0] stores the end point of X-axis


Array of pulse
Target2Point I32* Target2Point[1] stores the end point of Y-axis
for each axis
Target2Point[2] stores the end point of Z-axis

Strvel I32 Pulse / second Parameter of the motion initial speed

ConstVel I32 Pulse / second Parameter of the motion constant speed

EndVel I32 Pulse / second Parameter of the motion end speed

TPhase1 F64 Time (second) The time is spend from initial speed to constant speed

TPhase2 F64 Time (second) This time is spend from constant speed to end speed

0: T-curve (Default)
Scurve U16 Option
2: S-curve

0: Relative movement (Default)


Abs_Rel U16 Option
1: Absolute movement

March, 2017 9-17


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};

9 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);

9.9 _ECAT_Slave_CSP_Start_Heli_Move
 Syntax
U16 PASCAL _ECAT_Slave_CSP_Start_Heli_Move (U16 CardNo, U16 *AxisNo,
U16 *SlotNo,I32 *CenterPoint, I32 Depth, I32 Pitch, U16 Dir, I32 Strvel, I32 ConstVel,
I32 EndVel, F64 TPhase1, F64 TPhase2, U16 Scurve, U16 Abs_Rel)

 Purpose
This is for executing three-axis helical motion, moving from current position and the known circle
center to the specified height in Z-axis direction.

 Parameter
Name Data type Property Description

CardNo U16 Number Card number

Array for each axis (node ID); the array number


should equal to the axis number
Array for each
AxisNo U16* AxisNo Array[0] stores the first node
axis
AxisNo Array[1] stores the second node
AxisNo Array[2] stores the third node

Array for each


SlotNo U16* Array for each axis (slot ID)
slot

Array of pulse
CenterPoint I32* Circle center
for each axis

The depth of the specified axis (the overall height of


Depth I32 Pulse
Z-axis; this value can be negative)

Pitch I32 Pulse Specify the pitch of the helix

Helical oving direction


Dir U16 Option
0: Clockwise; 1: counterclockwise

Strvel I32 Pulse / second Parameter of the motion initial speed

ConstVel I32 Pulse / second Parameter of the motion constant speed

EndVel I32 Pulse / second Parameter of the motion end speed

9-18 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

Name Data type Property Description

TPhase1 F64 Time (second) The time is spend from initial speed to constant speed

TPhase2 F64 Time (second) This time is spend from constant speed to end speed

Scurve

Abs_Rel
U16

U16
Option

Option
0: T-curve (Default)

2: S-curve

0: Relative movement (Default)


9
1: Absolute movement

 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}, Depth =10000, Pitch = 20000;
I32 StrVel=0, ConstVel =50000, EndVel=20000;
F64 TPhase1=0.2, TPhase2=0.1;

Status = _ECAT_Slave_CSP_Start_Heli_Move (CardNo, AxisNoArray, SlotID, CenterPoint ,


Depth, Pitch, Dir, Strvel, ConstVel, EndVel, TPhase1, TPhase2, Scurve, Abs_Rel);

 Descirption

Figure 9.9.1 Moving from current position and the known circle center to the specified height in
Z-axis direction

March, 2017 9-19


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.10 _ECAT_Slave_CSP_Start_Multiaxes_Move
 Syntax

9
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)

 Purpose
This is for executing multi-axis linear motion.

 Parameter
Name Data type Property Description

CardNo U16 Number Card number

The engaged axis number. Please refer to Secion 2.1


AxisNum U16 Quantity
for the maximun value.

Array for each axis (node ID); the array number should

equal to the axis number


Array for each
AxisArray U16* AxisNo Array[0] stores the first node
axis
AxisNo Array[1] stores the second node

….

Array for each Array for each axis (slot ID); the array number should
SlotArray U16*
slot equal to the axis number

Array of pulse Array of the moving distance for each axis; the array
DistArrary I32*
for each axis number should equal to the axis number

Strvel I32 Pulse / second Parameter of the motion initial speed

ConstVel I32 Pulse / second Parameter of the motion constant speed

EndVel I32 Pulse / second Parameter of the motion end speed

TPhase1 F64 Time (second) Duration to change from initial speed to constant speed

TPhase2 F64 Time (second) Duration to change from constant speed to end speed

0: T-curve(Default)
Scurve U16 Option
2: S-curve

0: Relative movement (Default)


Abs_Rel U16 Option
1: Absolute movement

9-20 March, 2017


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; 9
Status = _ECAT_Slave_CSP_Start_Multiaxes_Move (CardNo, AxisNum, AxisArray,
SlotArray, DistArrary, Strvel, ConstVel, EndVel, TPhase1, TPhase2, Scurve, Abs_Rel);

9.11 _ECAT_Slave_CSP_Start_Msbrline_Move
 Syntax
U16 PASCAL _ECAT_Slave_CSP_Start_Msbrline_Move (U16 CardNo, U16 AxisNum,
U16 *AxisArray, U16 *SlotArray, U16 ArcNodeBit, I32 *Target1Point , I32 *Target2Point,
U16 Mode, I32 Parameter, F64 ArcAngle1, F64 ArcAngle2, F64 SpeedRatio, I32 Strvel,
I32 ConstVel, I32 EndVel, F64 TPhase1, F64 TPhase2, U16 Scurve, U16 Abs_Rel)

 Purpose
This is for executing multi-axis point to point motion with smooth speed.
When connecting two paths with smooth acceleration and deceleration, motion path might not be
identical to the target position. This API can be applied to set the position when connecting two
paths and the position of the actual path.
Note: If the position error is set too small, it might cause machine vibration.

 Parameter
Name Data type Property Description

CardNo U16 Number Card number

AxisNum U16 Quantity The engaged axis number (max. number is 8)

Array for each axis (node ID); the array number should

equal to the axis number


Array for each
AxisArray U16* AxisNo Array[0] stores the first node
axis
AxisNo Array[1] stores the second node

….

Array for each Array for each axis (slot ID); the array number should
SlotArray U16*
slot equal to the axis number

If one of the paths is arc, please complete the setting

below:
ArcNodeBit U16 Value
As shown in figure 9.11.1, M1 and M2 is motion path

running from current position, TargetPoint1 to

March, 2017 9-21


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

Name Data type Property Description

TargetPoint2.
M1 M2

9
16 Bits 0 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0
2 1 4 3 2 1 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.

If M1 is the path of linear motion and M2 is the path of

arc motion executed by axis 3 and 4, the parameter

value will be 0x000C.

Array of the first target position; the array number should

equal to the axis number

If M1 is the path of linear motion, please input the end

Array of pulse point.


TargetPoint1 I32*
for each axis If M1 is the path of arc motion, please input the arc’s

circle center.

For other axes, please input the value which is identical

to the start position.

Array of the secondt target position; the array number

should equal to the axis number

If M2 is the path of linear motion, please input the end

Array of pulse point.


TargetPoint2 I32*
for each axis If M1 is the path of arc motion, please input the arc’s

circle center.

For other axes, please input the value which is identical

to the first target position.

0: M1 and M2 are the paths of linear motion

1: M1 is the path of linear motion and M2 is the path of

arc motion
Mode U16 Option
2: M1 is the path of arc motion and M2 is the path of

linear motion

3: M1 and M2 are the paths of arc motion

Position error of the moving distance

 Position error is defined as the shortest distance

between the actual motion path and target position.

Parameter I32 Value  When this value is set to 0, it means it will not

decelerate when passing the first target position and

machine will vibrate.

 When this value is set too large, the system will

9-22 March, 2017


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


9
ignored.
ArcAngle1 F64 Angle (°)
If M1 is the path of arc motion, this value is the arc

angle.

If M2 is the path of linear motion, this value will be

ignored.
ArcAngle2 F64 Angle (°)
If M2 is the path of arc motion, this value is the arc

angle.

SpeedRatio F64 Value Speed ratio of M1 and M2, which is .

Strvel I32 Pulse / second Parameter of the motion initial speed

ConstVel I32 Pulse / second Parameter of the motion constant speed

EndVel I32 Pulse / second Parameter of the motion end speed

TPhase1 F64 Time (second) Duration to change from initial speed to constant speed

TPhase2 F64 Time (second) Duration to change from constant speed to end speed

0: T-curve (Default)
Scurve U16 Option
2: S-curve

 Description

Figure 9.11.1 In this figure, the path is consisted of four _ECAT_Slave_CSP_Start_Msbrline_Move


commands and Mode is set to 0

March, 2017 9-23


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;

9 U16 Mode =1, Scurve =0, Abs_Rel =0;


I32 TargetPoint1 [2]= {100000,200000}, TargetPoint2 [2]= {100000,200000};
I32 StrVel=0, ConstVel =50000, EndVel=20000;
F64 Parameter = 2 , ArcAngle1 = 0, ArcAngle2 = 0, SpeedRatio = 1;
F64 TPhase1=0.2, TPhase2=0.1;

Status = _ECAT_Slave_CSP_Start_Msbrline_Move (CardNo, AxisNum, AxisArray,


SlotArray, ArcNodeBit, TargetPoint1, TargetPoint2, Mode, Parameter, ArcAngle1,
ArcAngle2, SpeedRatio, Strvel, ConstVel, EndVel, TPhase1, TPhase2, Scurve, Abs_Rel);

9-24 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.12 _ECAT_Slave_CSP_Set_Gear
 Syntax

9
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 Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Nummerator F64 Value Set the numerator of E-gear ratio

Denominator F64 Value Set the denominator of E-gear ratio

0: Disable the function of E-gear


Enable I16 Option
1: Enable the function of E-gear

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I16Enable=1;
F64 Nummerator=1.0, Denominator=2.0;

Status = _ECAT_Slave_CSP_Set_Gear(CardNo, AxisNo, SlotNo, Nummerator,


Denominator, Enable);

March, 2017 9-25


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.13 _ECAT_Slave_CSP_Set_Softlimit
 Syntax

9
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:
1. Function of software limit is only available in CSP mode.
2. Users can acquire the status of software limit of each axis via the API
(_ECAT_Slave_CSP_Get_SoftLimit_Status) in section 9.31.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

PosiLimit I32 Value Set the value of software positive limit

NegaLimit I32 Value Set the value of software negative limit

1: Motor stops as soon as it reaches the limit

Mode U16 Option 2: Motor decelerates to stop after reaching the limit

(The deceleration time is 0.01 second).

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I16 PosiLimit =1000000, NegaLimit =-1000000, Mode =1;

Status = _ECAT_Slave_CSP_Set_Softlimit (CardNo, AxisNo, SlotNo, PosiLimit,


NegaLimit, Mode);

9-26 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.14 _ECAT_Slave_CSP_TargetPos_Change
 Syntax

9
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

NewTargetCmd I32 Pulse New target position

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
I32 NewTargetCmd =2000000;

Status=_ECAT_Slave_CSP_TargetPos_Change (CardNo, AxisNo, SlotNo, NewTargetCmd);

March, 2017 9-27


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.15 _ECAT_Slave_CSP_Velocity_Change
 Syntax

9
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:
1. This function is available when the current command running with constant speed.
2. This function can be carried out in mode 0 of _ECAT_Slave_CSP_Feedrate_Overwrite.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

NewTargetSpd I32 Pulse / second The new target speed

The specified acceleration/deceleration time for


Tsec F64 Second
speed changing.

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
I32 NewTargetSpd =1000000;
F64 Tsec=0.1;

Status = _ECAT_Slave_CSP_Velocity_Change (CardNo, AxisNo, SlotNo,


NewTargetSpd,Tsec);

 Description

Figure 9.15.1 This function is identical to mode 0 of _ECAT_Slave_CSP_Feedrate_Overwrite

9-28 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.16 _ECAT_Slave_CSP_Feedrate_Overwrite
 Syntax

9
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.
Note: To change to the default speed after it is in mode 1 or mode 2, users have to set it to mode 0 again to
and set NewSpeed to avoid sudden inintended acceleration.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

0: Change the vector velocity when the current motion

is at constant speed.

1: The current speed and the speed in the later

commands will be changed once the new speed is

Mode U16 Option set.

2: The current speed and the speed in the later

commands will be changed by the speed ratio once

the new speed is set. The range is from 0% ~

1000%.

When Mode is set to 0 and 1, input the speed to be

replaced.
NewSpeed I32 Pulse / second
When Mode is set to 2, input the speed rator to be

replaced, range from 0% ~ 1000.

The specified acceleration/deceleration time for speed


Tsec F64 Second
changing.

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Mode=0;
I32 NewSpeed =3000;
F64 Tsec=0.1;

Status = _ECAT_Slave_CSP_Feedrate_Overwrite (CardNo, AxisNo, SlotNo, Mode,


NewSpeed, Tsec);

March, 2017 9-29


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. And the speed of all CSP motion
commands will also be changed once the NewSpeed command is issued.
Note: The multi-axis motion speed will be changed only when the first axis in the array is identical to
the axis set in this API.
Example:
AxisNo = 1; NewSpeed = 100;
_ECAT_Slave_CSP_Feedrate_Overwrite (0, AxisNo, 0, 1, NewSpeed, 1);
AxisNoArray = {2, 1}; SlotID = {0, 0}; ConstVel = 100000;
_ECAT_Slave_CSP_Start_Arc_Move (0, AxisNoArray, SlotID, CenterPoint, 180, 0,
ConstVel, 0, 1, 1, 1, 1);
The first axis of AxisNoArray is axis 2, which is different from the AxisNo. Thus, the
constant speed of the arc motion will not be changed.
AxisNoArray = {1, 2}; SlotID = {0, 0}; ConstVel = 100000;
_ECAT_Slave_CSP_Start_Arc_Move (0, AxisNoArray, SlotID, CenterPoint, 180, 0,
ConstVel, 0, 1, 1, 1, 1);
The first axis of AxisNoArray is axis 1, which is identical to AxisNo. Thus, the constant
speed of the arc motion will be replaced with the value set in NewSpeed.
Note: if the speed interpolation of multi axes has been redefined by
_ECAT_Slave_CSP_Liner_Speed_Master, the NewSpeed will change the redefined speed.

9-30 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

When Mode = 1, the


speed will be
changed to 1500
ConstVel = 1500 ConstVel = 1500

StrVel
ConstVel = 1000
ConstVel = 1200
ConstVel = 1100
9
*Starting from A, NewSpeed is set to 1500 so speed
of current command or the ones issued later will all
be 1500.
Acc. Tsec

Figure 9.16.2 Set Mode to 1 to set the new constant speed for all commands

Function of speed change in Mode 2 is similar to Mode 1. However, the speed will be
changed by speed ratio in Mode 2. The speed can be changed in any condition. And the
speed of all CSP motion commands will also be changed once the NewSpeed command is
issued.

Note: The multi-axis motion speed will be changed only when the first axis in the array is identical to
the axis set in this API.

Example:
AxisNo = 1; NewSpeed = 10;
_ECAT_Slave_CSP_Feedrate_Overwrite (0, AxisNo, 0, 0, NewSpeed, 1);
AxisNoArray = {0, 1}; SlotID = {0, 0}; ConstVel = 100000;
_ECAT_Slave_CSP_Start_Arc_Move (0, AxisNoArray, SlotID, CenterPoint, 180, 0,
ConstVel, 0, 1, 1, 1, 1);
The first axis of AxisNoArray is axis 2, which is different from the AxisNo. Thus, the
constant speed of the arc motion will not be changed.
AxisNoArray = {1, 2}; SlotID = {0, 0}; ConstVel = 100000;
_ECAT_Slave_CSP_Start_Arc_Move (0, AxisNoArray, SlotID, CenterPoint, 180, 0,
ConstVel, 0, 1, 1, 1, 1);
The first axis of AxisNoArray is axis 1, which is identical to AxisNo. Thus, the constant
speed of the arc motion will be replaced with the value set in NewSpeed.

Note: If the speed interpolation of multiple axes has been redefined by

_ECAT_Slave_CSP_Liner_Speed_Master, the NewSpeed will change the redefined speed ratio.

March, 2017 9-31


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

When Mode = 2, the


speed ratio is ConstVel = 2400
changed to 200% ConstVel = 2200

9 ConstVel = 1000
ConstVel = 1200
ConstVel = 1100

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.

Acc. Tsec

Figure 9.16.3 Set Mode to 2 to change the speed ratio of constant speed for all commands

9-32 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.17 _ECAT_Slave_CSP_Speed_Continue_Enable
 Syntax

9
U16 PASCAL _ECAT_Slave_CSP_Speed_Continue_Enable (U16 CardNo, U16 AxisNo, U16
SlotNo, U16 Enable)

 Purpose
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. This can be used to prevent
machine vibration.
Note: Like _ECAT_Slave_CSP_Feedrate_Overwrite, the multi-axis motion speed will be adjusted only
when the first axis in the array is identical to the axis set in this API.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

0: Disable continuous speed function


Enable U16 Option
1: Enable continuous speed function

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Enable=1;

Status = _ECAT_Slave_CSP_Speed_Continue_Enable (CardNo, AxisNo, SlotNo, Enable);

March, 2017 9-33


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.18 _ECAT_Slave_CSP_Speed_Continue_Set_Mode
 Syntax

9
U16 PASCAL _ECAT_Slave_CSP_Speed_Continue_Set_Mode (U16 CardNo, U16 AxisNo,
U16 SlotNo, U16 Mode)

 Purpose
This is for setting the continuous speed mode that brings smooth operation.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

0: Keep the the acceleration/deceleration unchanged

1: Keep the time of acceleration/ deceleration


Mode U16 Option
unchanged

2: Keep the constant speed unchanged

 Example
U16Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Mode=1;

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. If the motor needs to accelerate from 0
mm/s to 20000 mm/s in 0.1 second and then decelerates to 0 mm/s within 0.1 second, it requires
setting its moving distance to 4000 mm at least. Therefore, setting the moving distance to 1000
mm is unreasonable. In this case, EtherCAT master provides three methods:

9-34 March, 2017


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. And the command can be completed with the set acceleration.
See figure 9.18.1. Black line shows the programmed path and the red line shows the actual path
9
(1000 mm).

20000

Tacc = 0.1 Tdec = 0.1


Figure 9.18.1

When Mode is set to 1:


If the moving distance and acceleration time remain unchanged, users have to modify the
constant speed and acceleration/deceleration slope. When Mode is set to 1, the acceleration and
deceleration time will remain 0.1 second, but the constant speed will be decreased. See figure
9.18.2. See figure 9.18.2. Black line shows the programmed path and the red line shows the
actual path (1000 mm).

2
0
0
0
0

Tacc = 0.1 Tdec = 0.1 Tacc = 0.1 Tdec = 0.1

Figure 9.18.2

March, 2017 9-35


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,

9 but the acceleration/deceleration time will be altered according to the actual application. See
figure 9.18.3. Black line shows the programmed path and the red line shows the actual path
(1000 mm).

2
0
0
0
0 2
0
0
0
0

Tacc = 0.1 Tdec = 0.1 Tacc = ? Tdec = ?

Figure 9.18.3

9-36 March, 2017


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)
9
 Purpose
This is for setting the percentage of for starting blending speed of two commands.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Ratio U16 Percentage Velocity blended percentage (Range: 0 ~ 100)

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Ratio=100;

Status = _ECAT_Slave_CSP_Speed_Continue_Set_Combine_Ratio (CardNo, AxisNo,


SlotNo, Ratio);

 Description
Set Ratio to 100:

Set Ratio to 50:

March, 2017 9-37


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.20 _ECAT_Slave_CSP_Scurve_Rate
 Syntax

9
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.
Note:
1. Once this function is enabled, it will change the S-curve ratio of CSP motion command. However, the
setting of linear acceleration (T-curve) remains the same.
2. Like the function of _ECAT_Slave_CSP_Feedrate_Overwrite, multi-axis motion with continuous speed
can be achieved only when the first axis in the array is identical to the axis set in this API.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Ratio of linear acceleration (T-curve):

Range: 0 ~ 100
Ratio U16 Percentage
Please refer to the following description for more

information.

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
U16 Ratio =100;

Status = _ECAT_Slave_CSP_Scurve_Rate (CardNo, AxisNo, SlotNo, Ratio);

9-38 March, 2017


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. And the rest (20 %) applies S-curve again. The configuration of deceleration is
identical to the acceleration. 9

Figure 9.20.1 Setting of scurve_rate

9.21 _ECAT_Slave_CSP_Liner_Speed_Master
 Syntax
U16 PASCAL _ECAT_Slave_CSP_Liner_Speed_Master (U16 CardNo , U16 AxisNo ,
U16 SlotNo , U16 Mode)

 Purpose
This is for setting the speed (vector) of advanced interpolation function.
Note: When enabling this function, the speed (vector) of all CSP commands will be changed.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID; it is valid only when Mode is set to 2

SlotNo U16 Number Slot ID; it is valid only when Mode is set to 2

It defines the speed of all CSP command.

0: Speed (vector) (Default)


Mode U16 Option
1: Speed (vector) for the longest moving distance

2: Speed (vector) for the specified axis

March, 2017 9-39


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Mode=1;

9 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.

Figure 9.21.2

When Mode = 1, it changes the speed of the axis that is farther from the origin. In this figure, it changes the
speed (vector) of Y-axis. And the system will automatically calculate the speed of X-axis.

When Mode = 2, it changes the speed of the specified axis (Y-axis) and automatically calculated the
speed of another one (X-axis).

Note: When selecting Mode 2, the multi-axis motion speed will be changed only when the first axis in the
array is identical to the axis set in this API, which is the same as the API
(_ECAT_Slave_CSP_Feedrate_Overwrite) in section 9.16.

9-40 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.22 _ECAT_Slave_CSP_Mask_Axis
 Syntax

9
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNum U16 Quantity Axis No. to be stopped

Array for each axis (node ID); the array number should

equal to the axis number


Array for each
AxisArray U16* AxisNo Array[0] stores the first node
axis
AxisNo Array[1] stores the second node

….

Array for each Array for each axis (slot ID); the array number should
SlotArray U16*
slot equal to AxisNum

 Example
U16 Status;
U16 CardNo=0, MoveAxisNum =3, MoveAxisArray[3]={1,2, 3}, MoveSlotArray[3]={0, 0, 0};
U16 StopAxisNum = 2, StopAxisArray[2]={2, 3}, StopSlotArray[2]={0, 0};
I32 DistArrary[3]= {100000,200000, 300000}, StrVel=0, ConstVel =50000, EndVel=20000;
F64 TPhase1=0.2, TPhase2=0.1;
U16 Scurve =0, Abs_Rel =0;

Status = _ECAT_Slave_CSP_Start_Multiaxes_Move(CardNo, MoveAxisNum,


MoveAxisArray, MoveSlotArray, DistArrary, Strvel, ConstVel, EndVel, TPhase1, TPhase2,
Scurve, Abs_Rel);
Status = _ECAT_Slave_CSP_Mask_Axis(CardNo, StopAxisNum, StopAxisArray,
StopSlotArray)

March, 2017 9-41


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.23 _ECAT_Slave_CSP_Sync_Config
 Syntax

9
U16 PASCAL _ECAT_Slave_CSP_Sync_Config(U16 CardNo, U16 AxisNum, U16 *AxisArray,
U16 *SlotArray, U16 Enable)

 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:
1. When some commands are issued to the the same axis, they will be executed according to the issuing
sequence.
2. Before starting the synchronous motion control, users should complete the setting of this API to enable
the function and issue the CSP motion commands one by one. Then, apply the API
“_ECAT_Slave_CSP_Sync_Move” to start executing all CSP commands.

 Example
Name Data type Property Description

CardNo U16 Number Card No.

AxisNum U16 Quantity Axis number to be enabled

Array for each axis (node ID); the array number

should equal to the axis number


Array for each
AxisArray U16* AxisNo Array[0] stores the first node
axis
AxisNo Array[1] stores the second node

….

Array for each Array for each axis (slot ID); the array number should
SlotArray U16*
slot equal to the axis number

Function of synchronous motion of multiple axes

Enable U16 Option 0: Disable

1: Enable

 Example
U16 Status;
U16 CardNo = 16, AxisNum = 2, AxisArray[2] = {0, 1}, SlotArray[2] = {0, 0};
U16 Enable = 1;

Status = _ECAT_Slave_CSP_Sync_Config (CardNo, AxisNum, AxisArray, SlotArray,


Enable);

9-42 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.24 _ECAT_Slave_CSP_Sync_Move
 Syntax

9
U16 PASCAL _ECAT_Slave_CSP_Sync_Move (U16 CardNo)

 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:
1. When some commands are issued to the the same axis, they will be executed by following the issuing
sequence.
2. Users should complete the setting of API “_ECAT_Slave_CSP_Sync_Config” to enable the function
and issue the CSP motion commands one by one. Then, apply the API
“ _ECAT_Slave_CSP_Sync_Move” to start executing all CSP commands.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

 Example
U16 Status;
U16 CardNo=16;

Status = _ECAT_Slave_CSP_Sync_Move (CardNo);

March, 2017 9-43


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.25 _ECAT_Slave_CSP_Start_Mabrline_Move
 Syntax

9
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)

 Purpose
This is for setting to smooth the operation of point-to-point motion of multiple axes.
Note:

1. This API function is similar to the API “_ECAT_Slave_CSP_Start_Msbrline_Move” (section 9.11). The

difference between them is that this API will automatically calculate the corner speed based on the set

accerlation and deceleration.

2. The corner speed of this API is identical to the API “_ECAT_Slave_CSP_Speed_Continue_Enable”

(section 9.17). However, it takes effect only in the path that is being executed by this API.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Axis number to be used for synchronous motion


AxisNum U16 Quantity
control

Array for each axis (node ID); the array number

should equal to the axis number


Array for each
AxisArray U16* AxisNo Array[0] stores the first node
axis
AxisNo Array[1] stores the second node

….

Array for each Array for each axis (slot ID); the array number should
SlotArray U16*
slot equal to the axis number

First position; the array number should equal to the

axis number

Array of pulse Target1Point[0] stores the first point of the first axis.
Target1Point I32*
for each axis Target1Point[1] stores the first point of the second

axis

….

9-44 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

Name Data type Property Description

End point; the array number should equal to the axis

number

Target2Point I32*
Array of pulse

for each axis


Target2Point[0] stores the first point of the first axis.

Target2Point[1] stores the first point of the second

axis
9
….

StrVel I32 Pulse / second Parameter of the motion initial speed

The constant speed from the start position to


First_ConstVel I32 Pulse / second
Target1Point

The constant speed from the Target1Point to


Second_ConstVel I32 Pulse / second
Target2Point

EndVel I32 Pulse / second Parameter of the motion end speed

Tacc_Step1 F64 Time (second) The time it spent to change from First_ConstVel to 0

The time it spent to change from Second_ConstVel to


Tacc_Step2 F64 Time (second)
0

0: Relative movement (Default)


Abs_Rel U16 Option
1: Absolute movement

 Example
U16 Status;
U16 CardNo = 16, AxisNum = 2, AxisArray[2] = {0, 1}, SlotArray[2] = {0, 0};
I32 Target1Point[2] = {20000, 40000};
I32 Target2Point[2] = {40000, 80000};
I32 StrVel = 0, First_ConstVel = 100000, Second_ConstVel = 200000, EndVel = 0;
F64 Tacc_Step1 = 0.1, TaccStep2 = 0.1;
U16 Abs_Rel = 1;

Status = _ECAT_Slave_CSP_Start_Mabrline_Move (CardNo, AxisNum, AxisArray,


SlotArray, Target1Point, Target2Point, StrVel, First_ConstVel, Second_ConstVel, EndVel,
Tacc_Step1, Tacc_Step2, Abs_Rel);

March, 2017 9-45


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.26 _ECAT_Slave_CSP_Start_2Segment_Move
 Syntax

9
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)

 Purpose
This is for setting the single-axis linear motion by specifying two distances and speed.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Axis ID

SlotNo U16 Number Slot ID

Segment mode:

0: The motion axis completes the 1st distance first and

SegMode U16 Option then accelerates/decelerates to start the 2nd distance.

1: While the 1st distance is not completed, the motion

axis accelerates/decelerates to start the 2nd distance.

Dist I32 Pulse The 1st moving distance

Dist2 I32 Pulse The 2nd moving distance

StrVel I32 Pulse / second Initial speed for the 1st moving distance

MaxVel I32 Pulse / second The maximum speed for the 1st moving distance

MaxVel2 I32 Pulse / second The maximum speed for the 2nd moving distance

EndVel I32 Pulse / second End speed for the 2nd moving distance

Tacc F64 second Acceleration time of the 1st moving distance

Acceleration/deceleration time when switching to travel


Tsec F64 second
the 2nd moving distance

Tdec F64 second Deceleration time of the 2nd moving distance

1: T-curve (default)
Scurve U16 Option
2: S-curve

0: Relative movement (default)


Abs_Rel U16 Option
1: Absolute movement

 Example
U16 Status;

9-46 March, 2017


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);
9
 Description
When parameter SegMode is set to 0, the motion axis will start the 1st distance first and then
accelerates/decelerates to start the 2nd distance.

Figure 9.26.1 Time-Velocity chart of relative motion

(The gray section represents the first moving distance and the white section signifies the second moving

distance)

When parameter SegMode is set to 1, the motion axis accelerates/decelerates to start the 2nd
distance while the 1st moving distance is not completed yet.

Figure 9.26.2 Time-Velocity chart of relative motion

(The gray section represents the first moving distance and the white section signifies the second

moving distance)

Note: Please note that when SegMode is set to 0, the direction of the first and second moving distance must

be the same. See the example of incorrect setting in figure 9.26.3

March, 2017 9-47


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

Figure 9.26.3 Incorrect setting – The direction of the first moving distance is not the same as the
second moving distance.

9.27 _ECAT_Slave_CSP_Start_PVT_Move
 Syntax
U16 PASCAL _ECAT_Slave_CSP_Start_PVT_Move (U16 CardNo, U16 NodeID, U16 SlotID, I32
DataCnt, I32 *TargetPos, I32 *TargetTime, I32 *TargetVel)

 Purpose
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotID U16 Number Slot ID

DataCnt I32 Amount Number of target positions (Max. 8000)

TargetPos I32* Array of pulse Target position

Array of
TargetTime I32* Target time
milisecond

Array of
TargetVel I32* Target speed (Unit: pulse / second)
velocity

9-48 March, 2017


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,
9
TargetPos, TargetTime, TargetVel);

March, 2017 9-49


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.28 _ECAT_Slave_CSP_Start_PVTComplete_Move
 Syntax
U16 PASCAL _ECAT_Slave_CSP_Start_PVTComplete_Move (U16 CardNo, U16 NodeID, U16

9 SlotID, I32 DataCnt, I32 *TargetPos, I32 *TargetTime, I32 StrVel, I32 EndVel);

 Purpose
This is for specifying the initial speed and end speed of the single-axis motion, moving through
multiple points at fixed time.
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotID U16 Number Slot ID

DataCnt I32 Amount Number of target positions (Max.: 8000)

TargetPos I32* Array of pulse Target position

Array of
TargetTime I32* Target time
milisecond

StrVel I32 Pulse / second Initial speed

EndVel I32 Pulse / second End speed

9-50 March, 2017


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; 9
Status = _ECAT_Slave_CSP_Start_PVTComplete_Move (CardNo, NodeID, SlotID, DataCnt,
TargetPos, TargetTime, StrVel, EndVel);

March, 2017 9-51


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.29 _ECAT_Slave_CSP_Virtual_Set_Enable
 Syntax

9
U16 PASCAL _ECAT_Slave_CSP_Virtual_Set_Enable(U16 CardNo, U16 AxisNo, U16 SlotNo,
U16 Enable)

 Purpose
This is for enabling function of virtual position.
After enabling the function of virtual position, the specified position (acquired by
_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.
To acquire the motor’s actual feedback position, please use the API
(_ECAT_Slave_Motion_Get_Actual_Position) in section 8.13.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Axis ID

SlotNo U16 Number Slot ID

Enable the function of virtual position

Enable U16 Option 0: Disable


1: Enable

 Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Enable=1;

Status = _ECAT_Slave_CSP_Virtual_Set_Enable(CardNo, AxisNo, SlotNo, Enable);

9-52 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.30 _ECAT_Slave_CSP_Virtual_Set_Command
 Syntax

9
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Axis ID

SlotNo U16 Number Slot ID

Command I32 Value The specified position

 Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Command=0;

Status = _ECAT_Slave_CSP_Virtual_Set_Command(CardNo, AxisNo, SlotNo, Command);

March, 2017 9-53


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,

9 U16 *Status)

 Purpose
This is for acquiring the status of software limit.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Acquire the axis position when it reaches negative or

positive limit.
Status U16* Value
Bit 0: Negative limit

Bit 1: Positive limit

 Example
U16 Status;
U16 CardNo=16, NodeID=7, SlotNo=0, Status=0;

Status = _ECAT_Slave_CSP_Get_SoftLimit_Status (CardNo, NodeID, SlotNo, &Status);

9-54 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.32 _ECAT_Slave_CSP_Pitch_Set_Interval
 Syntax

9
U16 PASCAL _ECAT_Slave_CSP_Pitch_Set_Interval(U16 CardNo, U16 AxisNo,
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
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Interval I32 Value It sets the pulse for compensation interval

 Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Interval=0

Status = _ECAT_Slave_CSP_Pitch_Set_Interval(CardNo, AxisNo, SlotNo, Interval);

March, 2017 9-55


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.33 _ECAT_Slave_CSP_Pitch_Set_Mode
 Syntax

9
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 Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Compensation mode:

Mode U16 Mode 0: Single-direction compensation

1: Dual-direction compensation

 Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Mode=0;

Status = _ECAT_Slave_CSP_Pitch_Set_Mode(CardNo, AxisNo, SlotNo, Mode);

9-56 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.34 _ECAT_Slave_CSP_Pitch_Set_Org
 Syntax

9
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 Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Set the start position in positive/ negative direction

Dir U16 Option 0: The start position in positive direction

1: The start position in negative direction

OrgPos I32 Value Start position of pitch error compensation

 Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Dir=0;
I32 OrgPos=0;

Status = _ECAT_Slave_CSP_Pitch_Set_Org(CardNo, AxisNo, SlotNo, Dir, OrgPos);

March, 2017 9-57


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.35 _ECAT_Slave_CSP_Pitch_Set_Rel_Table
 Syntax

9
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

It sets the compensation value in positive/negative

direction.
Dir U16 Option
0: Set the compensation value for positive direction

1: Set the compensation value for negative direction

Table I32* Array Compensation array of each interval (relative position)

Num U16 Value Amount in the compensation array. Max. value: 10000

 Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Dir=0;
I32 Table[3] = {0, 1, 2};

Status = _ECAT_Slave_CSP_Pitch_Set_Rel_Table (CardNo, AxisNo, SlotNo, Dir, &Table,


Num);

9-58 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Position Mode (CSP)

9.36 _ECAT_Slave_CSP_Pitch_Set_Abs_Table
 Syntax

9
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

It sets the compensation value in positive/negative

direction.
Dir U16 Option
0: Set the compensation value for positive direction

1: Set the compensation value for negative direction

Table I32* Array Compensation array of each interval (absolute position)

Num U16 Value Amount of compensation array. Max. value: 10000

 Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Dir=0, Num=0;
I32 Table[3]={0, 1, 2};

Status = _ECAT_Slave_CSP_Pitch_Set_Abs_Table (CardNo, AxisNo, SlotNo, Dir, &Table,


Num);

March, 2017 9-59


Cyclic Synchronous Position Mode (CSP) EtherCAT Programming Guide

9.37 _ECAT_Slave_CSP_Pitch_Set_Enable
 Syntax

9
U16 PASCAL _ECAT_Slave_CSP_Pitch_Set_Enable(U16 CardNo, U16 AxisNo ,
U16 SlotNo, U16 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).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Enable the function of pitch error compensation

BitNum U16 Option 0: Disable

1: Enable

 Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Enable=1

Status = _ECAT_Slave_CSP_Pitch_Set_Enable(CardNo, AxisNo, SlotNo, Enable);

9-60 March, 2017


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.

10.1 _ECAT_Slave_CSV_Start_Move ······················································· 10-2


10.2 _ECAT_Slave_CSV_Multi_Start_Move ··············································· 10-3

March, 2017 10-1


Cyclic Synchronous Velocity Mode (CSV) EtherCAT Programming Guide

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

10 to all motion axes every communication cycle so that single axis or multiple axes can operate
with the setting speed.

API list of CSV mode

Function name Description

_ECAT_Slave_CSV_Start_Move Execute single-axis motion with the setting speed

Execute multi-axes synchronous motion with the


_ECAT_Slave_CSV_Multi_Start_Move
setting speed

10.1 _ECAT_Slave_CSV_Start_Move
 Syntax
U16 PASCAL _ECAT_Slave_CSV_Start_Move (U16 CardNo, U16 AxisNo, U16 SlotNo,I32
Target_Velocity, F64 Acceleration, U16 Curve_Mode, U16 Acc_Type)

 Purpose
This is for single-axis motion control with the setting speed.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Target speed

inc signifies the unit set in the device. Please refer to


Target_Velocity I32 inc/s
the manual of the slave device for more details.

(OD: 0x60FF Sub 0)

Time to reach the target speed (inc/s^2)

second inc signifies the unit set in the device. Please refer to
Acceleration F64
Pulse / s^2 the manual of the slave device for more details.

(OD: 0x6083 Sub 0)

1: T-curve (Default)
Curve_Mode U16 Option
2: S-curve

10-2 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Velocity Mode (CSV)

Name Data type Property Description

Acceleration unit:

Acc_Type U16 Option 0: Second

 Example
1: inc/ s^2

10
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Curve_Mode = 1, Acc_Type = 0;
I32 Target_Velocity =600000;
F64 Acceleration = 0.2;

Status = _ECAT_Slave_CSV_Start_Move (CardNo, AxisNo, SlotNo, Target_Velocity,


Acceleration, Curve_Mode, Acc_Type);

10.2 _ECAT_Slave_CSV_Multi_Start_Move
 Syntax
U16 PASCAL _ECAT_Slave_CSV_Multi_Start_Move (U16 CardNo, U16 AxisNum,
U16 *AxisNo, U16 *SlotNo, I32 *Target_Velocity, F64 *Acceleration, U16 Curve_Mode,
U16 Acc_Type)

 Purpose
This is for multi-axes synchronous motion control with the setting speed.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Quantity of the axes for synchronous motion control.


AxisNum U16 Quantity Refer to section 2.1 for information about suggested

maximum axis number.

AxisNo U16* Array Array of node ID

SlotNo U16* Array Array of slot ID

Array of target speed

inc signifies the unit set in the device. Please refer


Target_Velocity I32* inc/sec
to the manual of the slave device for more details.

(OD: 0x60FF Sub 0)

March, 2017 10-3


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

10
Acceleration F64*
Inc / s^2 to the manual of the slave device for more details.

(OD: 0x6083 Sub 0)

1: T-curve(Default)
Curve_Mode U16 Option
2: S-curve

Acceleration unit:

Acc_Type U16 Option 0: Second

1: inc / s^2

 Example
U16 Status;
U16 CardNo=16, AxisNum = 2;
U16 AxisNo[2]={1, 2}, SlotNo[2]={0, 0}, Curve_Mode = 1, Acc_Type = 0;
I32 Target_Velocity[2] ={600000, 600000};
F64 Acceleration[2] = {0.2, 0.2};

Status = _ECAT_Slave_CSV_Multi_Start_Move (CardNo, AxisNum, &AxisNo, &SlotNo,


&Target_Velocity, &Acceleration, Curve_Mode, Acc_Type);

10-4 March, 2017


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.

11

11.1 _ECAT_Slave_CST_Start_Move ······················································· 11-2


11.2 _ECAT_Slave_CST_Multi_Start_Move ··············································· 11-3

March, 2017 11-1


Cyclic Synchronous Torque Mode (CST) EtherCAT Programming Guide

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

11 to all motion axes in each communication cycle so that single axis or multiple axes can operate
with the setting torque.

API list of CST mode


Function name Description

_ECAT_Slave_CST_Start_Move Execute single-axis motion with the setting torque

Execute multi-axis synchronous motion with the setting


_ECAT_Slave_CST_Multi_Start_Move
torque

11.1 _ECAT_Slave_CST_Start_Move
 Syntax
U16 PASCAL _ECAT_Slave_CST_Start_Move (U16 CardNo, U16 AxisNo, U16 SlotNo,I16
Target_Torque, U32 Slope, U16 Curve_Mode)

 Purpose
This is for executing single-axis motion l with the setting torque.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Target torque, the permillage of the maximum torque.


Target_Torque I16 Permillage
Setting range: 1 ~ 1000.

Slope U32 0.1%/s Set the torque’s rising slope

1: T-curve (Default)
Curve_Mode U16 Option
2: S-curve

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Curve_Mode = 1;
I16 Target_Torque = 2;
U32 Slope = 10;

Status = _ECAT_Slave_CST_Start_Move (CardNo, AxisNo, SlotNo, Target_Torque, Slope,


Curve_Mode);

11-2 March, 2017


EtherCAT Programming Guide Cyclic Synchronous Torque Mode (CST)

11.2 _ECAT_Slave_CST_Multi_Start_Move
 Syntax

11
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

Quantity of the axes for synchronous motion control.

AxisNum U16 Quantity Refer to section 2.1 for information about suggested

maximum axis number.

Array for node


AxisNo U16* Array of node ID
ID

Array for Slot


SlotNo U16* Array of slot ID
ID

Array of target Array of the target torque, the permillage of the


Target_Torque I16*
torque maximum torque. Setting range: 1~1000

Slope U32* 0.1%/s Array of the torque’s rising slope

1: T-curve (Default)
Curve_Mode U16 Option
2: S-curve

 Example
U16 Status;
U16 CardNo=16, AxisNum = 2;
U16 AxisNo[2]={1, 2}, SlotNo[2]={0, 0}, Curve_Mode = 1, Acc_Type = 0;
I16 Target_Torque[2] ={2, 2};
U32 Slope[2] = {10, 10};

Status = _ECAT_Slave_CST_Multi_Start_Move (CardNo, AxisNum, &AxisNo, &SlotNo,


&Target_Velocity, &Slope, Curve_Mode);

March, 2017 11-3


Cyclic Synchronous Torque Mode (CST) EtherCAT Programming Guide

(This page is intentionally left blank.)

11

11-4 March, 2017


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

12.1 _ECAT_Slave_Home_Config···························································· 12-3


12.2 _ECAT_Slave_Home_Move ···························································· 12-19
12.3 _ECAT_Slave_Home_Status ··························································· 12-20

March, 2017 12-1


Homing EtherCAT Programming Guide

API list of homing


Function name Description

_ECAT_Slave_Home_Config Set the homing mode

12 _ECAT_Slave_Home_Move

_ECAT_Slave_Home_Status
Execute homing

Acquire the current homing status

12-2 March, 2017


EtherCAT Programming Guide Homing

12.1 _ECAT_Slave_Home_Config
 Syntax

12
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” (section 12.2)

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Homing mode

Mode U16 Mode Please refer to the manual of the slave device for more

details. (OD: 0x6098 Sub 0)

Homing offset

inc signifies the unit set in the slave device. Please


Offset I32 inc
refer to the manual of the slave device for more details.

(OD: 0x607C Sub 0)

Speed for searching the ORG reference signal (The 1st

speed)

FirstVel U32 inc/second inc signifies the unit set in the slave device. Please

refer to the manual of the slave device for more details.

(OD: 0x6099 Sub 1)

Speed for searching the Z pulse (The 2nd speed)

inc signifies the unit set in the slave device. Please


SecondVel U32 inc/second
refer to the manual of the slave device for more details.

(OD code: 0x6099 Sub 2)

Acceleration during homing (inc/s^2)

inc signifies the unit set in the slave device. Please


Acceleration U32 inc/s^2
refer to the manual of the slave device for more details.

(OD code: 0x609A Sub 0)

March, 2017 12-3


Homing EtherCAT Programming Guide

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Mode=1;

12 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
1. Mode 1
The motor runs in reverse direction at high speed until it reaches the negative limit. Once
reaching the limit, it decelerates. Upon leaving the negative limit at low speed, it starts to
look for the first Z pulse in forward direction and regards the first Z pulse as the new homing
origin.

Homing origin
Speed

L
Motor S Position

H: High speed (The 1st speed)


L: Low speed (The 2nd speed)
Negative S: Starting point
limit E: Ending point
Z Pulse: Zero point of each cycle of
Z Pulse the encoder

12-4 March, 2017


EtherCAT Programming Guide Homing

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

Speed
Homing origin
12
H

Motor S Position
E
L

H: High speed (The 1st speed)


L: Low speed (The 2nd speed)
Positive limit S: Starting point
E: Ending point
Z Pulse: Zero point of each cycle of
Z Pulse the encoder

3. Mode 3
 Home switch ON: The motor runs in reverse direction at low speed until it reaches the
home switch. Once reaching the home switch, it decelerates to leave the switch with
low speed and starts to look for the first Z pulse, regarding it as the new homing origin.
 Home switch OFF: The motor runs in forward direction at high speed until it reaches
the home switch. Then, it decelerates to leave the home switch in reverse direction
and starts to look for the first Z pulse with low speed and regards the first Z pulse as
the new homing origin.

Homing origin
Speed

Motor E S Position

Speed
H

Motor S Position
E
L
H: High speed (The 1st speed)
L: Low speed (The 2nd speed)
Home switch S: Starting point
E: Ending point
Z Pulse: Zero point of each cycle of
Z Pulse the encoder

March, 2017 12-5


Homing EtherCAT Programming Guide

4. 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.

12 Home switch ON: The motor runs in reverse direction at low speed until it leaves the home
switch. Then, the motor reaches the home switch again in forward direction. When the
motor reaches the home switch again, it will regard the first Z pulse as the new homing
origin.
 Home switch OFF: The motor runs in forward direction at high speed until it reaches
the home switch. Then, the motor decelerates and runs at low speed and regards the
first Z pulse it looked for as the new homing origin.

Homing origin
Speed

L
Motor S Position

E
L

Speed
H
L
Motor S Position

H: High speed (The 1st speed)


L: Low speed (The 2nd speed)
Home switch S: Starting point
E: Ending point
Z Pulse: Zero point of each cycle of
Z Pulse the encoder

12-6 March, 2017


EtherCAT Programming Guide Homing

5. 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.
12
 Home switch ON: The motor runs in forward direction at low speed until it leaves the
home switch. Then, it looks for the first Z pulse and regards the first Z pulse as the
new homing origin.

Homing origin
Speed

L
Motor Position
S
E

Speed

L
Motor S Position
E

H: High speed (The 1st speed)


Home L: Low speed (The 2nd speed)
switch S: Starting point
E: Ending point
Z Pulse: Zero point of each cycle
Z Pulse
of the encoder

March, 2017 12-7


Homing EtherCAT Programming Guide

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

12 
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.
Home switch ON: The motor runs in forward direction at low speed until it leaves the
home switch. Then, the motor runs in reverse direction. When the motor 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.

Homing origin
Speed

Motor E S Position

L
H

Speed
L
Motor S Position
E
L
H: High speed (The 1st speed)
L: Low speed (The 2nd speed)
Home
S: Starting point
switch
E: Ending point
Z Pulse: Zero point of each cycle
Z Pulse
of the encoder

12-8 March, 2017


EtherCAT Programming Guide Homing

7. 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.
Home switch OFF: The motor runs in forward direction at high speed. When the motor
12
triggers the positive limit before reaching the home switch, it runs in reverse direction
until reaching 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.
 Home switch ON: The motor runs in reverse direction at low speed until it leaves the
home switch. Then, the motor starts to look for the first Z pulse and regards the first Z
pulse as the new homing origin.

Homing origin
Speed
H

Motor Position
S E
L

Speed
H

Motor Position
E S
L
H
Speed

Motor S Position
E
L

H: High speed (The 1st speed)


L: Low speed (The 2nd speed)
Home switch S: Starting point
E: Ending point
Positive limit Z Pulse: Zero point of each
cycle of the encoder

March, 2017 12-9


Homing EtherCAT Programming Guide

8. 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

12 
pulse and regards it as the new homing origin.
Home switch OFF: The motor runs in forward direction at high speed. When the motor
triggers the positive limit before reaching the home switch, it runs in reverse direction
until reaching the home switch. Then, the motor decelerates and leaves the home
switch at low speed. Afterwards, the motor runs in forward direction. When the home
switch is reached again, the motor starts to look for the first Z pulse and regards the
first Z pulse as the new homing origin.
 Home switch ON: The motor runs in reverse direction at low speed until it leaves the
home switch. Then, it runs in forward direction. When the home switch is reached
again, the motor starts to look for the first Z pulse and regards the first Z pulse as the
new homing origin.

Speed Homing origin


H
L
Motor E Position
S

Speed
H
L
Motor Position
E S
L
H
Speed
L
Motor E Position
S
L

Z Pulse H: High speed (The 1st speed)


L: Low speed (The 2nd speed)
Home switch S: Starting point
E: Ending point
Positive limit Z Pulse: Zero point of each
cycle of the encoder

12-10 March, 2017


EtherCAT Programming Guide Homing

9. 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.
12
 Home switch OFF: The motor runs in forward direction at high speed. When the motor
triggers the positive limit before reaching the home switch, it runs in reverse direction
until reaching the home switch. After 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.
 Home switch ON: The motor runs in forward direction at low speed until it leaves the
home switch. Then, it runs in reverse direction. When the home switch is reached
again, the motor starts to look for the first Z pulse and regards the first Z pulse as the
new homing origin.

Speed Homing origin


H
L
Motor Position
S E
L

Speed
H

Motor E Position
S
L
H
Speed
L
Motor S Position
E
L

Z Pulse H: High speed (The 1st speed)


L: Low speed (The 2nd speed)
Home switch S: Starting point
E: Ending point
Positive limit Z Pulse: Zero point of each
cycle of the encoder

March, 2017 12-11


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,

12 
it starts to look for the first Z pulse and regards the first Z pulse as the new homing
origin.
Home switch OFF: The motor runs in forward direction at high speed. When the motor
triggers the positive limit before reaching the home switch, it runs in reverse direction
until reaching the home switch. Then, the motor decelerates and runs in forward
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.
 Home switch ON: The motor runs in forward direction at low speed until it leaves the
home switch. Then, the motor starts to look for the first Z pulse and regards the first Z
pulse as the new homing origin.

Speed Homing origin


H
L
Motor Position
S E

Speed
H
L
Motor Position
E S

H
Speed
L
Motor Position
S E

Z Pulse H: High speed (The 1st speed)


L: Low speed (The 2nd speed)
Home switch S: Starting point
E: Ending point
Positive limit Z Pulse: Zero point of each
cycle of the encoder

12-12 March, 2017


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.
Home switch OFF: The motor runs in reverse direction at high speed. When the motor
12
triggers the negative limit before reaching the home switch, it runs in forward direction
until reaching the home switch. Then, the motor decelerates. 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.
 Home switch ON: The motor runs in forward direction at low speed until it leaves the
home switch. Then, the motor starts to look for the first Z pulse and regards the first Z
pulse as the new homing origin.

Homing origin
Speed
L
Motor Position
E S

Speed H
L
Motor S Position
E

H
Speed
L
Motor S Position
E

Z Pulse H: High speed (The 1st speed)


L: Low speed (The 2nd speed)
Home switch S: Starting point
E: Ending point
Negative Z Pulse: Zero point of each
limit cycle of the encoder

March, 2017 12-13


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

12 
pulse and regards the first Z pulse as the new homing origin.
Home switch OFF: The motor runs in reverse direction at high speed. When the motor
triggers the negative limit before reaching the home switch, it runs in forward direction
until reaching the home switch. Then, the motor decelerates and leaves the home
switch at low speed. Afterwards, it runs in reverse direction. When the motor 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.
 Home switch ON: The motor runs in forward direction at low speed until it leaves the
home switch. Then, the motor runs in reverse direction. When the home switch is
reached again, the motor starts to look for the first Z pulse and regards the first Z
pulse as the new homing origin.

Homing
origin
Speed

Motor Position
E S
L
H
Speed H
L
Motor S Position
E
L
H
Speed
L
Motor E Position
S
L

Z Pulse H: High speed (The1st speed)


L: Low speed (The 2nd speed)
Home switch S: Starting point
E: Ending point
Negative Z Pulse: Zero point of each
limit cycle of the encoder

12-14 March, 2017


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.
12
 Home switch OFF: The motor runs in reverse direction at high speed. When the motor
triggers the negative limit before reaching the home switch, it starts running in forward
direction. Once reaching the home switch, the motor runs at low speed and starts to
look for the first Z pulse and regards it as the new homing origin.
 Home switch ON: The motor runs in reverse direction at low speed until it leaves the
home switch. Then, the motor runs in forward direction. When it reaching the home
switch again, the motor starts to look for the first Z pulse and regard the first Z pulse
as the new homing origin.

Homing origin
Speed
L
Motor E Position
S
L
H
Speed H
L
Motor S Position
E

H
Speed
L
Motor S Position
E
L

Z Pulse H: High speed (The 1st speed)


L: Low speed (The 2nd speed)
Home switch S: Starting point
E: Ending point
Negative Z Pulse: Zero point of each
limit cycle of the encoder

March, 2017 12-15


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

12 
the home switch, it starts to look for the first Z pulse and regards the first Z pulse as
the new homing origin.
Home switch OFF: The motor runs in reverse direction at high speed. When the motor
triggers the negative limit before reaching the home switch, it runs in forward direction
until reaching the home switch. Then, the motor decelerates and leaves the home
switch at low speed. Afterwards, the motor runs in reverse direction and reaches the
home switch again. When the motor leaves the home switch again, it starts to look for
the first Z pulse and regards the first Z pulse as the new homing origin.
 Home switch ON: The motor runs in reverse direction at low speed until it leaves the
home switch. Then, the motor starts to look for the first Z pulse and regards the first Z
pulse as the new homing origin.

Homing origin
Speed

Motor E S Position

L
H
Speed H
L
Motor E Position
S
L
H
Speed

Motor E S Position

Z Pulse H: High speed (The 1st speed)


L: Low speed (The 2nd speed)
Home switch S: Starting point
E: Ending point
Negative Z Pulse: Zero point of each
limit cycle of the encoder

12-16 March, 2017


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. Please refer to the figure below for the differences between mode 1
and mode 17.
12
Homing origin
(Method 17)
Speed
H
Method 17
S Position
Motor
E
L
Homing origin
(Method 1)
Speed
H
Method 1
S Position
Motor
E
L
H: High speed (The 1st speed)
L: Low speed (The 2nd speed)
Negative S: Starting point
limit E: Ending point
Z Pulse: Zero point of each cycle of
Z Pulse the encoder

16. Mode 33
The motor runs in reverse direction looking for the first Z pulse and regards the it as the
new homing origin.

Speed Homing origin

L
Motor Position
st
E S H: High speed (The 1 speed)
L: Low speed (The 2nd speed)
S: Starting point
E: Ending point
Z Pulse: Zero point of each cycle
Z Pulse of the encoder

March, 2017 12-17


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.

12 Speed

Motor S
Homing origin

L
Position
E H: High speed (The 1st speed)
L: Low speed (The 2nd speed)
S: Starting point
E: Ending point
Z Pulse: Zero point of each cycle
Z Pulse of the encoder

18. Mode 35
The motor regards the current position as the new homing origin.

12-18 March, 2017


EtherCAT Programming Guide Homing

12.2 _ECAT_Slave_Home_Move
 Syntax

12
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
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

 Example
U16 Status;
U16 CardNo=1, AxisNo=1, SlotNo=0;

/*Start homing*/
Status = _ECAT_Slave_Home_Move (CardNo, AxisNo, SlotNo);

March, 2017 12-19


Homing EtherCAT Programming Guide

12.3 _ECAT_Slave_Home_Status
 Syntax

12
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)

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Status:

0: Motion not started or homing completed.

1: Homing in progress
Status U16* Status
2: Homing terminated while the procedure is not

completed

3: Error occurs during homing

 Example
U16 Status;
U16 CardNo=1, AxisNo=1, SlotNo=0;

/*Acquire the homing status of the specified axis*/


Status = _ECAT_Slave_Home_Status (CardNo, AxisNo, SlotNo, &Status);

12-20 March, 2017


Profile Position Mode (PP)

This chapter explains the APIs for single-axis motion control in PP mode. In PP mode,
all relevant commands will be issued to the motion axis at a time. 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

13.1 _ECAT_Slave_PP_Start_Move ························································· 13-3


13.2 _ECAT_Slave_PP_Advance_Config ·················································· 13-4

March, 2017 13-1


Profile Position Mode (PP) EtherCAT Programming Guide

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

13 servo drive and pulse module. It can achieve real-time control. However, it does not support
multi-axis interpolation.

API list of PP mode


Function name Description

_ECAT_Slave_PP_Start_Move Execute single-axis linear motion in PP mode

_ECAT_Slave_PP_Advance_Config Advanced setting of PP mode

13-2 March, 2017


EtherCAT Programming Guide Profile Position Mode (PP)

13.1 _ECAT_Slave_CST_Start_Move
 Syntax

13
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

The specified moving distance.


inc signifies the unit set in the slave device. Please refer
TargetPos I32 inc
to the manual of the slave device for more details. (OD:

0x607A Sub 0)

Constant speed of the motion (inc/s)

Pulse per inc signifies the unit set in the slave device. Please refer
ConstVel U32
second (pps) to the manual of the slave device for more details. (OD:

0x6081 Sub 0)

Acceleration (inc/s^2)

inc signifies the unit set in the slave device. Please refer
Acceleration U32 Pulse / s^2
to the manual of the slave device for more details. (OD:

0x6083 Sub 0)

Deceleration (inc/s^2)

inc signifies the unit set in the slave device. Please refer
Deceleration U32 Pulse / s^2
to the manual of the slave device for more details. (OD:

0x6084 Sub 0)

0: Relative movement (Default)


Abs_Rel U16 Option
1: Absolute movement

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0, Abs_Rel=1;
I32 Dist=5000000;
U32 MaxVel=2000000;
U32 TAcc = 100, Tdec = 100; // A2E: the time (ms) it takes to accelerate to 3000 rpm

March, 2017 13-3


Profile Position Mode (PP) EtherCAT Programming Guide

Status = _ECAT_Slave_PP_Start_Move(CardNo, AxisNo, SlotNo, Dist, MaxVel, TAcc, TDec,


Abs_Rel);

13 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)

 Purpose
This is for the advanced setting of PP mode.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Enable the following parameters via the bit values:

Bit 0 → End_Vel

Bit 1 → Min_Range_Limit
SetBit U16 Option
Bit 2 → Max_Range_Limit

Bit 3 → Min_Soft_Limit

Bit 4 → Max_Soft_Limit

End velocity.

inc signifies the unit set in the slave device. Please


End_Vel I32 Inc / Sec
refer to the manual of the slave device for more

details. (OD: 0x607A Sub 0)

Set the minimum range for relative movement.

inc signifies the unit set in the slave device. Please


Min_Range_Limit I32 Inc
refer to the manual of the slave device for more

details. (OD: 0x607B Sub 1)

Set the maximum range for relative movement.

inc signifies the unit set in the slave device. Please


Max_Range_Limit I32 Inc
refer to the manual of the slave device for more

details. (OD: 0x607B Sub 2)

Set the minimum range for absolute movement.


Min_Soft_Limit I32 Inc
inc signifies the unit set in the slave device. Please

13-4 March, 2017


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)

Max_Soft_Limit I32 Inc


Set the maximum range for absolute movement

inc signifies the unit set in the slave device. Please

refer to the manual of the slave device for more


13
details. (OD: 0x607D Sub 2)

 Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0, SetBit=0x07;
//Set End_Vel, Min_Range_Limit&Max_Range_Limit
I32 End_Vel =50, Min_Range_Limit =1, Max_Range_Limit =200;
I32 Min_Soft_Limit= 2, Max_Soft_Limit=180;

Status = _ECAT_Slave_PP_Advance_Config(CardNo, AxisNo, SlotNo, SetBit, End_Vel,


Min_Range_Limit, Max_Range_Limit, Min_Soft_Limit, Max_Soft_Limit);

March, 2017 13-5


Profile Position Mode (PP) EtherCAT Programming Guide

(This page is intentionally left blank.)

13

13-6 March, 2017


Profile Velocity Mode (PV)

This chapter introduces the API used in PV mode. Different from CSV mode, all
relevant commands will be issued to the motion axis at once in 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.

14

14.1 _ECAT_Slave_PV_Start_Move ························································· 14-3


14.2 _ECAT_Slave_PV_Advance_Config ·················································· 14-4

March, 2017 14-1


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

14 module.

API list of PV mode


Function name Description
Execute the single-axis motion with constant speed in PV
_ECAT_Slave_PV_Start_Move
mode
_ECAT_Slave_PV_Advance_Config Advanced setting of PV mode

14-2 March, 2017


EtherCAT Programming Guide Profile Velocity Mode (PV)

14.1 _ECAT_Slave_PV_Start_Move
 Syntax

14
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Target speed

inc signifies the unit set in the slave device. Please refer
TargetVel I32 inc/s
to the manual of the slave device for more details. (OD:

0x60FF Sub 0)

Acceleration speed

inc signifies the unit set in the slave device. Please refer
Acceleration U32 inc/s^2
to the manual of the slave device for more details. (OD:

0x6083 Sub 0)

Deceleration speed

inc signifies the unit set in the slave device. Please refer
Deceleration U32 inc/s^2
to the manual of the slave device for more details. (OD:

0x6084 Sub 0)

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
I32 TargetVel=300;
F64 Acceleration=5, Deceleration=5;

Status=_ECAT_Slave_PV_Start_Move (CardNo, AxisNo, SlotNo, TargetVel, Acceleration,


Deceleration);

March, 2017 14-3


Profile Velocity Mode (PV) EtherCAT Programming Guide

14.2 _ECAT_Slave_PV_Advance_Config
 Syntax

14
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Enable the following parameters via the bit values:

Bit 0 → Max_Torque

Bit 1 → Velocity_Window
SetBit U16 Option
Bit 2 → Velocity_Window_Time

Bit 3 → Velocity_Threshold

Bit 4 → Velocity_Threshold_Time

The torque output, which setting range is 1 ~ 1000.


Max_Torque, U16 Permillage
(OD: 0x6072 Sub 0)

Specify the range for state of “target speed

reached”.

Velocity_Window U16 Inc/s inc signifies the unit set in the slave device. Please

refer to the manual of the slave device for more

details. (OD: 0x606D Sub 0)

Set the duration for state of “target

speed-reached”. (OD: 0x606E Sub 0)

Bit 10-Target_Reached of Status_Word will be

enabled when the difference between the motion


Velocity_Window_Time U16 Millisecond (ms)
speed and the set speed is smaller than the value

specified by Velocity_Window, and such difference

has lasted longer than the time set by

Velocity_Window_Time.

Velocity_Threshold U16 Inc/s Specify the speed range (Address: 0x606F Sub 0)

14-4 March, 2017


EtherCAT Programming Guide Profile Velocity Mode (PV)

Name Data type Property Description

Set the duration of non-zero speed (OD: 0x6070

Sub 0)

Velocity_Threshold_Time U16 Millisecond (ms)


Bit 12 of

“ _ECAT_Slave_Motion_Get_StatusWord” will be

disabled when the motion speed reaches the


14
value specified by Velocity_Threshold, and this

speed has lasted longer than the time set by

Velocity_Threshold_Time.

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, SetBit=0x03; //Set Max_Torque, Velocity_Window;
U16 Max_Torque=200, Velocity_Window=20, Velocity_Window_Time=3;
U16 Velocity_Threshold=10, Velocity_Threshold_Time=3;

Status=_ECAT_Slave_PV_Advance_Config (CardNo, AxisNo, SlotNo, SetBit,


Max_Torque, Velocity_Window, Velocity_Window_Time, Velocity_Threshold,
Velocity_Threshold_Time);

March, 2017 14-5


Profile Velocity Mode (PV) EtherCAT Programming Guide

(This page is intentionally left blank.)

14

14-6 March, 2017


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

March, 2017 15-1


Inverter Motion Control EtherCAT Programming Guide

API list of inverter motion control


Function name Description
Inverter single-axis motion control with constant speed.
_ECAT_Slave_VL_Start_Move

15
(Only applicable to Delta inverter)

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

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Target speed (inc/sec)

inc signifies the unit set in the slave. Please refer to the
TargetVel I32 inc/s
user manual of the applied slave device. (OD : 0x6042

Sub 0)

Acceleration

inc signifies the unit set in the slave. Please refer to the
Acceleration U32 inc/s^2
user manual of the applied slave device. (OD: 0x604F

Sub 0)

Deceleration

inc signifies the unit set in the slave. Please refer to the
Deceleration U32 inc/s^2
user manual of the applied slave device. (OD: 0x6050

Sub 0)

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
I32 TargetVel=300;
F64 Acceleration=50, Deceleration=50;

Status=_ECAT_Slave_VL_Start_Move (CardNo, AxisNo, SlotNo, TargetVel, Acceleration,


Deceleration);

15-2 March, 2017


Profile Torque Mode (PT)

This chapter introduces the APIs used for single-axis motion control in PT mode. Unlike
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.

16

16.1 _ECAT_Slave_PT_Start_Move ························································· 16-3


16.2 _ECAT_Slave_PT_Advance_Config ·················································· 16-4

March, 2017 16-1


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.

16 API list of PT mode


Function name Description

Execute the single-axis motion with constant torque in


_ECAT_Slave_PT_Start_Move
PT mode.

_ECAT_Slave_PT_Advance_Config Advanced setting of PT mode

16-2 March, 2017


EtherCAT Programming Guide Profile Torque Mode (PT)

16.1 _ECAT_Slave_PT_Start_Move
 Syntax

16
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

0.1% of the maximum rated torque, which setting range


Target_Torque I16 Permillage
is 1 ~ 1000.

Slope U32 0.1% / s The torque’s rising slope; 0.1% per second.

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
I16 Target_Torque=2;
U32 Slope=10;

Status=_ECAT_Slave_PT_Start_Move (CardNo, AxisNo, SlotNo, Target_Torque, Slope);

March, 2017 16-3


Profile Torque Mode (PT) EtherCAT Programming Guide

16.2 _ECAT_Slave_PT_Advance_Config
 Syntax

16
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 Data type Property Description

CardNo U16 Number Card No.

AxisNo U16 Number Node ID

SlotNo U16 Number Slot ID

Enable the following parameters via bit setting:

SetBit U16 Option Bit 0 → Max_Current

Bit 1 → Torque_Profile

0.1% of the maximum rated torque, which setting range


Max_Current U16 Permillage
is 1 ~ 1000.

0: Linear change
Torque_Profile I16 Option
1: Sine wave change

 Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
U16 Max_Current=200, SetBit=0, Torque_Profile=0;

Status=_ECAT_Slave_PT_Advance_Config (CardNo, AxisNo, SlotNo, Max_Current,


Torque_Profile);

16-4 March, 2017


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. Another method is to fill in the DDA table,
which is for the profile of the path. Users have to fill in the position required in each
communication cycle for the motion axis. It can perform the user designed interpolation
function for three axes or above. However, users have to calculate the interpolation for
all axes during acceleration and deceleration.

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 ····························· 17-10
17.7 _ECAT_Slave_User_Motion_Control_Ralm ········································ 17-11
17.8 _ECAT_Slave_User_Motion_Control_Svon ········································ 17-12
17.9 _ECAT_Slave_User_Motion_Control_Get_Alm ··································· 17-13

March, 2017 17-1


Group Motion Control EtherCAT Programming Guide

List of Group Motion Control API


Function name Description
Set the group status.

17 _ECAT_Slave_User_Motion_Control_Set_Enable_

Mode
*Please note that before enabling the group, users

should apply Set_Motion_Control_Type to specify

the axis for one group and use

_ECAT_Slave_User_Motion_Control_ Svon and

_ECAT_Slave_User_Motion_Control_Get_Alm to

confirm the status of each axis.

_ECAT_Slave_User_Motion_Control_Get_Enable_
Acquire the status in the current group.
Mode

_ECAT_Slave_User_Motion_Control_Set_Type Set the motion mode in the specified group.

_ECAT_Slave_User_Motion_Control_Set_Data Set the data of each axis in the specified group.

_ECAT_Slave_User_Motion_Control_Clear_Data Clear the data of each axis in the specified group.

Read the data number that have not been


_ECAT_Slave_User_Motion_Control_Get_DataCnt
processed in the specified group.

_ECAT_Slave_User_Motion_Control_ Ralm Reset the alarm of all axes in the specified group.

_ECAT_Slave_User_Motion_Control_ Svon Enable/disable all axes in the specified group.

Acquire the current alarm status in the specified


_ECAT_Slave_User_Motion_Control_Get_Alm
group.

17-2 March, 2017


EtherCAT Programming Guide Group Motion Control

17.1 _ECAT_Slave_User_Motion_Control_Set _Enable_Mode

 Syntax
U16 PASCAL_ECAT_Slave_User_Motion_Control_Set_Enable_mode (U16 CardNo, U16
GroupNo, U16 Mode) 17
 Purpose
This is for setting the group status.
Note:
1. Before using this API, please enable all the axes in the group.
2. Please note that before enabling the group, users should apply
_ECAT_Slave_User_Motion_Control_Set_Type to specify the axes to be grouped and motion of
the group (see section 17.3). Then, use _ECAT_Slave_User_Motion_Control_ Svon (see section
17.8) to enable the motor of each axis. Finally, this API(_ECAT_Slave_User_Motion_Control_Set
_Enable_Mode) can be used. Please refer to the example below.
3. Suggested steps: Set mode to 2 (Mode=2) to switch to the pause state. Then, use API
“_ECAT_Slave_User_Motion_Control_Set_Data” (see section 17.4) to input 100 data beforehand
so that the commands can be issued in time and avoid vibration of the machine.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

GroupNo U16 Number Group No.

Status:

0: Disable
Mode U16 Option
1: Enable

2: Pause

 Example
U16 Status;
U16 CardNo=16, GroupNo =1, AxisNum=2, AxisNoArray[2] ={1,2}, SlotNoArray[2] = {0,0},
Type=0, Mode =2, ON_OFF=1, Counter;
I32 DataArray[2]={12,33};
Status =_ECAT_Slave_User_Motion_Control_Set_Type (CardNo, GroupNo ,AxisNum ,
AxisNoArray, SlotNoArray, Type);

// The axes have to be enabled first so that the user can carry on using other relevant functions.
Status = _ECAT_Slave_User_Motion_Control_Svon(CardNo, GroupNo, ON_OFF);
// 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.

March, 2017 17-3


Group Motion Control EtherCAT Programming Guide

for (int I = 0; i<100 ; i++)


{
Status = _ECAT_Slave_User_Motion_Control_Set_Data (CardNo, GroupNo, DataArray);

17 }
// Motion start
Mode =1;
Status =_ECAT_Slave_User_Motion_Control_Set_Enable_Mode (CardNo, GroupNo, Mode);
// 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; // There is no command so function is disabled; exit the loop.
Status =_ECAT_Slave_User_Motion_Control_Set_Enable_Mode (CardNo, GroupNo,
Mode);
break;
}
}

17-4 March, 2017


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) 17
 Purpose
This is for acquiring the status of the current group.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

GroupNo U16 Number Group No.

Status:

0: Disable
Mode U16* Option
1: Enable

2: Pause

 Example
U16 Status;
U16 CardNo=16, GroupNo=1;
U16 Mode;

Status=_ECAT_Slave_User_Motion_Control_Get_Enable_Mode (CardNo, GroupNo, &Mode);

March, 2017 17-5


Group Motion Control EtherCAT Programming Guide

17.3 _ECAT_Slave_User_Motion_Control_Set_Type
 Syntax

17
U16 PASCAL_ECAT_Slave_User_Motion_Control_Set_Type (U16 CardNo, U16 GroupNo,
U16 AxisNum, U16 *AxisNo, U16 *SlotNo, U16 Type)

 Purpose
This is for setting the motion mode of the group.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

GroupNo U16 Number Group No.

AxisNum U16 Value Axis number in one group

Array for each axis (node ID); the array number should

equal to the axis number


Array for
AxisNo U16* AxisNo Array[0] stores the first node
each axis
AxisNo Array[1] stores the second node

….

Array for Array for each axis (slot ID); the array number should
SlotNo U16*
each slot equal to the axis number

Description of each mode:

0: Mode for general motion command; When applying

this mode, users have to apply the motion commands

from other chapters. And the control axis of the

specified group will complete the command in

sequence.
Type U16 Option
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.

17-6 March, 2017


EtherCAT Programming Guide Group Motion Control

 Example
U16 Status;
U16 CardNo=16, GroupNo=1, AxisNum=2, AxisNoArray[2]={1,2}, SlotNoArray[2]={0,0};
U16 Type=0;
U16 Mode=1; 17
Status=_ECAT_Slave_User_Motion_Control_Set_Type (CardNo, GroupNo, AxisNum,
AxisNoArray, SlotNoArray, Type);

 Description
EtherCAT master provides 3 modes of group motion. See the description below:

When the mode is set to 0, users can use the functions described in section 17.4 ~ 17.9 to issue
the position command to be executed by the axis of the group in each communication cycle. By
doing so, the user-defined interpolation can be done. Please note that users have to set the
acceleration/deceleration and logic of interpolation because position commands in each cycle
are user-defined.
Apply API “ECAT_Slave_User_Motion_Control_Set_Data” (refer to section 17.4) and then use
“_ECAT_Slave_User_Motion_Control_Set_Enable_Mode” (section 17.1) to enable this function
so that the speed of filling the table content can keep up with the communication cycle time. In
this case, motion with continuous speed can be carried out.

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.
For example, if a motion command of the group’s 2nd axis is not completed and the EtherCAT
master receives interpolation commands from the 1st and 3rd axis, the master will firstly execute
the motion command of the 2nd axis and then the 1st axis and the 3rd axis.

March, 2017 17-7


Group Motion Control EtherCAT Programming Guide

17.4 _ECAT_Slave_User_Motion_Control_Set_Data
 Syntax

17
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”
(section 17.3).

Note: The maximum data for PAC is 800 and 100 for motion control card.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

GroupNo U16 Number Group No.

Data array for each axis; the array number should

equal to the axis number.


Data array for
Data I32* DataArray[0] stores the data of the first axis
each axis
DataArray[1] stores the data of the second axis

 Example
U16 Status;
U16 CardNo=16, GroupNo=1;
I32 DataArray[2]={12,33};

Status=_ECAT_Slave_User_Motion_Control_Set_Data (CardNo, GroupNo, DataArray);

17-8 March, 2017


EtherCAT Programming Guide Group Motion Control

17.5 _ECAT_Slave_User_Motion_Control_Clear_Data
 Syntax

17
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 “ (section 17.3).

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

GroupNo U16 Number Group No.

 Example
U16 Status;
U16 CardNo=16, GroupNo=1;

Status=_ECAT_Slave_User_Motion_Control_Clear_Data (CardNo, GroupNo);

March, 2017 17-9


Group Motion Control EtherCAT Programming Guide

17.6 _ECAT_Slave_User_Motion_Control_Get_DataCnt
 Syntax

17
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”.
Note: The maximum data for PAC is 800 and 100 for motion control card.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

GroupNo U16 Number Group No.

Counter U16* Value Data number that has not been processed

 Example
U16 Status;
U16 CardNo=16, GroupNo=1;
U16 Counter;

Status=_ECAT_Slave_User_Motion_Control_Get_DataCnt (CardNo, GroupNo, &Counter);

17-10 March, 2017


EtherCAT Programming Guide Group Motion Control

17.7 _ECAT_Slave_User_Motion_Control_Ralm
 Syntax

17
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 U16 Number Card No.

GroupNo U16 Number Group No.

 Example
U16 Status;
U16 CardNo=16, GroupNo=1;

Status=_ECAT_Slave_User_Motion_Control_Ralm (CardNo, GroupNo);

March, 2017 17-11


Group Motion Control EtherCAT Programming Guide

17.8 _ECAT_Slave_User_Motion_Control_Svon
 Syntax

17
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. Users can use either “_ECAT_Slave_Motion_Set_Svon” or
“_ECAT_Slave_User_Motion_Control_Svon” to enable axes in batch.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

GroupNo U16 Number Group No.

0: Disable the axes


ON_OFF U16 Option
1: Enable the axes

 Example
U16 Status;
U16 CardNo=16, GroupNo=1;
U16 ON_OFF=1;

Status=_ECAT_Slave_User_Motion_Control_Svon (CardNo, GroupNo, ON_OFF);

17-12 March, 2017


EtherCAT Programming Guide Group Motion Control

17.9 _ECAT_Slave_User_Motion_Control_Get_Alm
 Syntax

17
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 U16 Number Card No.

GroupNo U16 Number Group No.

Alarm description
Alm U16* Status 0: No alarm occurs

1: Alarm occurs in one of the axes in the group

 Example
U16 Status;
U16 CardNo=16, GroupNo=1;
U16 Alm;

Status=_ECAT_Slave_User_Motion_Control_Get_Alm (CardNo, GroupNo, &Alm);

March, 2017 17-13


Group Motion Control EtherCAT Programming Guide

(This page is intentionally left blank.)

17

17-14 March, 2017


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; please refer to Chapter 32 for more information. For the retentive function for the
digital output when an error occurs, refer to Chapter 31. And see Chapter 26 for setting
local digital input and digital output of GPIO on motion card.
18

18.1 _ECAT_Slave_DIO_Get_Input_Value················································· 18-3


18.2 _ECAT_Slave_DIO_Get_Output_Value ·············································· 18-4
18.3 _ECAT_Slave_DIO_Set_Output_Value··············································· 18-5
18.4 _ECAT_Slave_DIO_Get_Single_Input_Value ······································· 18-6
18.5 _ECAT_Slave_DIO_Get_Single_Output_Value ···································· 18-7
18.6 _ECAT_Slave_DIO_Set_Single_Output_Value ····································· 18-8
18.7 _ECAT_Slave_DIO_Set_Output_Error_Mode ······································ 18-9
18.8 _ECAT_Slave_DIO_Set_Output_Error_Value ····································· 18-10

March, 2017 18-1


Operation of DI/DO Module EtherCAT Programming Guide

API list of DI/DO module


Function name Description

_ECAT_Slave_DIO_Get_Input_Value Acquire the DI status

18 _ECAT_Slave_DIO_Get_Output_Value

_ECAT_Slave_DIO_Set_Output_Value

_ECAT_Slave_DIO_Get_Single_Input_Value
Acquire the DO status

Set the DO status

Acquire the input value of the specified channel

_ECAT_Slave_DIO_Get_Single_Output_Value Acquire the output value of the specified channel

_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

disconnected and the retentive function is enabled

18-2 March, 2017


EtherCAT Programming Guide Operation of DI/DO Module

18.1 _ECAT_Slave_DIO_Get_Input_Value
 Syntax

18
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Value U16* Value Data received by the DI module

 Example
U16 Status;
U16 CardNo=16, NodeID=1, SlotNo=0;
U16 Value;

Status=_ECAT_Slave_DIO_Get_Input_Value (CardNo, NodeID, SlotNo, &Value)

March, 2017 18-3


Operation of DI/DO Module EtherCAT Programming Guide

18.2 _ECAT_Slave_DIO_Get_Output_Value
 Syntax

18
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Acquire the value output by the digital output remote


Value U16* Value
module.

 Example
U16 Status;
U16 CardNo=16, NodeID=1, SlotNo=0;
U16 Value;

Status=_ECAT_Slave_DIO_Get_Output_Value (CardNo, NodeID, SlotNo, &Value);

18-4 March, 2017


EtherCAT Programming Guide Operation of DI/DO Module

18.3 _ECAT_Slave_DIO_Set_Output_Value
 Syntax

18
U16 PASCAL_ECAT_Slave_DIO_Set_Output_Value (U16 CardNo, U16 NodeID, U16 SlotNo,
U16 Value)

 Purpose
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Value U16 Value The value output by the digital output remote module.

 Example
U16 Status;
U16 CardNo=16, NodeID=1, SlotNo=0;
U16 Value=0xFFFF;

Status=_ECAT_Slave_DIO_Set_Output_Value (CardNo, NodeID, SlotNo, Value);

March, 2017 18-5


Operation of DI/DO Module EtherCAT Programming Guide

18.4 _ECAT_Slave_DIO_Get_Single_Input_Value
 Syntax

18
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 Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

BitNum U16 Number Channel number of digital input

Value U16* Value The input value of the specified channel on DI module

 Example
U16 Status;
U16 CardNo=16, NodeID=1, SlotNo=0, BitNum=1;
U16 Value;

Status=_ECAT_Slave_DIO_Get_Single_Input_Value (CardNo, NodeID, SlotNo, BitNum,


&Value);

18-6 March, 2017


EtherCAT Programming Guide Operation of DI/DO Module

18.5 _ECAT_Slave_DIO_Get_Single_Output_Value
 Syntax

18
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 Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

BitNum U16 Number Channel number of digital output

The output value of the specified channel on DO


Value U16* Value
module

 Example
U16 Status;
U16 CardNo=16, NodeID=1, SlotNo=0, BitNum=1;
U16 Value;

Status=_ECAT_Slave_DIO_Get_Single_Output_Value (CardNo, NodeID, SlotNo, BitNum,


&Value);

March, 2017 18-7


Operation of DI/DO Module EtherCAT Programming Guide

18.6 _ECAT_Slave_DIO_Set_Single_Output_Value
 Syntax

18
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 Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

BitNum U16 Number Channel number of digital output

Value U16 Value The output value of the single channel on DO module

 Example
U16 Status;
U16 CardNo=16, NodeID=1, SlotNo=0, BitNum=1;
U16 Value=1;

Status=_ECAT_Slave_DIO_Set_Single_Output_Value (CardNo, NodeID, SlotNo, BitNum,


Value);

18-8 March, 2017


EtherCAT Programming Guide Operation of DI/DO Module

18.7 _ECAT_Slave_DIO_Set_Output_Error_Mode
 Syntax

18
U16 PASCAL_ECAT_Slave_DIO_Set_Output_Error_Mode (U16 CardNo, U16 NodeID,
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:
1. Please use _ECAT_Slave_DIO_Set_Output_Error_Value (see section 18.8) to set the output value
when EtherCAT communication is disconnected.
2. Retentive function is only supported by R1-EC70E2D0 and R1-EC70F2D0.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Bit 0 ~ 15 represent the output channels Y0 ~ Y15

respectively.
BitMode U16 Value
0: Disable

1: Enable

 Example
U16 Status;
U16 CardNo=16, NodeID=1, SlotNo=0;
// Enable the retentive function for the first 8 channels.
U16 BitMode=0x0F;

Status=_ECAT_Slave_DIO_Set_Output_Error_Mode (CardNo, NodeID, SlotNo, BitMode);

March, 2017 18-9


Operation of DI/DO Module EtherCAT Programming Guide

18.8 _ECAT_Slave_DIO_Set_Output_Error_Value
 Syntax

18
U16 PASCAL_ECAT_Slave_DIO_Set_Output_Error_Value (U16 CardNo, U16 NodeID,
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.

 Parameter
Name Data type Unit Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Bit0 ~ 15 represent the output channels Y0~Y15

respectively.
Value U16 Value
0: Output channel is off

1: Output channel is on

 Example
U16 Status;
U16 CardNo=16, NodeID=1, SlotNo=0;
// Change the function of the first 8 channels to retentive function when communication is
disconnected.
U16 Value=0x0F;

Status=_ECAT_Slave_DIO_Set_Output_Error_Value (CardNo, NodeID, SlotNo, Value);

18-10 March, 2017


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. Please refer to chapter 23 for more information. For its function settings, refer to
chapter 24.

19.1 _ECAT_Slave_AIO_Get_Input_Value ················································· 19-3


19.2 _ECAT_Slave_AIO_Set_Output_Value ··············································· 19-4
19.3 _ECAT_Slave_AIO_Get_Output_Value ·············································· 19-5

March, 2017 19-1


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

19 _ECAT_Slave_AIO_Set_Output_Value

_ECAT_Slave_AIO_Get_Output_Value
Set analog output value

Acquire analog output value

19-2 March, 2017


EtherCAT Programming Guide Operation of AI/AO Module

19.1 _ECAT_Slave_AIO_Get_Input_Value
 Syntax

19
U16 PASCAL_ECAT_Slave_AIO_Get_Input_Value (U16 CardNo, U16 NodeID, U16 SlotNo,
U16 *Value)

 Purpose
This is for acquiring analog input value.
Note: Delta analog input module only allows users to measure voltage signal.
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

Acquire the data from AI remote module. The value is


Value U16* Value
0 ~ 65535.

 Example
U16 Status=0;
U16 CardNo=16, NodeID=1, SlotNo=0;
U16 Value;

Status=_ECAT_Slave_AIO_Get_Input_Value (CardNo, NodeID, SlotNo, &Value);

March, 2017 19-3


Operation of AI/AO Module EtherCAT Programming Guide

19.2 _ECAT_Slave_AIO_Set_Output_Value
 Syntax

19
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

The output value of the AO module, which ragne is 0 ~


Value U16 Value
65535.

 Example
U16 Status=0;
U16 CardNo=16, NodeID =1, SlotNo=0;
U16 Value=0x5ff;

Status=_ECAT_Slave_AIO_Set_Output_Value (CardNo, NodeID, SlotNo, Value);

19-4 March, 2017


EtherCAT Programming Guide Operation of AI/AO Module

19.3 _ECAT_Slave_AIO_Set_Output_Value
 Syntax

19
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.

 Parameter
Name Data type Property Description

CardNo U16 Number Card No.

NodeID U16 Number Node ID

SlotNo U16 Number Slot ID

The output value of the AO module, which ragne is 0 ~


Value U16* Value
65535.

 Example
U16 Status=0;
U16 CardNo=16, NodeID=1, SlotNo=0;
U16 Value=0;

Status=_ECAT_Slave_AIO_Get_Output_Value (CardNo, NodeID, SlotNo, &Value);

March, 2017 19-5


Operation of AI/AO Module EtherCAT Programming Guide

(This page is intentionally left blank.)

19

19-6 March, 2017


Operation of Pulse
Module
(For R1-EC5621D0 Series)
This chapter provides the details about how to use the APIs for operating the pulse
module (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.

20.1 _ECAT_Slave_R1_EC5621_Set_Output_Mode ···································· 20-3


20.2 _ECAT_Slave_R1_EC5621_Set_Input_Mode ······································ 20-4
20.3 _ECAT_Slave_R1_EC5621_Set_ORG_Inverse···································· 20-5
20.4 _ECAT_Slave_R1_EC5621_Set_QZ_Inverse ······································ 20-6
20.5 _ECAT_Slave_R1_EC5621_Set_Home_SpMode ································· 20-7
20.6 _ECAT_Slave_R1_EC5621_Set_MEL_Inverse ···································· 20-8
20.7 _ECAT_Slave_R1_EC5621_Set_PEL_Inverse ····································· 20-9
20.8 _ECAT_Slave_R1_EC5621_Set_Svon_Inverse··································· 20-10
20.9 _ECAT_Slave_R1_EC5621_Set_Home _Slow_Down ··························· 20-11
20.10 _ECAT_Slave_R1_EC5621_Get_IO_Status ········································ 20-12
20.11 _ECAT_Slave_R1_EC5621_Get_Single_IO_Status ······························ 20-13

March, 2017 20-1


Operation of Pulse Module (R1-EC5621D0) EtherCAT Programming Guide

API list of pulse module operation (for R1-EC5621D0 series)


API 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).
Set the contact type (NC/NO) of encoder’s Z pulse
_ECAT_Slave_R1_EC5621_Set_QZ_Inverse
(QZ).

_ECAT_Slave_R1_EC5621_Set_Home_SpMode Apply the special mode when homing.

Set the contact type (NC/NO) of the negative limit


_ECAT_Slave_R1_EC5621_Set_MEL_Inverse
switch (MEL).
Set the contact type (NC/NO) of the positive limit
_ECAT_Slave_R1_EC5621_Set_PEL_Inverse
switch (PEL).
Set the contact type (NC/NO) of the servo enable
_ECAT_Slave_R1_EC5621_Set_Svon_Inverse
switch (Svon).
It sets the deceleration time after the motor
_ECAT_Slave_R1_EC5621_Set_Home_Slow_Down
reaches the origin
_ECAT_Slave_R1_EC5621_Get_IO_Status Acquire the status of all I/O points

_ECAT_Slave_R1_EC5621_Get_Single_IO_Status Acquire the status of single I/O point.

20-2 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-EC5621D0)

20.1 _ECAT_Slave_R1_EC5621_Set_Output_Mode
 Syntax

20
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 Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: A/B Phase
Mode U16 Option 1: CW/CCW

2: PLS/DIR

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0;
U16 Mode=1;

Status= _ECAT_Slave_R1_EC5621_Set_Output_Mode (CardNo, AxisNo, SlotNo, Mode);

March, 2017 20-3


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 Description
CardNo U16 Number Card number
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: A/B Phase
Mode U16 Option 1: CW/CCW

2: PLS/DIR

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0;
U16 Mode=1;

Status= _ECAT_Slave_R1_EC5621_Set_Input_Mode (CardNo, AxisNo, SlotNo, Mode);

20-4 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-EC5621D0)

20.3 _ECAT_Slave_R1_EC5621_Set_ORG_Inverse
 Syntax

20
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
Name Data type Property Description
CardNo U16 Number Card number
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: High-potential trigger (NO)
Enable U16 Option
1: Low-potential trigger (NC)

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_EC5621_Set_ORG_Inverse (CardNo, AxisNo,SlotNo, Enable);

March, 2017 20-5


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
Name Data type Property Description
CardNo U16 Number Card number
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: High-potential trigger (NO)
Enable U16 Option
1: Low-potential trigger (NC)

 Example
U16 Status = 0;
U16 CardNo=16 , AxisNo =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_EC5621_Set_QZ_Inverse (CardNo, AxisNo,SlotNo, Enable);

20-6 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-EC5621D0)

20.5 _ECAT_Slave_R1_EC5621_Set_Home_SpMode
 Syntax

20
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
Name Data type Property Description
CardNo U16 Number Card number
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: Mode 0 (Normal)
Mode U16 Option 1: Mode 1 (Special); EtherCAT master will look for

encoder’s Z pulse (QZ) at extremely low speed.

 Example
U16 Status = 0;
U16 CardNo=16 , AxisNo =1, SlotNo=0;
U16 Mode=0;

Status= _ECAT_Slave_R1_EC5621_Set_Home_SpMode (CardNo, AxisNo,SlotNo, Mode);

March, 2017 20-7


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
Name Data type Property Description
CardNo U16 Number Card number
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: High-potential trigger (NO)
Enable U16 Option
1: Low-potential trigger (NC)

 Example
U16 Status = 0;
U16 CardNo=16 , AxisNo =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_EC5621_Set_MEL_Inverse (CardNo, AxisNo, SlotNo, Enable);

20-8 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-EC5621D0)

20.7 _ECAT_Slave_R1_EC5621_Set_PEL_Inverse
 Syntax

20
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
Name Data type Property Description
CardNo U16 Number Card number
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: High-potential trigger (NO)
Enable U16 Option
1: Low-potential trigger (NC)

 Example
U16 Status = 0;
U16 CardNo=16 , AxisNo =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_EC5621_Set_PEL_Inverse (CardNo, AxisNo, SlotNo, Enable);

March, 2017 20-9


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
Name Data type Property Description
CardNo U16 Number Card number
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: High-potential trigger (NO)
Enable U16 Option
1: Low-potential trigger (NC)

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_EC5621_Set_Svon_Inverse (CardNo, AxisNo, SlotNo, Enable);

20-10 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-EC5621D0)

20.9 _ECAT_Slave_R1_EC5621_Set_Home _Slow_Down


 Syntax

20
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. If the motor runs in reverse direction, it sets the deceleration of the 1st speed and the waiting
time after the motor stops.
2. If the motor runs forward, only the setting of WaitTime is valid.
This API will be invalid when the positive / negative limit is regarded as the origin.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
AxisNo U16 Number Axis number
SlotNo U16 Number Slot ID
0: Disable
Enable U16 Option
1: Enable

SlowDownTime U16 Millisecond The deceleration time when motor reaches the limit.

The waiting time after the motor reaches the limit and
WaitTime U16 Millisecond
then stops.

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0, Enable=1, SlowDownTime =1, WaitTime=1;

Status= _ECAT_Slave_R1_EC5621_Set_Home_Slow_Down (CardNo, AxisNo, SlotNo,


Enable, SlowDownTime, WaitTime);

March, 2017 20-11


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 Property Description
CardNo U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
IOStatus U16* Numeric value Status of all I/O points.

 Example
U16 Status = 0;
U16 CardNo=16, NodeID =7, SlotNo=0;
U16 IOStatus;

Status= _ECAT_Slave_R1_EC5621_Get_IO_Status (CardNo, NodeID, SlotNo, &IOStatus);

20-12 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-EC5621D0)

20.11 _ECAT_Slave_R1_EC5621_Get_Single_IO_Status
 Syntax

20
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 Data type Property Description
CardNo U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
BitNo U16 Number I/O point No.
IOStatus U16* Numeric value Status of single I/O point

 Example
U16 Status = 0;
U16 CardNo=16, NodeID =7, SlotNo=0;
U16 IOStatus, BitNo=1;

Status= _ECAT_Slave_R1_EC5621_Get_Single_IO_Status (CardNo, NodeID, SlotNo, BitNo,


&IOStatus);

March, 2017 20-13


Operation of Pulse Module (R1-EC5621D0) EtherCAT Programming Guide

(This page is intentionally left blank.)

20-14 March, 2017


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.

21
21.1 _ECAT_Slave_R1_ECx62x_Set_Output_Mode ···································· 21-3
21.2 _ECAT_Slave_R1_ECx62x_Set_Input_Mode ······································ 21-4
21.3 _ECAT_Slave_R1_ECx62x_Set_ORG_Inverse ···································· 21-5
21.4 _ECAT_Slave_R1_ECx62x_Set_QZ_Inverse ······································ 21-6
21.5 _ECAT_Slave_R1_ECx62x_Set_Home_SpMode ································· 21-7
21.6 _ECAT_Slave_R1_ECx62x_Set_MEL_Inverse ···································· 21-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

March, 2017 21-1


Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide

API list of pulse module operation (for R1-ECx62xD0 series)


API Description
_ECAT_Slave_R1_ECx62x_Set_Output_Mode Set the type of pulse output

21 _ECAT_Slave_R1_ECx62x_Set_Input_Mode

_ECAT_Slave_R1_ECx62x_Set_ORG_Inverse
Set the type of pulse input
Set the contact type (NC/NO) of the origin switch
(ORG)
Set the contact type (NC/NO) of encoder’s Z pulse
_ECAT_Slave_R1_ECx62x_Set_QZ_Inverse
signal (QZ)
_ECAT_Slave_R1_ECx62x_Set_Home_SpMode Apply the special mode when homing
Set the contact type (NC/NO) of the negative limit
_ECAT_Slave_R1_ECx62x_Set_MEL_Inverse
switch (MEL)
Set the contact type (NC/NO) of the positive limit
_ECAT_Slave_R1_ECx62x_Set_PEL_Inverse
switch (PEL)
Set the contact type (NC/NO) of the servo enable
_ECAT_Slave_R1_ECx62x_Set_Svon_Inverse
switch (Svon)
It sets the deceleration time after the motor reaches
_ECAT_Slave_R1_ECx62x_Set_Home_Slow_Down
the Home switch
_ECAT_Slave_R1_ECx62x_Get_IO_Status Acquire the status of all I/O points
_ECAT_Slave_R1_ECx62x_Get_Single_IO_Status Acquire the status of single I/O point

21-2 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-ECx62xD0 Series)

21.1 _ECAT_Slave_R1_ECx62x_Set_Output_Mode
 Syntax

21
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 Property Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
Slot No U16 Number Slot ID
0: A/B Phase
Mode U16 Option 1: CW/CCW

2: PLS/DIR

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0;
U16 Mode=1;

Status= _ECAT_Slave_R1_ECx62x_Set_Output_Mode (CardNo, AxisNo, SlotNo, Mode);

March, 2017 21-3


Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide

21.2 _ECAT_Slave_R1_ECx62x_Set_Input_Mode
 Syntax

21
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 Property Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: A/B Phase
Mode U16 Option 1: CW/CCW

2: PLS/DIR

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0;
U16 Mode=1;

Status= _ECAT_Slave_R1_ECx62x_Set_Input_Mode (CardNo, AxisNo, SlotNo, Mode);

21-4 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-ECx62xD0 Series)

21.3 _ECAT_Slave_R1_ECx62x_Set_ORG_Inverse
 Syntax

21
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).

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: High-potential trigger (NO)
Enable U16 Option
1: Low-potential trigger (NC)

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_ECx62x_Set_ORG_Inverse (CardNo, AxisNo,SlotNo, Enable);

March, 2017 21-5


Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide

21.4 _ECAT_Slave_R1_ECx62x_Set_QZ_Inverse
 Syntax

21
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).

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: High-potential trigger (NO)
Enable U16 Option
1: Low-potential trigger (NC)

 Example
U16 Status = 0;
U16 CardNo=16 , AxisNo =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_ECx62x_Set_QZ_Inverse (CardNo, AxisNo,SlotNo, Enable);

21-6 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-ECx62xD0 Series)

21.5 _ECAT_Slave_R1_ECx62x_Set_Home_SpMode
 Syntax

21
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
Name Data type Property Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: Mode 0 (Normal)
Mode U16 Option 1: Mode 1 (Special); EtherCAT master will look for

encoder’s Z pulse (QZ) at extremely low speed.

 Example
U16 Status = 0;
U16 CardNo=16 , AxisNo =1, SlotNo=0;
U16 Mode=0;

Status= _ECAT_Slave_R1_ECx62x_Set_Home_SpMode (CardNo, AxisNo,SlotNo, Mode);

March, 2017 21-7


Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide

21.6 _ECAT_Slave_R1_ECx62x_Set_MEL_Inverse
 Syntax

21
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).

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: High-potential trigger (NO)
Enable U16 Option
1: Low-potential trigger (NC)

 Example
U16 CardNo=16 , AxisNo =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_ECx62x_Set_MEL_Inverse (CardNo, AxisNo, SlotNo, Enable);

21-8 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-ECx62xD0 Series)

21.7 _ECAT_Slave_R1_ECx62x_Set_PEL_Inverse
 Syntax

21
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).

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: High-potential trigger (NO)
Enable U16 Option
1: Low-potential trigger (NC)

 Example
U16 Status = 0;
U16 CardNo=16 , AxisNo =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_ECx62x_Set_PEL_Inverse (CardNo, AxisNo, SlotNo, Enable);

March, 2017 21-9


Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide

21.8 _ECAT_Slave_R1_ECx62x_Set_Svon_Inverse
 Syntax

21
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).

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
0: High-potential trigger (NO)
Enable U16 Option
1: Low-potential trigger (NC)

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_ECx62x_Set_Svon_Inverse (CardNo, AxisNo, SlotNo, Enable);

21-10 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-ECx62xD0 Series)

21.9 _ECAT_Slave_R1_ECx62x_Set_Home_Slow_Down
 Syntax

21
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. If the motor runs in reverse direction, it sets the deceleration of the 1st speed and the waiting
time after the motor stops.
2. If the motor runs forward, only the setting of WaitTime is valid.
This API will be invalid when the positive / negative limit is regarded as the origin.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
0: Disable
Enable U16 Option
1: Enable

SlowDownTime U16 Millisecond The deceleration time when motor reaches the limit.

The waiting time after the motor reaches the limit and
WaitTime U16 Millisecond
then stops.

 Example
U16 Status = 0;
U16 CardNo=16, NodeID =7, SlotNo=0;
U16 Enable=1, SlowDownTime = 1000, WaitTime= 1000;

Status= _ECAT_Slave_R1_ECx62x_Set_Home_Slow_Down (CardNo, NodeID, SlotNo, Enable,


SlowDownTime, WaitTime);

March, 2017 21-11


Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide

21.10 _ECAT_Slave_R1_ECx62x_Get_IO_Status
 Syntax

21
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 Property Description
CardNo U16 Number Card No.
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
IOStatus U16* Numeric value Status of all I/O points

 Example
U16 Status = 0;
U16 CardNo=16, NodeID =7, SlotNo=0;
U16 IOStatus;

Status= _ECAT_Slave_R1_ECx62x_Get_IO_Status (CardNo, NodeID, SlotNo, &IOStatus);

21-12 March, 2017


EtherCAT Programming Guide Operation of Pulse Module (R1-ECx62xD0 Series)

21.11 _ECAT_Slave_R1_ECx62x_Get_Single_IO_Status

21
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
Name Data type Property Description
CardNo U16 Number Card No.
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
BitNo U16 Number I/O point number

IOStatus U16* Numeric value Status of single I/O point

 Example
U16 Status = 0;
U16 CardNo=16, NodeID =7, SlotNo=0;
U16 IOStatus, BitNo=1;

Status= _ECAT_Slave_R1_ECx62x_Get_Single_IO_Status (CardNo, NodeID, SlotNo, BitNo,


&IOStatus);

March, 2017 21-13


Operation of Pulse Module (R1-ECx62xD0 Series) EtherCAT Programming Guide

(This page is intentionally left blank.)

21

21-14 March, 2017


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.

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 ································ 22-7
22.6 _ECAT_Slave_DeltaServo_Get_Compare_Enable ································ 22-8
22.7 _ECAT_Slave_DeltaServo_Set_Compare_Config ································· 22-9

March, 2017 22-1


Operation of Delta Servo System EtherCAT Programming Guide

API list of operarting delta servo drive


API Description
_ECAT_Slave_DeltaServo_Write_Parameter Write servo parameter values to Delta servo drives

22 _ECAT_Slave_DeltaServo_Read_Parameter

_ECAT_Slave_DeltaServo_Read_Parameter_Info
Read servo parameter values from Delta servo drives

Read servo parameter attributes from Delta servo


drives
_ECAT_Slave_DeltaServo_Set_Velocity_Limit Set Delta servo motor’s max. speed

Write the pulse compare parameter, which is identical


_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

22-2 March, 2017


EtherCAT Programming Guide Operation of Delta Servo System

22.1 _ECAT_Slave_DeltaServo_Write_Parameter
 Syntax

22
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
AxisNo U16 Number Node ID
Slot No U16 Number Slot ID
Page U16 Value Device (servo drive) parameter group number
Index U16 Value Index of the servo parameter group
WriteData I32 Value The data to be written to this group index.

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo=1, SlotNo=0;
U16 Page =3, Index =0; // P3-00
I32 WriteData = 1;

Status= _ECAT_Slave_DeltaServo_Write_Parameter (CardNo, AxisNo, SlotNo, Page, Index,


WriteData);

March, 2017 22-3


Operation of Delta Servo System EtherCAT Programming Guide

22.2 _ECAT_Slave_DeltaServo_Read_Parameter
 Syntax

22
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
AxisNo U16 Number Node ID
Slot No U16 Number Slot ID
Page U16 Value Device (servo drive) parameter group number
Index U16 Value Index of the servo parameter group
ReadData I32* Value The data returned from the group index.

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo = 1, SlotNo = 0;
U16 Page = 2, Index = 12; // P2-12
I32 ReadData = 0;

Status= _ECAT_Slave_DeltaServo_Read_Parameter (CardNo, AxisNo, SlotNo, Page, Index,


&ReadData);

22-4 March, 2017


EtherCAT Programming Guide Operation of Delta Servo System

22.3 _ECAT_Slave_DeltaServo_Read_Parameter_Info
 Syntax

22
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
Page U16 Value Device (servo drive) parameter group number
Index U16 Value Index of the servo parameter group
Parameter type:
0: This parameter is not available.
1: This parameter is read-only.
2: This parameter cannot be set when the servo is in
ParaType U16* Value “enabled” state.
3: Power off and restart the servo drive is required in
order to validate this parameter setting.
4: This is a volatile parameter.
5: N/A
DataSize U16* Value Data size of this parameter (Unit: Byte)
Data type
1: This parameter is displayed in decimal form.
DataType U16* Value 2: This parameter is displayed in hexadecimal form.
3: Display of this parameter is user-defined. Please
refer to the servo drive user manual.

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0;
U16 Page =1;
U16 Index =0;
U16 ParaType = 0, DataSize=0, DataType = 0;

Status = _ECAT_Slave_DeltaServo_Read_Parameter_Info (CardNo, AxisNo, SlotNo, Page,


Index, &ParaType, &DataSize, &DataType);

March, 2017 22-5


Operation of Delta Servo System EtherCAT Programming Guide

22.4 _ECAT_Slave_DeltaServo_Set_Velocity_Limit
 Syntax

22
U16 PASCAL _ECAT_Slave_DeltaServo_Set_Velocity_Limit (U16 CardNo, U16 AxisNo,
U16 SlotNo, U32 LimitValue)

 Purpose
This is for setting Delta servo motor’s max. speed.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
AxisNo U16 Number Node ID
SlotNo U16 Number Slot ID
LimitValue U32 RPM Speed limit

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0;
U32 LimitValue = 100;

Status=_ECAT_Slave_DeltaServo_Set_Velocity_Limit (CardNo, AxisNo, SlotNo, LimitValue);

22-6 March, 2017


EtherCAT Programming Guide Operation of Delta Servo System

22.5 _ECAT_Slave_DeltaServo_Set_Compare_Enable
 Syntax

22
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 Property Description
CardNo U16 Number Card number
AxisNo U16 Number Axis number
SlotNo U16 Number Slot ID
Compare function of the servo drive
Enable U16 Option 1: Enable
2: Disable

Source for the pulse compare function:


0: Capture Axes (not supported by A2-E servo drive).
1: AUX ENC (linear scale). (only supported by A2R-E
CompareSource U16 Option servo drive)
2: External pulse command (not supported by A2-E
servo drive).
3: Main ENC (Main encoder).

SignalLength U16 Millisecond Trigger duration of the output signal

Polarity of the output signal.


SignalPolarity U16 Option 0: High-potential trigger (NO)
1: Low-potential trigger (NC)

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo = 1, SlotNo = 0, Enable=1, CompareSource=1, SignalLength=1,
SignalPolarity=1;

Status=_ECAT_Slave_DeltaServo_Set_Compare_Enable (CardNo, AxisNo, SlotNo, Enable,


CompareSource, SignalLength, SignalPolarity);

March, 2017 22-7


Operation of Delta Servo System EtherCAT Programming Guide

22.6 _ECAT_Slave_DeltaServo_Get_Compare_Enable
 Syntax

22
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 Property Description
CardNo U16 Number Card number
AxisNo U16 Number Axis number
SlotNo U16 Number Slot ID
Compare function of the servo drive
Enable U32 Option 1: Enable
2: Disable
Source for the pulse compare function:
0: Capture Axes (not supported by A2-E servo drive).
1: AUX ENC (linear scale). (only supported by A2R-E
CompareSource U32 Option servo drive)
2: External pulse command (not supported by A2-E
servo drive).
3: Feedback pulse of the servo drive.
SignalLength U32 Millisecond Trigger duration of the output signal
Polarity of the output signal.
SignalPolarity U32 Option 0: High-potential trigger (NO)
1: Low-potential trigger (NC)

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo = 1, SlotNo = 0, Enable, CompareSource, SignalLength,
SignalPolarity;

Status=_ECAT_Slave_ DeltaServo_Get_Compare_Enable (CardNo, AxisNo, SlotNo,


&Enable, &CompareSource, &SignalLength, &SignalPolarity);

22-8 March, 2017


EtherCAT Programming Guide Operation of Delta Servo System

22.7 _ECAT_Slave_DeltaServo_Set_Compare_Config
 Syntax

22
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 Property Description
CardNo U16 Number Card number
AxisNo U16 Number Axis number
SlotNo U16 Number Slot ID
CompareNum U16 Quantity Quantity of the data array.
Data array, which length has to be equal to or greater
ComparePos I32* Array of value
than value of CompareNum.

 Example
U16 Status = 0;
U16 CardNo=16, AxisNo =1, SlotNo=0;
I32 ComparePos;

Status=_ECAT_Slave_DeltaServo_Set_Compare_Config(CardNo, AxisNo, SlotNo,


CompareNum, ComparePos);

March, 2017 22-9


Operation of Delta Servo System EtherCAT Programming Guide

(This page is intentionally left blank.)

22

22-10 March, 2017


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.

23.1 _ECAT_Slave_R1_EC8124_Set_Input _RangeMode ···························· 23-3


23.2 _ECAT_Slave_R1_EC8124_Set_Input _ConvstFreq_Mode ···················· 23-4
23.3 _ECAT_Slave_R1_EC8124_Set_Input_Enable ···································· 23-5
23.4 _ECAT_Slave_R1_EC8124_Get_Input _RangeMode ···························· 23-6
23.5 _ECAT_Slave_R1_EC8124_Set_Input _AverageMode ·························· 23-7

March, 20167 23-1


Analog Input Settings (For R1-EC8124D0) EtherCAT Programming Guide

API of analog input settings (for R1-EC8124D0 series)


API Description
Set the sampling range of Delta analog input

23
_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
_ECAT_Slave_R1_EC8124_Set_Input_Enable
function of Delta analog input module
Acquire the sampling range of Delta analog
_ECAT_Slave_R1_EC8124_Get_Input_RangeMode
input module
Set the average times for the analog input
_ECAT_Slave_R1_EC8124_Set_Input_AverageMode
filter of Delta analog input module

23-2 March, 2017


EtherCAT Programming Guide Analog Input Settings (For R1-EC8124D0)

23.1 _ECAT_Slave_R1_EC8124_Set_Input_RangeMode
 Syntax

23
U16 PASCAL _ECAT_Slave_R1_EC8124_Set_Input_RangeMode (U16 CardNo,
U16 NodeID, U16 SlotNo, U16 RangeMode)

 Purpose
This is for setting the sampling range of Delta analog input module.
Note: Delta analog input module only allows users to measure voltage signal.

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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
Output range setting:
RangeMode U16 Option 0: -5 V ~ 5 V (default)
1: -10 V ~ 10 V

 Example
U16 Status = 0;
U16 CardNo=16 , NodeID =1, SlotNo=0;
U16 RangeMode=1;

Status= _ECAT_Slave_R1_EC8124_Set_Input_RangeMode (CardNo, NodeID,SlotNo,


RangeMode);

March, 2017 23-3


Analog Input Settings (For R1-EC8124D0) EtherCAT Programming Guide

23.2 _ECAT_Slave_R1_EC8124_Set_Input_ConvstFreq_Mode
 Syntax

23
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 U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
Sampling rate setting
Option Sampling rate (kHz)
0 200
1 100

RangeMode U16 Option 2 50


3 25
4 12.5
5 6.25
6 3.125

 Example
U16 Status = 0;
U16 CardNo=16 , NodeID =1, SlotNo=0;
U16 Mode=2;

Status= _ECAT_Slave_R1_EC8124_Set_Input_ConvstFreq_Mode (CardNo, NodeID,SlotNo,


Mode);

23-4 March, 2017


EtherCAT Programming Guide Analog Input Settings (For R1-EC8124D0)

23.3 _ECAT_Slave_R1_EC8124_Set_Input_Enable
 Syntax

23
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 Data type Property Description
CardNo U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
0: Disable
Enable U16 Option
1: Enable

 Example
U16 Status = 0;
U16 CardNo=16 , NodeID =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_EC8124_Set_Input_Enable (CardNo, NodeID,SlotNo, Enable);

March, 2017 23-5


Analog Input Settings (For R1-EC8124D0) EtherCAT Programming Guide

23.4 _ECAT_Slave_R1_EC8124_Get_Input_RangeMode
 Syntax

23
U16 PASCAL _ECAT_Slave_R1_EC8124_Get_Input_RangeMode (U16 CardNo,
U16 NodeID, U16 SlotNo, U16* RangeMode)

 Purpose
This is for aquiring the sampling range of Delta analog input module.
Note: Delta analog input module only allows users to measure voltage signal.

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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
Output range setting:
RangeMode U16* Option 0: -5 V ~ 5 V (default)
1: -10 V ~ 10 V

 Example
U16 Status = 0;
U16 CardNo=16, NodeID =1, SlotNo=0;
U16 RangeMode;

Status= _ECAT_Slave_R1_EC8124_Get_Input_RangeMode (CardNo, NodeID,SlotNo,


&RangeMode);

23-6 March, 2017


EtherCAT Programming Guide Analog Input Settings (For R1-EC8124D0)

23.5 _ECAT_Slave_R1_EC8124_Set_Input_AverageMode
 Syntax

23
U16 PASCAL _ECAT_Slave_R1_EC8124_Set_Input_AverageMode (U16 CardNo, U16 NodeID,
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 1st to127th data based on the setting
count.

 Parameter
Name Data type Property Description

CardNo U16 Number Card number


NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
Average times for the analog input, which range is 1 ~
Avg_Times U16 Value
127.

 Example
U16 Status = 0;
U16 CardNo=16 , NodeID =1, SlotNo=0;
U16 Avg_Times =5;

Status= _ECAT_Slave_R1_EC8124_Set_Input_AverageMode (CardNo, NodeID,SlotNo,


Avg_Times);

March, 2017 23-7


Analog Input Settings (For R1-EC8124D0) EtherCAT Programming Guide

(This page is intentionally left blank.)

23

23-8 March, 2017


Analog Output Settings
(For R1-EC9144D0)
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
19.

24.1 _ECAT_Slave_R1_EC9144_Set_Output _RangeMode ·························· 24-3


24.2 _ECAT_Slave_R1_EC9144_Set_Output_Enable ·································· 24-4
24.3 _ECAT_Slave_R1_EC9144_Get_Output _ReturnCode ·························· 24-5

March, 2017 24-1


Analog Output Settings (R1-EC9144) EtherCAT Programming Guide

API list of analog output settings (for R1-EC9144D0 series)


API Description
Set the output range of Delta analog output
_ECAT_Slave_R1_EC9144_Set_Output _RangeMode

24
module
Enable/Disable the analog output of Delta
_ECAT_Slave_R1_EC9144_Set_Output _Enable
module
Acquire the operation status of Delta analog
_ECAT_Slave_R1_EC9144_Get_Output _ReturnCode
output module

24-2 March, 2017


EtherCAT Programming Guide Analog Output Settings (R1-EC9144)

24.1 _ECAT_Slave_R1_EC9144_Set_Output _RangeMode


 Syntax

24
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 U16 Number Card No.
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID

Output range of analog output:


0: 0 ~ 5 V (Default)
1: 0 ~ 10 V
2: -5 V ~ 5 V
RangeMode U16 Option
3: -10 V ~ 10 V
4: 4 ~ 20 mA
5: 0 ~ 20 mA
6: 0 ~ 24 mA

 Example
U16 Status = 0;
U16 CardNo=16, NodeID =1, SlotNo=0;
U16 RangeMode=3;

Status= _ECAT_Slave_R1_EC9144_Set_Output_RangeMode (CardNo, NodeID,SlotNo,


RangeMode);

March, 2017 24-3


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

24 SlotNo, U16 Enable)

 Purpose
This is for enabling/disabling the analog output of Delta module.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
0: Disable
Enable U16 Option
1: Enable

 Example
U16 Status = 0;
U16 CardNo=16, NodeID =1, SlotNo=0;
U16 Enable=1;

Status= _ECAT_Slave_R1_EC9144_Set_Output_Enable (CardNo, NodeID, SlotNo,


Enable);

24-4 March, 2017


EtherCAT Programming Guide Analog Output Settings (R1-EC9144)

24.3 _ECAT_Slave_R1_EC9144_Get_Output _ReturnCode


 Syntax

24
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 U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
Please see ths list of
*ReturnCode U16* Return code _ECAT_Slave_AIO_Get_Output_ReturnCode in the table
below.

 Example
U16 Status = 0;
U16 CardNo=16, NodeID =1, SlotNo=0;
U16 ReturnCode;
Status= _ECAT_Slave_R1_EC9144_Get_Output_ReturnCode (CardNo, NodeID, SlotNo,
&ReturnCode);

March, 2017 24-5


Analog Output Settings (R1-EC9144) EtherCAT Programming Guide

List of _ECAT_Slave_AIO_Get_Output_ReturnCode
Bit Description

0 Iout_3 error: This bit is set if an error is detected on current output channel 3.

24 1

2
Iout_2 error: This bit is set if an error is detected on current output channel 2.

Iout_1 error: This bit is set if an error is detected on current output channel 1.

3 Iout_0 error: This bit is set if an error is detected on current output channel 0.

4 Vout_3 error: This bit is set if an error is detected on voltage output channel 3.

5 Vout_2 error: This bit is set if an error is detected on voltage output channel 2.

6 Vout_1 error: This bit is set if an error is detected on voltage output channel 1.

7 Vout_0 error: This bit is set if an error is detected on voltage output channel 0.

8 Overheat: This bit is set If temperature of the AD converter chip is over 150°C.

9 Ramp active: This bit is set while any one of the output channel is slewing.

10 PEC error: Denotes a PEC error on the last data-word received over the SPI interface.

PEC enabled: This is a read only bit. It allows the user to verify the status of the packet error
11
checking feature.

DC-DC3: In current output mode, this bit is set on channel 3 if the dc-to-dc converter cannot

maintain compliance (it may be reaching its maximum voltage.

12 In voltage output mode, this bit is set if, on channel 3, the dc-to-dc converter is unable to regulate

to 15 V as expected.

When this bit is set, it does not result in the error pin going high.

DC-DC2: In current output mode, this bit is set on channel 2 if the dc-to-dc converter cannot

maintain compliance (it may be reaching its maximum voltage.)

13 In voltage output mode, this bit is set if, on channel 2, the dc-to-dc converter is unable to regulate

to 15 V as expected.

When this bit is set, it does not result in the error pin going high.

DC-DC1: In current output mode, this bit is set on channel 1 if the dc-to-dc converter cannot

maintain compliance (it may be reaching its maximum voltage.).


14 In voltage output mode, this bit is set if, on channel 1, the dc-to-dc converter is unable to regulate

to 15 V as expected.

When this bit is set, it does not result in the error pin going high.

DC-DC0: In current output mode, this bit is set on channel 0 if the dc-to-dc converter cannot

maintain compliance (it may be reaching its maximum voltage.).

15 In voltage output mode, this bit is set if, on channel 1, the dc-to-dc converter is unable to regulate

to 15 V as expected.

When this bit is set, it does not result in the error pin going high.

24-6 March, 2017


Auto Recording Function
of Motion Axis
This chapter introduces the APIs of auto recording function for the motion axis. With
this function, the 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.

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

March, 2017 25-1


Auto Recording Function of Motion Axis EtherCAT Programming Guide

API list of auto recording function for motion axis


API Description
_ECAT_Slave_Record_Data_Set_Type Set the recording data type of specified axis

25 _ECAT_Slave_Record_Data_Set_Enable

_ECAT_Slave_Record_Data_Get_Cnt
_ECAT_Slave_Record_Data_ReadData
Enable/Disable the recording function of specified axis

Acquire the data entry number of specified axis


Acquire the recorded data of specified axis
_ECAT_Slave_Record_Clear_Data Delete the saved record of specified axis
Enable/Disable the recoding function of specified
_ECAT_Slave_Record_Multi_Set_Enable
multiple axes
_ECAT_Slave_Record_Multi_Clear_Data Delete the saved record of specified multiple axes

25-2 March, 2017


EtherCAT Programming Guide Auto Recording Function of Motion Axis

25.1 _ECAT_Slave_Record_Set_Type
 Syntax

25
U16 PASCAL _ECAT_Slave_Record_Set_Type (U16 CardNo, U16 NodeID,
U16 SlotNo, U16 MonitorIndex, U16 IOType, U16 Index, U16 SubIndex)

 Purpose
Set the recording data type of specified axis.
EtherCAT master saves one data in each communication cycle. Each slave can save 8 different
OD codes.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
The group number of OD data to be recorded (0 ~ 7).
MonitorIndex U16 Number
Each slot can record 8 OD data.

Set the mode of recorded OD code.


IOType U16 Option 0: Input

1: Output

OD to be recorded. (Find more information in


Index U16 Index
CANopen documentation)

Sub OD to be recorded. (Find more information in


SubIndex U16 SubIndex
CANopen documentation)

 Example
U16 Status = 0;
U16 CardNo=16 , NodeID =1, SlotNo=0;
U16 MonitorIndex =0;
U16 IOType =0, Index=0x607A, SubIndex=1;

Status= _ECAT_Slave_Record_Set_Type (CardNo, NodeID, SlotNo, MonitorIndex,


IOType, Index, SubIndex);

March, 2017 25-3


Auto Recording Function of Motion Axis EtherCAT Programming Guide

25.2 _ECAT_Slave_Record_Set_Enable
 Syntax

25
U16 PASCAL _ECAT_Slave_Record_Set_Enable (U16 CardNo, U16 NodeID,
U16 SlotNo, U16 Enable)

 Purpose
Enable/Disable the recording function of specified axis.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
This value will refer to the bit setting and
Enable U16 Value enable/disable the recording function for the 8 groups
of OD data.

 Example
U16 Status = 0;
U16 CardNo=16 , NodeID =1, SlotNo=0;
U16 MonitorIndex =0;
U16 IOType =0, Index=0x607A, SubIndex=1;

Status= _ECAT_Slave_Record_Set_Type (CardNo, NodeID, SlotNo, MonitorIndex,


IOType, Index, SubIndex);

// Enable the recording function of group number 1 ~ 3 of Node ID 1. Disable the recordind
function of group number 4 ~ 8.
U16 Enable =0x07;
Status= _ECAT_Slave_Record_Set_Enable (CardNo, NodeID, SlotNo, Enable);

25-4 March, 2017


EtherCAT Programming Guide Auto Recording Function of Motion Axis

25.3 _ECAT_Slave_Record_Get_Cnt
 Syntax

25
U16 PASCAL _ECAT_Slave_Record_Get_Cnt (U16 CardNo, U16 NodeID,
U16 SlotNo, U16 *Cnt)

 Purpose
Acquire the data entry number of the specified axis.
EtherCAT master saves one data in each communication cycle. Each slave can save up to 8
groups of OD data.
Note:
1. 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.
2. When accessing one data by the API (_ECAT_Slave_Record_Read_Data) in 25.4, the acquired data
numbers will reduce 1 automatically.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
Cnt U16* Value Acquire current data count of the specified axis

 Example
U16 Status = 0;
U16 CardNo=16 , NodeID =1, SlotNo=0;
U16 MonitorIndex =0;
U16 IOType =0, Index=0x607A, SubIndex=1;
U16 Enable =0x07;
U16 Cnt ;

Status= _ECAT_Slave_Record_Set_Type (CardNo, NodeID, SlotNo, MonitorIndex,


IOType, Index, SubIndex);
Status= _ECAT_Slave_Record_Set_Enable (CardNo, NodeID, SlotNo, Enable);

while (1)
{
Status= _ECAT_Slave_Record_Get_Cnt (CardNo, NodeID, SlotNo, &Cnt);
}

March, 2017 25-5


Auto Recording Function of Motion Axis EtherCAT Programming Guide

25.4 _ECAT_Slave_Record_Read_Data
 Syntax

25
U16 PASCAL _ECAT_Slave_Record_Read_Data (U16 CardNo, U16 NodeID,
U16 SlotNo, U32 *Data)

 Purpose
Acquire the recording data of the specified axis. Users can withdraw the data (one by one) in the
buffer and save it to the other files.
Note:
1. 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.
2. When accessing one data by this API, the acquired data numbers will reduce 1 automatically.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID

Aquire the recording data of the specified axis.


Please note that this API will return 8 data at a time so it
Data U32* Data requires sufficient space for storage (Data[8]).
If _ECAT_Slave_Record_Data_Set_Type is not executed,
this API will return 0.

 Example
U16 Status = 0;
U16 CardNo=16 , NodeID =1, SlotNo=0;
U16 MonitorIndex =0;
U16 IOType =0, Index=0x607A, SubIndex=1;
U16 Enable =0x07;
U16 Cnt ;
U32 Data[8];

Status= _ECAT_Slave_Record_Set_Type (CardNo, NodeID, SlotNo, MonitorIndex,


IOType, Index, SubIndex);
Status= _ECAT_Slave_Record_Set_Enable (CardNo, NodeID, SlotNo, Enable);

while (1)
{
Status= _ECAT_Slave_Record_Get_Cnt (CardNo, NodeID, SlotNo, &Cnt);
if (Cnt>0)
{

25-6 March, 2017


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
25
 Syntax
U16 PASCAL _ECAT_Slave_Record_Clear_Data (U16 CardNo, U16 NodeID, U16 SlotNo)

 Purpose
Delete the saved record of the specified axis.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID

 Example
U16 Status = 0;
U16 CardNo=16 , NodeID=1, SlotNo=0;

// Clear the saved data of the specified axis


Status= _ECAT_Slave_Record_Clear_Data (CardNo, NodeID, SlotNo);

March, 2017 25-7


Auto Recording Function of Motion Axis EtherCAT Programming Guide

25.6 _ECAT_Slave_Record_Multi_Set_Enable
 Syntax

25
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 specified multiple axes.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
NodeNum U16 Quantilty Quantity of nodes
Set the Node ID array for recording function of
multiple axes, which quantity is indentical to
AxisNum.
NodeIDArray U16* Node array
NodeIDArray [0] is for specifying the 1st node to be
used.
NodeIDArray [1] is for specifying the 2nd node to be
used and so on.
Data array of slot ID, which quantity is identical to
SlotIDArray U16* Slot array
AxisNum.
This value will refer to the bit setting and determine
Enable U16 Value whether to enable/disable the recording function for
the 8 groups of OD data.

 Example
U16 Status = 0;
U16 CardNo=16 , NodeNum = 2, NodeID[2]={0, 1}, SlotNo[2]={0, 0};
// Enable the recording function of group number 1 ~ 3 of Node ID 1. Disable the recordind
function of group number 4 ~ 8.
U16 Enable =0x07;

// Enable the recoding function of multiple axes.


Status= _ECAT_Slave_Record_Multi_Set_Enable (CardNo, NodeNum, NodeIDArray,
SlotIDArray, Enable);

25-8 March, 2017


EtherCAT Programming Guide Auto Recording Function of Motion Axis

25.7 _ECAT_Slave_Record_Multi_Clear_Data
 Syntax

25
U16 PASCAL _ECAT_Slave_Record_Multi_Clear_Data (U16 CardNo, U16 NodeNum, U16
*NodeIDArray, U16 *SlotIDArray)

 Purpose
Delete the saved record of specified multiple axes.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
NodeNum U16 Quantity Quantity of nodes
Set the Node ID array for recording function of
multiple axes, which quantity is indentical to
AxisNum.
NodeIDArray U16* Node array
NodeIDArray [0] is for specifying the 1st node to be
used.
NodeIDArray [1] is for specifying the 2nd node to be
used and so on.
Data array of slot ID, which quantity is identical to
SlotIDArray U16* Slot array
AxisNum.

 Example
U16 Status = 0;
U16 CardNo=16 , NodeNum = 2, NodeIDArray[2] = {0, 1}, SlotIDArray[2] = {0, 0};
// Clear recording data of multiple axes.
Status= _ECAT_Slave_Record_Multi_Clear_Data (CardNo, NodeNum, NodeIDArray,
SlotIDArray);

March, 2017 25-9


Auto Recording Function of Motion Axis EtherCAT Programming Guide

(This page is intentionally left blank.)

25

25-10 March, 2017


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 ································································· 26-5

March, 2017 26-1


Operation of Local Digital I/O EtherCAT Programming Guide

API List of operating local digital I/O


API Description

_ECAT_GPIO_Set_Output Control the output status of the GPIO on the motion card

26 _ECAT_GPIO_Get_Output

_ECAT_GPIO_Get_Input
Read the output status of the GPIO on the motion card

Read the input status of the GPIO on the motion card

26-2 March, 2017


EtherCAT Programming Guide Operation of Local Digital I/O

26.1 _ECAT_GPIO_Set_Output
 Syntax

26
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).

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
Data U16 Value The output value of GPIO

 Example
U16 Status = 0;
U16 CardNo, Data;

CardNo = 0;
Data = 0xF;
Status= _ECAT_GPIO_Set_Output( CardNo, Data );

March, 2017 26-3


Operation of Local Digital I/O EtherCAT Programming Guide

26.2 _ECAT_GPIO_Get_Output
 Syntax

26
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).

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
Data U16* Value The output status of GPIO

 Example
U16 Status = 0;
U16 CardNo, Data;

CardNo = 0;
Status= _ECAT_GPIO_Get_Output( CardNo, &Data );

26-4 March, 2017


EtherCAT Programming Guide Operation of Local Digital I/O

26.3 _ECAT_GPIO_Get_Input
 Syntax

26
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).

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
Data U16* Value The input status of GPIO

 Example
U16 Status = 0;
U16 CardNo, Data;

CardNo = 0;
Status= _ECAT_GPIO_Get_Input( CardNo, &Data );

March, 2017 26-5


Operation of Local Digital I/O EtherCAT Programming Guide

(This page is intentionally left blank.)

26

26-6 March, 2017


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.

27.1 _ECAT_Compare_Set_Channel_Position············································ 27-4


27.2 _ECAT_Compare_Get_Channel_Position ··········································· 27-5
27.3 _ECAT_Compare_Set_Ipulser_Mode ················································· 27-6
27.4 _ECAT_Compare_Set_Channel_Direction ·········································· 27-7
27.5 _ECAT_Compare_Set_Channel_Trigger_Time ····································· 27-8
27.6 _ECAT_Compare_Set_Channel_One_Shot ········································· 27-9
27.7 _ECAT_Compare_Set_Channel_Source ············································ 27-10
27.8 _ECAT_Compare_Set_Channel_Enable ············································ 27-11
27.9 _ECAT_Compare_Channel0_Position ··············································· 27-12
27.10 _ECAT_Compare_Set_Channel0_Trigger _By_GPIO ···························· 27-13
27.11 _ECAT_Compare_Set_Channel1_Output_Enable ································ 27-14
27.12 _ECAT_Compare_Set_Channel1_Output_Mode ·································· 27-15
27.13 _ECAT_Compare_Get_Channel1_IO_Status ······································ 27-17
27.14 _ECAT_Compare_Set_Channel1_GPIO_Out ······································ 27-18
27.15 _ECAT_Compare_Set_Channel1_Position_Table ································· 27-19
27.16 _ECAT_Compare_Set_Channel1_Position _Table_Level ······················· 27-21
27.17 _ECAT_Compare_Get_Channel1_Position _Table_Count ······················ 27-24
27.18 _ECAT_Compare_Set_Channel_Polarity ············································ 27-25
27.19 _ECAT_Compare_Reuse_Channel1_Position _Table ···························· 27-26
27.20 _ECAT_Compare_Reuse_Channel1_Position _Table_Level ··················· 27-27

March, 2017 27-1


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.

27 The motion card has two high speed pulse input channels. There are two ways to trigger the
camera function, externally or internally trigger (from the PC). Delta provides two sets of
differential signal output points on one side of the motion card as well as the other side that is
inserted in the PC. The channel of both internal and external output points will be triggered
simultaneously when condition is fulfilled.
The high speed pulse compare function has two types, which is determined by two channels for
outputting differential signals. The channel 0 of differential singal (PIN11 &12 of CN2 and CN9),
hereafter simplified as channel 0, is for pulse comparing that is performed at fixed intervals. The
channel 1 of differential singal (PIN13 &14 of CN2 and CN11), simplified as channel 1, is for
pulse comparing that is performed at user-defined intervals and its trigger position is
user-defined. The two sets of differential signals can share both channel 0 and 1.

27-2 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

API list of high speed pulse compare function


API Description
Overwrite a position value for the specified
_ECAT_Compare_Set_Channel_Position
channel

_ECAT_Compare_Get_Channel_Position

_ECAT_Compare_Set_Ipulser_Mode
Acquire the current position value of the
specified channel
Set the mode of pulse input for the specified
channel
27
_ECAT_Compare_Set_Channel_Direction Set the pulse direction of the specified channel
Set the trigger retaining time for the specified
_ECAT_Compare_Set_Channel_Trigger_Time
channel
Force the trigger manually once for the
_ECAT_Compare_Set_Channel_One_Shot
specified channel
Set the compare source for the specified
_ECAT_Compare_Set_Channel_Source
channel
Enable/disable the compare function for the
_ECAT_Compare_Set_Channel_Enable
specified channel
Set the parameters for triggering the signal at a
_ECAT_Compare_Channel0_Position
fixed pulse interval of channel 0

Set the parameters for triggering the signal at a


_ECAT_Compare_Set_Channel0_Trigger_By_GPIO fixed pulse interval of channel 0, which is
enabled / disabled by GPIO

Enable/Disable the trigger function of channel 1


_ECAT_Compare_Set_Channel1_Output_Enable
(user-defined pulse intervals)
_ECAT_Compare_Set_Channel1_Output_Mode Set the output mode of channel 1
_ECAT_Compare_Get_Channel1_IO_Status Acquire the operation status of channel 1
Set the output status of the PIN15 on CN2 of
_ECAT_Compare_Set_Channel1_GPIO_Out
GPIO
Set the pulse data of channel 1 (user-defined
_ECAT_Compare_Set_Channel1_Position_Table
pulse intervals).
Set the pulse data of channel 1 and its
_ECAT_Compare_Set_Channel1_Position_Table_Level user-defined active level for triggering signals

_ECAT_Compare_Get_Channel1_Position_Table_Count Acquire the current trigger counts of channel 1

_ECAT_Compare_Set_Channel_Polarity Set the trigger level of the compare function


Re-execute the compare function of channel 1
_ECAT_Compare_Reuse_Channel1_Position_Table once

_ECAT_Compare_Reuse_Channel1_Position_Table Re-execute the compare function of channel 1


once, which the trigger level is user-defined.
L l

March, 2017 27-3


High Speed Pulse Compare Function EtherCAT Programming Guide

27.1 _ECAT_Compare_Set_Channel_Position
 Syntax

27
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 U16 Number Card No.
Compare_Channel U16 Number Channel No., which range is 0 ~ 1.
The new position value to be set for the specified
Position I32 Pulse
channel

 Example
U16 CardNo = 0;
U16 Compare_Channel = 0;
I32 position = 0;

U16 status = _ECAT_Compare_Set_Channel_Position (CardNo, compare_channel, position);

27-4 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

27.2 _ECAT_Compare_Get_Channel_Position
 Syntax

27
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
CardNo U16 Number Card No.
Compare_Channel U16 Number Channel No., which range is 0 ~ 1.
Acquire the current position value of the specified
Position I32* Pulse
channel.

 Example
U16 CardNo = 0;
U16 Compare_channel = 0;
I32 position;

U16 status = _ECAT_Compare_Get_Channel_Position (CardNo, compare_channel,


&position);

March, 2017 27-5


High Speed Pulse Compare Function EtherCAT Programming Guide

27.3 _ECAT_Compare_Set_Ipulser_Mode
 Syntax

27
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.

0: AB Phase
Mode U16 Option
1: CW/CCW

 Example
U16 CardNo = 0;
U16 mode = 0; //AB Phase

U16 status = _ECAT _Compare_Set _Ipulser_Mode (CardNo, mode);

27-6 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

27.4 _ECAT_Compare_Set_Channel_Direction
 Syntax

27
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
Compare_channel U16 Number Channel No., which range is 0 ~ 1.
0: Forward
Dir U16 Option
1: Inverse

 Example
U16 CardNo = 0;
U16 compare_channel = 0;
U16 dir = 1; //Inverse

U16 status = _ECAT_Compare_Set _Channel_Direction (CardNo, compare_channel, dir);

March, 2017 27-7


High Speed Pulse Compare Function EtherCAT Programming Guide

27.5 _ECAT_Compare_Set_Channel_Trigger_Time
 Syntax

27
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:
1. 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.
2. When carrying out compare function with channel 1, the minimum trigger time is 3 us. If the input value
is less than 3, it displays 3 us.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
Compare_channel U16 Number Channel No., which range is 0 ~ 1.
Input the retaining time for each trigger. (Unit: 0.001
Time_us U32 Time
us)

 Example
U16 CardNo = 0;
U16 compare_channel = 0;
U16 time_us = 20; //20us

U16 status = _ECAT_Compare_Set _Channel_Trigger_Time(CardNo, compare_channel,


time_us);

27-8 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

27.6 _ECAT_Compare_Set_Channel_One_Shot
 Syntax

27
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
CardNo U16 Number Card No.
Compare_channel U16 Number Channel No., which range is 0 ~ 1.

 Example
U16 CardNo = 0;
U16 compare_channel=0;

U16 status = _ECAT_Compare_Set _Channel_One_Shot (CardNo, compare_channel);

March, 2017 27-9


High Speed Pulse Compare Function EtherCAT Programming Guide

27.7 _ECAT_Compare_Set_Channel_Source
 Syntax

27
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 U16 Number Card No.
Compare_channel U16 Number Channel No., which range is 0 ~ 1.
0: QA1 and QB1 on CN2 connector
Source U16 Option
1: QA2 and QB2 on CN2 connector

 Example
U16 CardNo = 0;
U16 compare_channel = 0;
U16 source = 0;

U16 status = _ECAT_Compare_Set _Channel_source (CardNo, compare_channel, source);

27-10 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

27.8 _ECAT_Compare_Set_Channel_Enable
 Syntax

27
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:
1. Channel 0 can only be enabled/disabled with this API.
2. Apart from this API, channel 1 needs to be enabled/disabled with API
“_ECAT_Compare_Set_Channel1_Output_Enable”. Otherwise, this channel will not be triggered even
when the pulse is matched.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
Compare_channel U16 Number Channel No., which range is 0 ~ 1.
0: Disable the compare function.
enable U16 Option
1: Enable the compare function.

 Example
U16 CardNo = 0, ;
U16 compare_channel = 0;
U16 enable = 1;//Enable the high-speed compare function.

U16 status = _ECAT_Compare_Set Channel_Enable (CardNo, compare_channel, enable);

March, 2017 27-11


High Speed Pulse Compare Function EtherCAT Programming Guide

27.9 _ECAT_Compare_Channel0_Position
 Syntax

27
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.
Note:
1. For the trigger retaining time, please refer to description of API
“_ECAT_Compare_Set_Channel_Trigger_Time”.
2. Output signal of channel 0 is triggered via PIN11 and PIN12 of CN2 and CN9 connector on motion card
PCI-L221-B1. These two sets of points will both be triggered when pulses are matched.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
Start I32 Pulse Start position of the compare.
Direction
Dir U16 Option 0: forward
1: backward
Interval U16 Pulse number Pulse interval for carrying out the compare.
Trigger_cnt U32 Amount Triggering count of the compare function.

 Example
U16 CardNo = 0;
I32 start = 100000;
U16 dir = 0;
U16 Interval = 10; //10 pulse
U32 trigger_cnt = 50000;

U16 status=_ECAT_Compare_Channel0_Position(CardNo, start, dir, interval, trigger_cnt);


/* The motion card starts comparing pulses from position 100000 and channel 0 will be triggered
once every 10 pulses with total trigger count 50000. */
/* That is, when it is at position 100010, 100020, 100030, …, 600000 (pulse), channel 0 will be
triggered once.*/

 Description
The motion card starts comparing pulses from the start position and trigger a differential signal
based on the set pulse interval (every time a given pulse number is reached). Meanwhile, the
motion card carries on comparing the pulses for the next fixed interval to trigger the differential
signal of channel 0. Then, it stops comparing pulses when the total trigger count is reached.

27-12 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

27.10 _ECAT_Compare_Set_Channel0_Trigger _By_GPIO


 Syntax

27
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
is triggered via PIN10 of CN2 connector (GPIO, general-purpose input/output)
Note:
1. Before GPIO is enabled, please make sure channel 0 is enabled by API
“_ECAT_Compare_Set_Channel_Enable”.
2. About the triggering retaining time, please refer to section 27.5
“_ECAT_Compare_Set_Channel_Trigger_Time”.
3. Output signal of channel 0 is triggered via PIN11 and PIN12 of CN2 and CN9 connector on motion card
PCI-L221-B1. These two sets of points will both be triggered when pulses are matched.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
0: forward
Dir U16 Numeric value 1: backward
Interval U16 Option Pulse number of each interval

Trigger _cnt I32 Pulse number Pulse interval for carrying out the compare.

 Example
U16 CardNo = 0;
U16 Dir = 1;
U16 Interval = 10;
I32 trigger_cnt = 50000;

U16 status = _ECAT_Compare_Set_Channel0_Trigger_By_GPIO (CardNo, Dir, Interval,


trigger_cnt);
/* The motion card starts comparing pulses from position 100000 and channel 0 will be triggered
once every 10 pulses with total trigger count 50000. */
/* That is, when the pulse is 100010, 100020, 100030, …, 600000, channel 0 will be triggered
once.*/

 Description
The comparing method is the same as that described in Chaper 27.9
“_ECAT_Compare_Channel0_Position”. However, to enable this compare function, the GPIO
(PIN 10 of CN2) has to be set to on.

March, 2017 27-13


High Speed Pulse Compare Function EtherCAT Programming Guide

27.11 _ECAT_Compare_Set_Channel1_Output_Enable
 Syntax

27
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:
1. Before GPIO is enabled, please make sure channel 0 is enabled by API
“_ECAT_Compare_Set_Channel_Enable”.
2. About the triggering retaining time, please refer to section 27.5
“_ECAT_Compare_Set_Channel_Trigger_Time”.
3. Output signal of channel 1 is triggered via PIN13 and PIN14 of CN2 and CN11 connector on motion
card PCI-L221-B1. These two sets of points will both be triggered when pulses are matched.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
0: Off
On_off U16 Option
1: On

 Example
U16 CardNo = 0;
U16 on_off = 1;

U16 status = _ECAT_Compare_Set_Channel1_Output_Enable (CardNo, on_off);

 Description
The motion card will start comparing the current pulse and the array of pulse position set by API
“_ECAT_Compare_Set_Channel1_Position_Table”, and trigger output signal of channel 1 if the
pulses are matched.

27-14 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

27.12 _ECAT_Compare_Set_Channel1_Output_Mode
 Syntax

27
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.
Note: Output signal of channel 1 is triggered via PIN13 and PIN14 of CN2 or CN11 connector on motion

card PCI-L221-B1. These two sets of points will both be triggered when pulses are matched.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
0: Output mode of user-defined pulse intervals
Mode U16 Option 1: Output mode of user-defined intervals and trigger
level

 Example
U16 CardNo = 0;
U16 mode = 1;
U16 status = _ECAT_Compare_Set_Channel1_Output_Mode (CardNo, mode);

 Description
The two output modes of channel 1 will be illustrated as follows.
1. Output mode of user-defined pulse interval. User can define the position for performing the
compare function.

Figure 27.12.1 Output mode of user-defined pulse interval

March, 2017 27-15


High Speed Pulse Compare Function EtherCAT Programming Guide

Note:
1. The trigger-on position is set by “Pos_table” of the API
“_ECAT_Compare_Set_Channel1_Position_Table”.
2. For the trigge retaining time, please refer to section 27.5 API
“_ECAT_Compare_Set_Channel_Trigger_Time”.

27 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.
Meanwhile, you can also set the trigger level (high / low). See the figure below.

Figure 27.12.2 Output mode of user-defined intervals and trigger level

Note:
1. The trigger position is set by “level_table” of the API
“_ECAT_Compare_Set_Channel1_Position_Table_Level”.
2. The trigger retaining time is not influenced by API setting of
“_ECAT_Compare_Set_Channel_Trigger_Time”. Instead, the trigger time is the time for reaching the
next position. (Ex: the time it takes from position 1000 to 2000.)

27-16 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

27.13 _ECAT_Compare_Get_Channel1_IO_Status
 Syntax

27
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 U16 Number Card No.

The operation status of channel 1.


Bit0: Status of PIN 10 on CN2 (GPIO IN);
Numeric Bit1: The power supply (hardware) status
Io_status U16* 1: 5V
value 0: 0V (IC error)
Bit2: Whether the function of user-defined trigger level is used.
(_ECAT_Compare_Set_Channel1_Position_Table_Level)

 Example
U16 CardNo = 0;
U16 io_status;

U16 status = _ECAT_Compare_Get_Channel1_IO_Status (CardNo,& io_status);

March, 2017 27-17


High Speed Pulse Compare Function EtherCAT Programming Guide

27.14 _ECAT_Compare_Set_Channel1_GPIO_Out
 Syntax

27
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
CardNo U16 Number Card No.
0: Off
On_off U16 Option
1: On

 Example
U16 CardNo = 0;
U16 on_off = 1;

U16 status = _ECAT_Compare_Set_Channel1_GPIO_Out (CardNo, on_off);

27-18 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

27.15 _ECAT_Compare_Set_Channel1_Position_Table
 Syntax

27
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.
Note:
1. For the trigger retaining time, please refer to description of API
“_ECAT_Compare_Set_Channel_Trigger_Time”.
2. Output signal of channel 1 is triggered via PIN13 and PIN14 of CN2 or CN11 connector on motion card
PCI-L221-B1. These two signals will both be triggered when pulses are matched.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.

The position for comparing pulses at user-defined


Pos_table I32* Data array
intervals.
Data size to be compared, which value has to be
Table_size U32 Number identical to the array size of Pos_table. The max. is
100000.

 Example
U16 CardNo = 0;
I32 pos_table[4] = {1000,2000,3000,4000};
U32 table_size =4;

U16 status = _ECAT_Compare_Set_Channel1_Position_Table (CardNo, pos_table,


table_size);

March, 2017 27-19


High Speed Pulse Compare Function EtherCAT Programming Guide

 Output mode of user-defined pulse interval. User can define the position for
performing compare function.

27
Figure 27.12.3 Output mode of user-defined pulse interval

Note:
1. The trigger-on position is set by “Pos_table” of the API
“_ECAT_Compare_Set_Channel1_Position_Table”.
2. For the trigger retaining time, please refer to description of API
“_ECAT_Compare_Set_Channel_Trigger_Time”.

27-20 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

27.16 _ECAT_Compare_Set_Channel1_Position_Table_Level
 Syntax

27
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.
data entry is 100000.
Note:
1. For the trigger retaining time, please refer to description of API
“_ECAT_Compare_Set_Channel_Trigger_Time”.
2. Output signal of channel 1 is triggered via PIN13 and PIN14 of CN2 or CN11 connector on motion card
PCI-L221-B1. These two signals will both be triggered when pulses are matched.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
The position for comparing pulses at user-defined
Pos_table I32* Data array
intervals.
The active level for triggering signals;
Level_table U32* Data array Translate the trigger state at the 32 positions into a 32-bit
value.
Data size to be compared, which value has to be identical
Table_size U32 Number
to the array size of Pos_table. The max. is 100000.

 Example
U16 CardNo = 0;
I32 pos_table[16] ={1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 11000,
12000, 13000, 14000, 15000, 16000};
U32 level_table[16] ={0x1111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
// Hexadecimal value, 0x00001111 = Binary array, [0000 0000 0000 0000 0001 0001 0001 0001]
B
// Refer to the pulse array with the setting of pos_table, a signal will be triggered at 1000, 5000,
9000, and 13000 (pulse).

U32 table_size =16;


U16 status =_ECAT_Compare_Set_Channel1_Position_Table_Level (CardNo, pos_table,
level_table,table_size);

March, 2017 27-21


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

27 in the following section.

 Output mode of user-defined intervals and trigger level

In this mode, users can define the position (pulse) for the trigger, which is the same as mode 0.
Meanwhile, you can also set the trigger level (high / low). See the figure below.

Figure 27.12.4 Output mode of user-defined intervals and trigger level (Correct)

Note:
1. The trigger-on position is set by “Pos_table” of the API
“_ECAT_Compare_Set_Channel1_Position_Table”.

The position array of pulse is as follows:


I32 pos_table[16] ={1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 11000,
12000, 13000, 14000, 15000, 16000};
As the pulse number to be compared is less than 32, only level_table[0] in level_table is required
for triggering the signal as shown in figure 27.12.4.
U32 level_table[16] ={0x1111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
// Hexadecimal value, 0x00001111 = binary array, [0000 0000 0000 0000 0001 0001 0001 0001]
B
// Refer to the pulse array with setting of pos_table, a signal will be triggered only at position 1000,
5000, 9000, and 13000 (pulse).

27-22 March, 2017


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:


27

Figure 27.12.4 Output mode of user-defined intervals and trigger level (Incorrect)

2. The trigger retaining time is not influenced by setting of API


“_ECAT_Compare_Set_Channel_Trigger_Time. Instead, the trigger time is the time for
reaching the next position. (Ex: the time it takes from position 1000 to 2000.)

March, 2017 27-23


High Speed Pulse Compare Function EtherCAT Programming Guide

27.17 _ECAT_Compare_Get_Channel1_Position _Table_Count


 Syntax

27
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 U16 Number Card No.
Cnt U32* Numeric value Acquire the trigger counts of channel 1.

 Example

U16 CardNo = 0;
U32 cnt;

U16 status = _ECAT_Compare_Get_Channel1_Position_Table_Count (CardNo,& cnt);

27-24 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

27.18 _ECAT_Compare_Set_Channel_Polarity
 Syntax

27
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 U16 Number Card No.
0: High
Inverse U16 Option
1: Low

 Example

U16 CardNo = 0;
U16 inverse = 1;

U16 status = _ECAT_Compare_Set_Channel_Polarity (CardNo, inverse);

March, 2017 27-25


High Speed Pulse Compare Function EtherCAT Programming Guide

27.19 _ECAT_Compare_Reuse_Channel1_Position_Table
 Syntax

27
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


CardNo U16 Number Card No.

 Example

U16 CardNo = 0;

U16 status = _ECAT_Compare_Reuse_Channel1_Position_Table (CardNo);

27-26 March, 2017


EtherCAT Programming Guide High Speed Pulse Compare Function

27.20 _ECAT_Compare_Reuse_Channel1_Position
_Table_Level

27
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

Name Data type Property Description


CardNo U16 Number Card No.

 Example

U16 CardNo = 0;

U16 status = _ECAT_Compare_Reuse_Channel1_Position_Table_Level (CardNo);

March, 2017 27-27


High Speed Pulse Compare Function EtherCAT Programming Guide

(This page is intentionally left blank.)

27

27-28 March, 2017


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 ··········································· 28-5

MArch, 2017 28-1


Information of EtherCAT Dynamic-link Library (DDL) EtherCAT Programming Guide

API list of DDL information


API Description

_ECAT_Master_Get_DLL_Path Acquire the directory of the EtherCat_DLL.dll file

28 _ECAT_Master_Get_DLL_Version

_ECAT_Master_Get_DLL_Path_Single
Acquire the version information of the EtherCat_DLL.dll file
Acquire the directory of the ECAT_RTX_DLL.dll or
PCI_L221.dll file
Acquire the version information of the ECAT_RTX_DLL.dll
_ECAT_Master_Get_DLL_Version_Single
or PCI_L221.dll file

28.1 _ECAT_Master_Get_DLL_Path
 Syntax
U16 PASCAL _ECAT_Master_Get_DLL_Path(I8 *lpFilePath, U32 nSize, U32 *nLength)

 Purpose
Acquire the directory of the EtherCat_DLL.dll file.

 Parameter
Name Data type Property Description
lpFilePath I8* String Directory of the EtherCat_DLL.dll file
nSize U32 Value The string length to be read
nLength U32* Value The string length of the directory

 Example
U16 Status = 0;
I8 FilePath[128];
U32 nSize=128, nLength=0;
Status= _ECAT_Master_Get_DLL_Path(FilePath, nSize, &nLength);

28-2 March, 2017


EtherCAT Programming Guide Information of EtherCAT Dynamic-link Library (DDL)

28.2 _ECAT_Master_Get_DLL_Version
 Syntax

28
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 I8* String Version of the EtherCat_DLL.dll file.
nSize U32 Value The string length to be read
nLength U32* Value The string length of the version information

 Example
U16 Status = 0;
I8 Version[128];
U32 nSize=128, nLength=0;
Status= _ECAT_Master_Get_DLL_Version(Version, nSize, &nLength);

March, 2017 28-3


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 (U16 CardNo, I8 *lpFilePath, U32 nSize,

28 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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
Directory of the ECAT_RTX_DLL.dll or PCI_L221.dll
lpFilePath I8* String
file.
nSize U32 Value The string length to be read
nLength U32* Value The string length of the directory

 Example
U16 Status = 0, CardNo=16;
I8 FilePath[128];
U32 nSize=128, nLength=0;

Status= _ECAT_Master_Get_DLL_Path_Single(CardNo, FilePath, nSize, &nLength);

28-4 March, 2017


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)
28
 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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
Version of the ECAT_RTX_DLL.dll or PCI_L221.dll
lpBuf I8* String
file.
nSize U32 Value The string length to be read
nLength U32* Value The string length of the version information

 Example
U16 Status = 0, CardNo=16;
I8 Version[128];
U32 nSize=128, nLength=0;
Status= _ECAT_Master_Get_DLL_Version_Single(CardNo, Version, nSize, &nLength);

March, 2017 28-5


Information of EtherCAT Dynamic-link Library (DDL) EtherCAT Programming Guide

(This page is intentionally left blank.)

28

28-6 March, 2017


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 ······················································ 29-5
29.4 _ECAT_Security_Get_Write_Verifykey_State ······································· 29-6
29.5 _ECAT_Security_Check_UserPassword ············································· 29-7
29.6 _ECAT_Security_Get_Check_UserPassword _State ····························· 29-8
29.7 _ECAT_Security_Write_UserPassword··············································· 29-9
29.8 _ECAT_Security_Get_Write_UserPassword_State······························· 29-10

March, 2017 29-1


Security of Software Protection EtherCAT Programming Guide

API list of software protection


API Description
_ECAT_Security_Check_Verifykey Check the verification key

29 _ECAT_Security_Get_Check_Verifykey_State

_ECAT_Security_Write_Verifykey

_ECAT_Security_Get_Write_Verifykey_State
Check the verification status of the verification key

Write the verification key into the verification IC


Obtain the status and result of writing in the
verification key
_ECAT_Security_Check_UserPassword Check the user password

_ECAT_Security_Get_Check_UserPassword_State Acquire the status of verifying the user password

_ECAT_Security_Write_UserPassword Write in the user password into the verification IC


Acquire the status and result of writing in the user
_ECAT_Security_Get_Write_UserPassword_State
password

29-2 March, 2017


EtherCAT Programming Guide Security of Software Protection

29.1 _ECAT_Security_Check_Verifykey
 Syntax

29
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. It is suggested to change the verification key and
user password together.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
Verifykey U32* Data Input an 8-character verification key.

 Example
U16 Status = 0;
U16 CardNo;
U32 Key[8] = {0, 0, 0, 0, 0, 0, 0, 0}

CardNo = 0;
Status= _ECAT_Security_Check_Verifykey ( CardNo, Key );

March, 2017 29-3


Security of Software Protection EtherCAT Programming Guide

29.2 _ECAT_Security_Get_Check_Verifykey_State
 Syntax

29
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.

Return code:

0: Verification sussesful.

1: Verification failed.
State U16* Status
2: Verification in process.

3: _ECAT_Security_Check_Verifykey is not executed.

4: Processing error of
_ECAT_Security_Check_Verifykey

 Example
U16 Status = 0;
U16 CardNo = 0, State = 0;
U32 Key[8] = {0, 0, 0, 0, 0, 0, 0, 0};
// Check the verification key
Status= _ECAT_Security_Check_Verifykey ( CardNo, Key );
// Wait for the result
While (1)
{
Status= _ECAT_Security_Get_Check_Verifykey_State ( CardNo, &State );
if (State != 2)
{
// Verification check is done. User can check the result from the return code.
break;
}
}

29-4 March, 2017


EtherCAT Programming Guide Security of Software Protection

29.3 _ECAT_Security_Write_Verifykey
 Syntax

29
U16 PASCAL _ECAT_Security_Write_Verifykey (U16 CardNo, U32 *Verifykey )

 Purpose
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
Verifykey U32* Data array Input an 8-character verification key

 Example
U16 Status = 0;
U16 CardNo;
U32 Verifykey[8] = {0, 1, 2, 3, 4, 5, 6, 7};

CardNo = 0;
Status= _ECAT_Security_Write_Verifykey ( CardNo, Verifykey);

March, 2017 29-5


Security of Software Protection EtherCAT Programming Guide

29.4 _ECAT_Security_Get_Write_Verifykey_State
 Syntax

29
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.

Return code:

0: Write in verification sussesful.

1: Write in verification failed.


State U16* Status
2: Write in verification in progress.

3: _ECAT_Security_Write_Verifykey is not executed.

4: Processing error of
_ECAT_Security_Write_Verifykey

 Example
U16 Status = 0;
U16 CardNo = 0, State = 0;
U32 Verifykey[8] = {0, 1, 2, 3, 4, 5, 6, 7};
// Wrtie in new verification key.
Status= _ECAT_Security_Write_Verifykey ( CardNo, Verifykey);
// Wait unitl the write-in process is complete.
While (1)
{
Status= _ECAT_Security_Get_Write_Verifykey_State( CardNo, &State );
if (State != 2)
{
// Write-in process is complete. Users can check the result from the return code.
break;
}
}

29-6 March, 2017


EtherCAT Programming Guide Security of Software Protection

29.5 _ECAT_Security_Check_UserPassword
 Syntax

29
U16 PASCAL _ECAT_Security_Check_UserPassword (U16 CardNo, U32 *UserPassword)

 Purpose
Check the user password.
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
Name Data type Property Description
CardNo U16 Number Card No.
UserPassword U32* Data array Input an 8-character User password.

 Example
U16 Status = 0;
U16 CardNo = 0;
U32 UserPassword[8] = {0, 0, 0, 0, 0, 0, 0, 0};

Status= _ECAT_Security_Check_UserPassword ( CardNo, UserPassword);

March, 2017 29-7


Security of Software Protection EtherCAT Programming Guide

29.6 _ECAT_Security_Get_Check_UserPassword _State


 Syntax

29
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.

Return code:

0: Password check is done. User password is valid.

1: Verification failed. User password is invalid.


State U16* Status 2: Verification in progress.

3: Please execute
_ECAT_Security_Check_UserPassword.
4: Processing error of
_ECAT_Security_Check_UserPassword

 Example
U16 Status = 0;
U16 CardNo = 0, State = 0;
U32 UserPassword [8] = {0, 0, 0, 0, 0, 0, 0, 0};
// Check the user password.
Status= _ECAT_Security_Check_UserPassword( CardNo, UserPassword);
// Wait for the result.
While (1)
{
Status= _ECAT_Security_Get_Check_UserPassword_State ( CardNo, &State );
if (State != 2)
{
// Verification is done. Users can check the result from the return code.
break;
}
}

29-8 March, 2017


EtherCAT Programming Guide Security of Software Protection

29.7 _ECAT_Security_Write_UserPassword
 Syntax

29
U16 PASCAL _ECAT_Security_Write_UserPassword (U16 CardNo, U32 *UserPassword)

 Purpose
Write in the user password into the verification IC.
Note:
1. 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.
2. The new password will be valid immediately. Users will need to use API
“_ECAT_Security_Check_UserPassword” (section 29.5) to log in again to use other APIs in this
chapter. Once the password is changed, please do remember the new password as Delta can no
longer access this verification IC anymore.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.
UserPassword U32* Data array Input an 8-character User password.

 Example
U16 Status = 0;
U16 CardNo;
U32 UserPassword [8] = {0, 1, 2, 3, 4, 5, 6, 7};

CardNo = 0;
Status= _ECAT_Security_Write_UserPassword(CardNo, UserPassword);

March, 2017 29-9


Security of Software Protection EtherCAT Programming Guide

29.8 _ECAT_Security_Get_Write_UserPassword_State
 Syntax

29
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card No.

Return code:

0: Verification sussesful.

1: Verification failed.
State U16* Status 2: Verification in progress.

3: _ECAT_Security_Write_UserPassword is not
executed.
4: Processing error of
_ECAT_Security_Write_UserPassword.

 Example
U16 Status = 0;
U16 CardNo = 0, State = 0;
U32 UserPassword [8] = {0, 1, 2, 3, 4, 5, 6, 7};
// Write in the new password.
Status= _ECAT_Security_Write_UserPassword( CardNo, UserPassword);
// Wait for the write-in process to be completed.
While (1)
{
Status= _ECAT_Security_Get_Write_UserPassword_State ( CardNo, &State );
if (State != 2)
{
// Password write-in is done. Users can check the result from the return code.
break;
}
}

29-10 March, 2017


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.

30.1 _ECAT_Master_MRAM_Write_Word_Data ········································· 30-2


30.2 _ECAT_Master_MRAM_Read_Word_Data ········································· 30-3
30.3 _ECAT_Master_MRAM_Write_DWord_Data ······································· 30-4
30.4 _ECAT_Master_MRAM_Read_DWord_Data ······································ 30-5

March, 2017 30-1


Operating MRAM on PAC EtherCAT Programming Guide

API list of MRAM in PAC


API Description
Write the U16 data (Word) to the specified address of
_ECAT_Master_MRAM_Write_Word_Data

30
MRAM in PAC.
Read the U16 data (Word) from the specified address
_ECAT_Master_MRAM_Read_Word_Data
of MRAM in PAC.
Write the U32 data (DWord) into the specified address
_ECAT_Master_MRAM_Write_DWord_Data
of MRAM in PAC.
Read the U32 data (DWord) from the specified address
_ECAT_Master_MRAM_Read_DWord_Data
of MRAM in PAC.

30.1 _ECAT_Master_MRAM_Write_Word_Data
 Syntax
U16 PASCAL _ECAT_Master_MRAM_Write_Word_Data(U16 CardNo, U32 Index, U32
DataNum, U16 *Data)

 Purpose
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. The index range is between 0 and 65535.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
Index U32 Value Range: 0 ~ 65535
DataNum U32 Quantity Data number to be written into the memory

Data U16* Data array Data array to be written into the memory

 Example
U16 Status = 0;
U16 CardNo = 16;
U16 data [3] = { 1, 2, 3};
// Write data to the last three data space of retentive memory.
U32 Index=65533, DataNum=3;

Status= _ECAT_Master_MRAM_Write_Word_Data(CardNo, Index, DataNum, &data);

30-2 March, 2017


EtherCAT Programming Guide Operating MRAM on PAC

30.2 _ECAT_Master_MRAM_Read_Word_Data
 Syntax

30
U16 PASCAL _ECAT_Master_MRAM_Read_Word_Data(U16 CardNo, U32 Index, U32
DataNum, U16 *Data)

 Purpose
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. The index range is between 0 and 65535.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
Index U32 Value Range: 0 ~ 65535
DataNum U32 Quantity Data number to be read from the memory

Data U16* Data array Data array to be read from the memory

 Example
U16 Status = 0;
U16 CardNo = 16;
U16 data [3] = {0};
// Read data from the last three data space of retentive memory.
U32 Index=65533, DataNum=3;

Status= _ECAT_Master_MRAM_Read_Word_Data(CardNo, Index, DataNum, data);

March, 2017 30-3


Operating MRAM on PAC EtherCAT Programming Guide

30.3 _ECAT_Master_MRAM_Write_DWord_Data
 Syntax

30
U16 PASCAL _ECAT_Master_MRAM_Write_DWord_Data(U16 CardNo, U32 Index, U32
DataNum, U32 *Data)

 Purpose
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. The memory will conflict with the index space, thus,
when the index value is odd, error will occur.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
Range: 0 ~ 65535
Index U32 Value
Odd numbers are not allowed.
DataNum U32 Quantity Data number to be written into the memory

Data U32* Data array Data array to be written into the memory

 Example
U16 Status = 0;
U16 CardNo = 16;
U32 data [3] = { 1, 2, 3};
// Write data to the last three data space of retentive memory.
U32 Index=65530, DataNum=3;

Status= _ECAT_Master_MRAM_Write_DWord_Data(CardNo, Index, DataNum, data);

30-4 March, 2017


EtherCAT Programming Guide Operating MRAM on PAC

30.4 _ECAT_Master_MRAM_Read_DWord_Data
 Syntax

30
U16 PASCAL _ECAT_Master_MRAM_Read_DWord_Data(U16 CardNo, U32 Index, U32
DataNum, U32 *Data)

 Purpose
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. The memory will conflict with the index space, thus,
when the index value is odd, error will occur.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
Range: 0 ~ 65535
Index U32 Value
Odd numbers are not allowed.
DataNum U32 Quantity Data number to be wrote into the memory

Data U32* Data array Data array to be wrote into the memory

 Example
U16 Status = 0;
U16 CardNo = 16;
U16 data [3] = {0};
// Read data from the last three data space of retentive memory.
U32 Index=65530, DataNum=3;

Status= _ECAT_Master_MRAM_Read_DWord_Data(CardNo, Index, DataNum, data);

March, 2017 30-5


Operating MRAM on PAC EtherCAT Programming Guide

(This page is intentionally left blank.)

30

30-6 March, 2017


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.

31.1 _ECAT_Slave_R1_EC70E2_Set_Output_Enable ·································· 31-2

March, 2017 31-1


Retentive Digital Output of the Module EtherCAT Programming Guide

API list of digital output retentive function (for R1-EC70E2D0 series)


API Description

_ECAT_Slave_R1_EC70E2_Set_Output_Enable Enable/Disable the digital output of the module.

31
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 U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID

0: Disable digital output


Eanble U16 Option
1: Enable digital output

 Example
U16 Status = 0;
U16 CardNo = 16, NodeID = 0, SlotNo = 0;
U16 Enable = 1; // Enable digital output of R1-EC70E2D0.

Status = _ECAT_Slave_R1_EC70E2_Set_Output_Enable ( CardNo, NodeID, SlotNo,


Enable );

31-2 March, 2017


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.

32.1 _ECAT_Slave_R1_EC70X2_Set_Output_Enable ·································· 32-2

March, 2017 32-1


Retentive Digital Output of the Module (70X2 Series) EtherCAT Programming Guide

API list of enabling digitial output (for R1-EC70X2D0 series)


API Description
_ECAT_Slave_R1_EC70X2_Set_Output_Enable Enable/Disable digital output of the module

32 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
CardNo U16 Number Card No.
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
0: Disable digital output
Eanble U16 Option
1: Enable digital output

 Example
U16 Status = 0;
U16 CardNo = 16, NodeID = 0, SlotNo = 0;
U16 Enable = 1; // Enable digital output of R1-EC70X2D0 series.

Status = _ECAT_Slave_R1_EC70X2_Set_Output_Enable ( CardNo, NodeID, SlotNo,


Enable );

32-2 March, 2017


MPG Operation
(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.

33.1 _ECAT_Slave_R1_EC5614_Set_MJ_Config········································ 33-3


33.2 _ECAT_Slave_R1_EC5614_Set_MJ_Enable ······································· 33-5
33.3 _ECAT_Slave_R1_EC5614_Get_IO_Status ········································ 33-6
33.4 _ECAT_Slave_R1_EC5614_Get_MPG_Counter ·································· 33-7

March, 2017 33-1


MPG Operation EtherCAT Programming Guide

API List of MPG operation (for R1-EC5614D0 series)


API Description
_ECAT_Slave_R1_EC5614_Set_MJ_Config Set the parameters of MPG function

33 _ECAT_Slave_R1_EC5614_Set_MJ_Enable

_ECAT_Slave_R1_EC5614_Get_IO_Status

_ECAT_Slave_R1_EC5614_Get_MPG_Counter
Enable/Disable the MPG function

Acquire the I/O contact status of the MPG module

Acquire the value of the MPG counter

33-2 March, 2017


EtherCAT Programming Guide MPG Operation

33.1 _ECAT_Slave_R1_EC5614_Set_MJ_Config
 Syntax

33
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number

Group number of MPG function. It supports


MJNo U16 Number
max. 8 groups, numbered from 0 to 7.
Setting of MPG mode :
0: JOG mode
MJType U16 Option
1: Apply MPG (x1)
2: Apply MPG (x4)
NodeID U16 Number Node ID

SlotNo U16 Number Slot ID


The axis number reqruied by MPG/JOG
AxisNum U16 Number
(MPG: max. 6 axes; JOG: max. 2 axes)
Data array of node number for the axis
AxisArray U16* Array of numbers
controlled by the MPG module.
Data array of slot number for the axis
SlotArray U16* Array of numbers
controlled by the MPG module.
Array of speed Data array of the max. speed for each axis.
MaxSpeedArray I32*
limit (Unit: pps)
Data array of the max. acceleration for each
Array of axis contolled by MPG module. (Unit:sec)
TaccArray F64*
acceleration time (The speed is set by parameter
MaxSpeedArray)
Array of output For MPG mode only. It sets the ratio of MPG’s
RatioArray F64*
ratio pulse output.

 Example
U16 Status = 0, CardNo = 16, NodeID = 0, SlotNo = 0, AxisNum = 2, MJNo = 2, MJType= 1;
U16 Enable = 1;
U16 AxisArray[2] = {1, 2};
U16 SlotArray[2] = {0, 0};
I32 MaxSpeedArray[2] = {100000, 200000};
F64 TaccArray[2] = {0.1, 0.1};
F64 RatioArray[2] = {1, 1};

// Setting relevant parameters is required.

March, 2017 33-3


MPG Operation EtherCAT Programming Guide

Status = _ECAT_Slave_R1_EC5614_Set_MJ_Config( CardNo, NodeID, SlotNo, MJNo,


MJType, AxisNum, AxisArray, SlotArray, MaxSpeedArray, TaccArray, RatioArray );

33 // 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


EtherCAT Programming Guide MPG Operation

33.2 _ECAT_Slave_R1_EC5614_Set_MJ_Enable
 Syntax

33
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.

 Parameter
Name Data type Property Description
CardNo U16 Number Card number
Group number of MPG function. It supports max. 8
MJNo U16 Number
groups, numbered from 0 to 7.

0: Disable MPG function


Enable U16 Option
1: Enable MPG function

 Example
U16 Status = 0, CardNo = 16, NodeID = 0, SlotNo = 0, AxisNum = 2, MJNo = 1, MJType= 1;
U16 Enable = 1;
U16 AxisArray[2] = {1, 2};
U16 SlotArray[2] = {0, 0};
I32 MaxSpeedArray[2] = {100000, 200000};
F64 TaccArray[2] = {0.1, 0.1};
F64 RatioArray[2] = {1, 1};

// Relevant parameters setting is required.


Status = _ECAT_Slave_R1_EC5614_Set_MJ_Config( CardNo, NodeID, SlotNo, MJNo,
MJType, AxisNum, AxisArray, SlotArray, MaxSpeedArray, TaccArray, RatioArray );

// It can be enabled after setting complete.


If(Status == 0)
Status = _ECAT_Slave_R1_EC5614_Set_MJ_Enable(CardNo, MJNo, Enable);

March, 2017 33-5


MPG Operation EtherCAT Programming Guide

33.3 _ECAT_Slave_R1_EC5614_Get_IO_Status
 Syntax

33
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
CardNo U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
IOStatus U16* Value DI/O status of MPG module

 Example
U16 Status = 0, CardNo = 16, NodeID = 0, SlotNo = 0;
U16 IOStatus = 0;

Status = _ECAT_Slave_R1_EC5614_Get_IO_Status (CardNo, NodeID, SlotNo, &IOStatus);

 Status description
Bit Definition Bit Definition

0 JY- 8 X-Axis is selected.

1 JY+ 9 Y-Axis is selected.

2 JX- 10 Z-Axis is selected.

3 JX+ 11 U-Axis is selected.

4 Scale: ×1 12 W-Axis is selected.

5 Scale: ×10 13 C-Axis is selected.

6 Scale: ×100 14 Reserved

7 Reserved 15 MPG Enabled

33-6 March, 2017


EtherCAT Programming Guide MPG Operation

33.4 _ECAT_Slave_R1_EC5614_Get_MPG_Counter
 Syntax

33
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 U16 Number Card number
NodeID U16 Number Node ID
SlotNo U16 Number Slot ID
Counter I32* Value Value of the MPG Counter (Unit: pulse)

 Example

U16 Status = 0, CardNo = 16, NodeID = 0, SlotNo = 0;


I32 Counter = 0;

Status = _ECAT_Slave_R1_EC5614_Get_MPG_Counter(CardNo, NodeID, SlotNo,


&Counter);

March, 2017 33-7


MPG Operation EtherCAT Programming Guide

(This page is intentionally left blank.)

33

33-8 March, 2017


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

March, 2017 34-1


Error Code Description EtherCAT Programming Guide

34.1 List of error code


When using the API of EtherCAT_Dll, the API function will return a value that shows the

34
execution result. Please refer to the following table for the description of those values. For
example, if the API function returns 0, it means the API is successfully executed. On the other
hand, a non-zero value is regarded as an error code. It means an error has occurred during
operation or hardware connection. Please troubleshoot the problem according to the description
below.

List of error code


Returned
value Name of the error code Description
(Decimal)
0 ERR_ECAT_NO_ERROR No error

1 ERR_ECAT_HW_NO_INITIALIZE Hardware has not been initialized.

2 ERR_ECAT_HW_PWM_INITIAL Fail to initialize the hardware.

3 ERR_ECAT_HW_HAS_INITIALIZED Hardware is initialized repeatedly.

16 ERR_ECAT_EEPROM_READ Fail to read the EEPROM of the module.

Fail to write the data to the EEPROM of the


17 ERR_ECAT_EEPROM_WRITE
module.

ERR_ECAT_ENVIRONMENT_
18 The Autoconfig file is not found.
RECORD_DISABLE

The hardware connection configuration saved


ERR_ECAT_ENVIRONMENT_
19 by Autoconfig file does not match the one for
RECORD_NO_MATCH
Fieldbus.

ERR_ECAT_ENVIRONMENT_
20 Fail to open the Autoconfig file.
RECORD_FILE_OPEN

The Autoconfig file for saving the hardware


ERR_ECAT_ENVIRONMENT_
21 connection configuration has not been
RECORD_NOT_CREATE
created.

The setting for initializing EtherCAT Master is


23 ERR_ECAT_DEVICE_OPEN
in error.

The module data that is loaded during the

24 ERR_ECAT_NO_DEVICE initial stage of EtherCAT Master initialization is

in error.

25 ERR_ECAT_NO_MASTER EtherCAT Master not found.

26 ERR_ECAT_NO_SLAVE EtherCAT Slave not found.

There is an unknown module type on the


27 ERR_ECAT_UNKNOWN_SLAVE
EtherCAT bus.

28 ERR_ECAT_IST_CREATE Fail to create IST.

29 ERR_ECAT_MASTER_CREATE Fail to create EtherCAT Master.

34-2 March, 2017


EtherCAT Programming Guide Error Code Description

Returned
value Name of the error code Description
(Decimal)
ERR_ECAT_MASTER_REQUEST_ Wrong communication mode of EtherCAT

34
30
STATE Master.

ERR_ECAT_MASTER_OPERATION_NOT
31 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


32
AD drive.

ERR_ECAT_MASTER_GET_ Fail to acquire the serial number of Delta PAC


33
SERIAL_NO_WRONG or EtherCAT motion card.

Timeout error occurs when acquiring the serial


ERR_ECAT_MASTER_GET_
34 number of Delta PAC or EtherCAT motion
SERIAL_NO_TIMEOUT
card.

ERR_ECAT_PIPELINE_CORE EtherCAT kernel – The scheduler fails to


128
_TIMER_CREATE create the event.

EtherCAT kernel – Fail to create the scheduler


129 ERR_ECAT_PIPELINE_CREATE
function.

EtherCAT kernel – Fail to create the command


130 ERR_ECAT_COMMAND_ENQUEUE
buffer for the scheduler.

EtherCAT kernel –The scheduler fails to add


131 ERR_ECAT_API_BUFFER_ ENQUEUE
the command to the buffer.

256 ERR_ECAT_NODE_ID Node ID of EtherCAT is in error.

257 ERR_ECAT_SLOT_ID Slot ID of EtherCAT is in error.

An error has occurred when setting the data


258 ERR_ECAT_SDO_DOWNLOAD
value through SDO.

An error has occurred when acquiring the data


259 ERR_ECAT_SDO_UPLOAD
through SDO.

260 ERR_ECAT_GET_PROCESS_DATA Unable to acquire the specified PDO data.

Initialization failure of ESI (EtherCAT Slave

3840 ERR_ESI_INITIAL Information) file or the ESI file has not been

initialized.

3841 ERR_ESI_OPEN_DEVICE Cannot find the matched hardware setting.

The supported CANOpen OD list cannot be


3842 ERR_ESI_CREATE_CANOPEN_OD_LIST
created.

The data of Data Type section cannot be


3843 ERR_ESI_NO_DATA_TYPE_INFO
created.

3844 ERR_ESI_NO_OBJECT_INFO The data of Object section cannot be created.

The data of SM section or Rx / Tx section


3845 ERR_ESI_CREATE_SYNC_MANAGER
cannot be created.

March, 2017 34-3


Error Code Description EtherCAT Programming Guide

Returned
value Name of the error code Description
(Decimal)
3846 ERR_ESI_CREATE_FMMU_CONTROL The data of Fmmu section cannot be created.

34 3847

3848
ERR_ESI_NO_PDO_CHANNEL

ERR_ESI_NO_PDO_MAPPING
The specified PDO channel number does not

exist.

No object dictionary (OD) is in the specified

PDO channel.

3849 ERR_ESI_PDO_MAPPING_INSERT CANopen OD cannot be created.

3850 ERR_ESI_PDO_MAPPING_DELETE CANopen OD cannot be deleted.

ERR_ESI_CREATE_DISTRIBUTED_CLO The DC time information in the ESI file cannot


3851
CK 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.

4096 ERR_ECAT_NO_SLAVE_FOUND No connection or no slave device is detected.

4097 ERR_ECAT_INITIAL_TIMEOUT Waiting time for initialization is too long.

4098 ERR_ECAT_MODE_CHANGE_ FAILED Unable to switch to OP mode or Init mode.

4099 ERR_ECAT_SLAVE_ID The issued number of slave station is wrong.

Repeated station name or the axis number


4100 ERR_ECAT_ALIAS_SLAVE_ID
exceeds the range.

Initialization is required before starting this


4352 ERR_ECAT_NEED_INITIAL
operation.

This API cannot be executed after the


4353 ERR_ECAT_NEED_RESET
EtherCAT Master is initialized.

Connection has to be created before starting


4354 ERR_ECAT_NEED_CONNECT
the operation.

The execution is only allowed after DC time

4355 ERR_ECAT_NEED_DC_OP calibration is completed and the EtherCAT

Master switches to OP mode.

The API cannot be executed as the current


4356 ERR_ECAT_NEED_RALM
alarm is not cleared.

The motor has to be enabled before executing


4357 ERR_ECAT_NEED_SVON
the API.

Setting homing parameters is required before


4358 ERR_ECAT_NEED_HOMECONFIG
start homing.

34-4 March, 2017


EtherCAT Programming Guide Error Code Description

Returned
value Name of the error code Description
(Decimal)
This API can be executed only when the

34
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.

4609 ERR_ECAT_API_PARAMETER The input API parameter is in error.

4610 ERR_ECAT_SLAVE_TYPE This API is not supported by the module.

The “target reached” signal is not triggered


4611 ERR_ECAT_TARGET_REACHED
after the waiting time is up.

4612 ERR_ECAT_MODE_NOT_ SUPPORT This API is not supported in this motion mode.

This axis is not supported in this motion mode.


4613 ERR_ECAT_MOTION_TYPE
(It is probably restricted by the group function.)

The OD code of this motion mode is not


4614 ERR_ECAT_PDO_NOT_MAPPING
included the PDO mapping list.

The firmware version of this module is not


4615 ERR_ECAT_MODULE_REVISION
supported.

One of the axes is not set to continuous speed


4616 ERR_ECAT_SPEED_CONTINUE_ MODE
mode.

Parameter setting for homing method is in


4617 ERR_ECAT_HOME_MODE
error.

The homing offset setting of the homing


4618 ERR_ECAT_HOME_OFFSET
parameter is in error.

The speed setting of looking for the origin


4619 ERR_ECAT_HOME_FIRST_SPEED
during homing is in error.

In API homing parameter, after the origin is

4620 ERR_ECAT_HOME_SECOND_ SPEED found, the speed setting is wrong when it looks

for Z pulse.

Acceleration setting of the homing parameter


4621 ERR_ECAT_HOME_ACC
is in error.

The location setting of non-volatile memory is


4622 ERR_ECAT_MRAM_INDEX
in error.

ERR_ECAT_MRAM_INDEX_OUT_ Range setting of the non-volatile memory is in


4623
RANGE error.

4864 ERR_ECAT_PDO_TX_FAILED Fail to send the PDO type command.

4865 ERR_ECAT_SDO_TIMEOUT SDO communication timeout.

March, 2017 34-5


Error Code Description EtherCAT Programming Guide

Returned
value Name of the error code Description
(Decimal)
The slave device returns SDO error code. Use

34 4866 ERR_ECAT_SDO_RETURN
API

“_ECAT_Slave_CANopen_Get_ErrorCode” to

acquire the error code.

4867 ERR_ECAT_PDO_RX_FAILED Fail to return a PDO command.

4868 ERR_ECAT_MAILBOX Sending failure of Mailbox

4869 ERR_ECAT_SDO_BUFFER_FULL SDO command buffer is full.

The input number of grouped axes is over 10


5120 ERR_ECAT_GROUP_NUMBER
the maximum.

5121 ERR_ECAT_GROUP_ENABLE The group function is disabled or in hold state.

This action can only be done when group


5122 ERR_ECAT_GROUP_PAUSE
function is in hold state.

The slave device has been used by other


5123 ERR_ECAT_GROUP_SLAVE
group or in this group.

5124 ERR_ECAT_GROUP_MODE The group function is not supported for now.

5125 ERR_ECAT_GROUP_ALREADY_ USED This group number is in use.

The type setting has to be done before group

5126 ERR_ECAT_GROUP_TYPE function is enabled. Once the function is

enabled, setting the type is not allowed.

5127 ERR_ECAT_GROUP_SVON Please enable all motors in the group.

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.

5377 ERR_ECAT_SERVO_PARA_RO This servo parameter is read-only.

ERR_ECAT_SERVO_COMPARE_ An error has occurred when setting the pulse


5378
ENABLE compare function of the servo drive.

When the auto recording function is enabled,


5632 ERR_ECAT_RECORD_TYPE
the acquired data cannot be modified.

This MPG group has been enabled. Please


5888 ERR_ECAT_MPG_ENABLE
disable it first before executing the API.

5889 ERR_ECAT_MPG_CONFIG Setting of this MPG group is not completed.

Verification procedure is in progress. Please


12288 ERR_ECAT_SECURITY_ OPERATING
wait and then execute the API.

Login is required to proceed with the


12289 ERR_ECAT_SECURITY_NEED_ LOGIN
operation.

34-6 March, 2017


EtherCAT Programming Guide Error Code Description

Returned
value Name of the error code Description
(Decimal)
This function fails to access the security

34
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


32826 ERR_PATH_ECAT_ECAM_ENABLE
enabled.

ERR_PATH_ECAT_ECAM_
32827 The master axis of E-cam is not set.
MASTERSOURCE

53248 ERR_RTX_RTSS_LOAD RTSS cannot be enabled/disabled correctly.

Fail to access RTSS shared memory or the


53249 ERR_RTX_CONNECT_LINK_ FAILED
license verification is failed.

53250 ERR_RTX_EVENT_FAILED Fail to access the RTSS event.

Failure of handshaking with RTSS shared


53251 ERR_RTX_CONNECT_FAILED
memory.

Restarting the computer is required to activate


53252 ERR_RTX_CONFIG_EDITED
the default setting of RTX.

The RTX license you are using might be a


53253 ERR_RTX_SECURITY_FAILED
piracy.

No response when RTX special command is


53254 ERR_RTX_COMMANDING
issued.

53255 ERR_RTX_SYSTEM_NOT_ SUPPORT This API is not supported by RTSS.

53256 ERR_RTX_NOT_SUPPORT The API is not supported by this RTX version.

Fail to enable communication status of RTX


53257 ERR_RTX_THREAD_CREATE_ FAILED
thread

53258 ERR_RTX_RTSS_START_FAILED Fail to enable the RTX system.

ERR_RTX_WIN32_SYSTEM_NOT_ The callback function is not supported by


53504
SUPPORT Win32 system.

Modifying the callback function is not allowed


53505 ERR_RTX_CALLBACK_CLOSE
when it is enabled.

Callback function cannot be enabled due to


53506 ERR_RTX_CALLBACK_FUNCTION
setting error.

When callback function is enabled, the thread


53507 ERR_RTX_CALLBACK_THREAD
is not correctly executed.

53760 ERR_RTX_ERRORLOG_NOT_ ENABLE Auto recording function is not enabled.

ERR_RTX_ERRORLOG_COUNT_
53761 The specified index of error count is wrong.
ERROR

57344 ERR_CARD_NO_FOUND Motion card is not found.

March, 2017 34-7


Error Code Description EtherCAT Programming Guide

Returned
value Name of the error code Description
(Decimal)
No response is sent from the motion card after

34
57345 ERR_CARD_NO_RESPONSE
the command is sent.

Connection error of the motion card and the


57346 ERR_CARD_CONNECT_FAILED
driver.

When recording function is applied, number of


57347 ERR_CARD_MEMORY_NOT_ENOUGH
motion cards exceeds the limit. (Max. is 24).

57348 ERR_CARD_LOAD_AUTOCONFIG_FILE Fail to load the Autoconfig file.

57349 ERR_CARD_SECURITY_FAILED Security verification failed.

ERR_CARD_UPGRADE_CREATE_
57350 Fail to open the update window.
THREAD_FAILED

ERR_CARD_UPGRADE_NO_
57351 No response returned during the update.
RESPONSE

ERR_CARD_UPGRADE_NO_
57352 No update file (EtherCAT_DLL) is found.
RESOURSE

ERR_CARD_UPGRADE_LOAD_ Fail to access the updating resource


57353
RESOURSE (EtherCAT_DLL).

57354 ERR_CARD_UPGRADE_TIMEOUT System update timeout.

57355 ERR_CARD_UPGRADE_FAILED System update failure

61440 ERR_ECAT_DLL_IS_USED EtherCAT_DLL file has been opened.

Connection error of EtherCAT_DLL file, RTSS


61441 ERR_ECAT_NO_DLL_FOUND
and DDL file of motion card.

Connection failure of EtherCAT_DLL and


61442 ERR_ECAT_NO_RTSS_DLL_ FOUND
RTSSDLL.

Connection between EtherCAT_DLL file and


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


61446 ERR_ECAT_CARDNO_ERROR
used.

Unable to acquire the directory information of


61447 ERR_ECAT_GET_DLL_PATH
DLL file.

61448 ERR_ECAT_GET_DLL_VERSION Cannot acquire the version information of DLL.

DMCNET type API is currently not supported


61449 ERR_ECAT_NOT_SUPPORT
by EtherCAT.

34-8 March, 2017


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

March, 2017 34-9


Error Code Description EtherCAT Programming Guide

34.2 Error code description


Code in DEC 0 Code in HEX 0x0

34
Name of error
ERR_ECAT_NO_ERROR
code
Description No error.
Troubleshooting N/A

Code in DEC 1 Code in HEX 0x1


Name of error
ERR_ECAT_HW_NO_INITIALIZE
code
Description Another API is called before EtherCAT master is initialized completely.
Troubleshooting Initialize EtherCAT master before calling the API.

Code in DEC 2 Code in HEX 0x2


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 3 Code in HEX 0x3


Name of error
ERR_ECAT_HW_HAS_INITIALIZED
code
Description EtherCAT master is has been initialized already.
Troubleshooting Remove the initialization command in the program.

Code in DEC 16 Code in HEX 0x10


Name of error
ERR_ECAT_EEPROM_READ
code
Description Fail to read EEPROM of the module.
Communication for the hardware cannot be created. Please check if the
Troubleshooting
hardware connection is normal.

Code in DEC 17 Code in HEX 0x11


Name of error
ERR_ECAT_EEPROM_WRITE
code
Description Fail to write the data to the EEPROM of the module.
Communication for the hardware cannot be created. Please check if the
Troubleshooting
hardware connection is normal.

34-10 March, 2017


EtherCAT Programming Guide Error Code Description

Code in DEC 18 Code in HEX 0x12


Name of error

34
ERR_ECAT_ENVIRONMENT_RECORD_DISABLE
code
The function of the Autoconfig file is not working due to the system
Description
configuration error.
Troubleshooting N/A

Code in DEC 19 Code in HEX 0x13


Name of error
ERR_ECAT_ENVIRONMENT_RECORD_NO_MATCH
code
The hardware connection configuration saved by Autoconfig file does not
Description
match the one for Fieldbus.
Communication for the hardware cannot be created. Please check if the
Troubleshooting
connection is normal.

Code in DEC 20 Code in HEX 0x14


Name of error
ERR_ECAT_ENVIRONMENT_RECORD_FILE_OPEN
code
Description Fail to open the Autoconfig file.
Troubleshooting Please check if the Autoconfig file is saved in the given directory.

Code in DEC 21 Code in HEX 0x15


Name of error
ERR_ECAT_ENVIRONMENT_RECORD_NOT_CREATE
code
The Autoconfig file for saving the hardware connection configuration has not
Description
been created.
Troubleshooting Please execute the initialization procedure correctly.

Code in DEC 23 Code in HEX 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 24 Code in HEX 0x18


Name of error
ERR_ECAT_NO_DEVICE
code

March, 2017 34-11


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.

34 Code in DEC
Name of error
25 Code in HEX 0x19

ERR_ECAT_NO_MASTER
code
Description EtherCAT Master not found.
Troubleshooting Please set the system of EtherCAT Master first.

Code in DEC 26 Code in HEX 0x1A


Name of error
ERR_ECAT_NO_SLAVE
code
Description EtherCAT Slave not found.
Hardware communication cannot be created. Please check if the connection
Troubleshooting
is normal.

Code in DEC 27 Code in HEX 0x1B


Name of error
ERR_ECAT_UNKNOWN_SLAVE
code
Description There is an unknown module type on the EtherCAT Fieldbus.
Troubleshooting Please remove the unsupported module.

Code in DEC 28 Code in HEX 0x1C


Name of error
ERR_ECAT_IST_CREATE
code
Description Fail to create IST due to system configuration error.
Troubleshooting N/A

Code in DEC 29 Code in HEX 0x1D


Name of error
ERR_ECAT_MASTER_CREATE
code
Description Fail to create EtherCAT Master.
Initialization error of EtherCAT Master system. Please check if the hardware
Troubleshooting
connection is normal.

Code in DEC 30 Code in HEX 0x1D


Name of error
ERR_ECAT_MASTER_REQUEST_STATE
code

34-12 March, 2017


EtherCAT Programming Guide Error Code Description

Description Wrong status of EtherCAT Master.


Troubleshooting Switch to the correct status.

Code in DEC
Name of error
code
31 Code in HEX

ERR_ECAT_MASTER_OPERATION_NOT_READY
0x1F
34
Description The EtherCAT Master is not in OP status yet.
Troubleshooting Please wait for the EtherCAT Master to switch to OP status.

Code in DEC 32 Code in HEX 0x20


Name of error
ERR_ECAT_DELTA_NODE_ID_ALIAS_READ
code
Description Fait to read the verification code of Delta servo drive.
Communication cannot be created, please check if hardware connection is
Troubleshooting
normal. Make sure the firmware version of the Delta servo drive is correct.

Code in DEC 33 Code in HEX 0x21


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.

Code in DEC 34 Code in HEX 0x22


Name of error
ERR_ECAT_MASTER_GET_SERIAL_NO_TIMEOUT
code
Timeout error occurs when acquiring the serial number of Delta PAC or
Description
EtherCAT motion card.
Please contact Delta to check if the latest FPGA firmware is used on your
Troubleshooting
Delta PAC or EtherCAT motion card.

Code in DEC 128 Code in HEX 0x80


Name of error
ERR_ECAT_PIPELINE_CORE_TIMER_CREATE
code
EtherCAT kernel – The scheduler fails to create the event due to system
Description
configuration error.
Troubleshooting N/A

March, 2017 34-13


Error Code Description EtherCAT Programming Guide

Code in DEC 129 Code in HEX 0x81


Name of error
ERR_ECAT_PIPELINE_CREATE
code

34 Description

Troubleshooting
EtherCAT kernel – Fail to create the scheduler function due to system
configuration error.
N/A

Code in DEC 130 Code in HEX 0x82


Name of error
ERR_ECAT_COMMAND_ENQUEUE
code
Description EtherCAT kernel – Fail to create the command buffer for the scheduler.
Troubleshooting This command is not supported by the module.

Code in DEC 131 Code in HEX 0x82


Name of error
ERR_ECAT_API_BUFFER_ENQUEUE
code
Description EtherCAT kernel –The scheduler fails to add the command to the buffer.
Troubleshooting The add command is not supported by the remote module.

Code in DEC 256 Code in HEX 0x100


Name of error
ERR_ECAT_NODE_ID
code
Description Node ID of EtherCAT is in error.
Troubleshooting Please check the setting parameters.

Code in DEC 257 Code in HEX 0x101


Name of error
ERR_ECAT_SLOT_ID
code
Description Slot ID of EtherCAT is in error.
Troubleshooting Please check the setting parameters.

Code in DEC 258 Code in HEX 0x102


Name of error
ERR_ECAT_SDO_DOWNLOAD
code
Description An error has occurred when setting the data value through SDO.
Troubleshooting Please check the setting parameters.

34-14 March, 2017


EtherCAT Programming Guide Error Code Description

Code in DEC 259 Code in HEX 0x103


Name of error
ERR_ECAT_SDO_UPLOAD
code
Description
Troubleshooting
An error has occurred when acquiring the data through SDO.
Please check the setting parameters. 34
Code in DEC 260 Code in HEX 0x104
Name of error
ERR_ECAT_GET_PROCESS_DATA
code
Description The specified PDO data cannot be acquired.
Troubleshooting Please check the setting parameters.

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 0xF01


Name of error
ERR_ESI_OPEN_DEVICE
code
Description Cannot find the matched hardware setting.
Troubleshooting Change the directory destination of ESI (EtherCAT Slave Information) file.

Code in DEC 3842 Code in HEX 0xF02


Name of error
ERR_ESI_CREATE_CANOPEN_OD_LIST
code
Description The supported CANOpen OD list cannot be created.
Troubleshooting Check if the file format of ESI (EtherCAT Slave Information) is correct.

Code in DEC 3843 Code in HEX 0xF03


Name of error
ERR_ESI_NO_DATA_TYPE_INFO
code
Description The data of Data Type section cannot be created.
Troubleshooting Check if the file format of ESI (EtherCAT Slave Information) is correct.

March, 2017 34-15


Error Code Description EtherCAT Programming Guide

Code in DEC 3844 Code in HEX 0xF04


Name of error
ERR_ESI_NO_OBJECT_INFO
code

34 Description
Troubleshooting
The data of Object section cannot be created.
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
code
Description The data of SM section or Rx / Tx section of PDO cannot be created.
Troubleshooting Check if the file format of ESI (EtherCAT Slave Information) is correct.

Code in DEC 3846 Code in HEX 0xF06


Name of error
ERR_ESI_CREATE_FMMU_CONTROL
code
Description The data of Fmmu section cannot be created.
Troubleshooting Check if the file format of ESI (EtherCAT Slave Information) is correct.

Code in DEC 3847 Code in HEX 0xF07


Name of error
ERR_ESI_NO_PDO_CHANNEL
code
Description The specified PDO channel number does not exist.
Troubleshooting Check if the input value is correct.

Code in DEC 3848 Code in HEX 0xF08


Name of error
ERR_ESI_NO_PDO_MAPPING
code
Description No object dictionary (OD) is in the specified PDO channel.
Troubleshooting Check if the input value is correct.

Code in DEC 3849 Code in HEX 0xF09


Name of error
ERR_ESI_PDO_MAPPING_INSERT
code
Description CANopen OD cannot be created.
Troubleshooting PDO channel number is wrong or number of OD exceeds the limit.

34-16 March, 2017


EtherCAT Programming Guide Error Code Description

Code in DEC 3850 Code in HEX 0xF0A


Name of error
ERR_ESI_PDO_MAPPING_DELETE
code
Description
Troubleshooting
CANopen OD cannot be deleted.
PDO channel number is wrong or number of OD number is 0. 34
Code in DEC 3851 Code in HEX 0xF0B
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
ERR_ESI_ENI_INFORMATION_INITIAL
code
Description Unable to generate process data or initial command.
Troubleshooting Check if the file format of ESI (EtherCAT Slave Information) is correct.

Code in DEC 4081 Code in HEX 0xFF1


Name of error
ERR_ESI_ENI_FILE_INITIAL
code
The information required by ESI (EtherCAT Slave Information) file cannot be
Description
generated.
Troubleshooting Check if the file format of ESI (EtherCAT Slave Information) is correct.

Code in DEC 4082 Code in HEX 0xFF2


Name of error
ERR_ESI_ENI_FILE_SAVE
code
Description ESI (EtherCAT Slave Information) file cannot be saved.
Troubleshooting Check if the file directory is correct.

Code in DEC 4096 Code in HEX 0x1000


Name of error
ERR_ECAT_NO_SLAVE_FOUND
code
Description No connection or no slave device is detected.
Make sure the wiring is correct and all the modules conform to the supported
Troubleshooting specifications
Please update the files relevant to the Autoconfig file.

March, 2017 34-17


Error Code Description EtherCAT Programming Guide

Code in DEC 4097 Code in HEX 0x1001


Name of error
ERR_ECAT_INITIAL_TIMEOUT
code

34 Description Waiting time for initialization is too long.


Please check the following:
1. Quit the current program and check if RTSS is shutdown correctly. If not,
please manually shutdown RTSS.
2. Make sure the set DC time is supported by the servo drive or module.
Troubleshooting 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.

Code in DEC 4098 Code in HEX 0x1002


Name of error
ERR_ECAT_MODE_CHANGE_FAILED
code
Description Unable to switch to OP mode or Init mode.
Please check the following:
1. Quit the current program and check if RTSS is shutdown correctly. If not,
please manually shutdown RTSS.
2. Make sure the set DC time is supported by the servo drive or module.
Troubleshooting 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.

Code in DEC 4099 Code in HEX 0x1003


Name of error
ERR_ECAT_SLAVE_ID
code
Description The issued number of slave station is wrong.
Troubleshooting Please check if the salve number exists.

Code in DEC 4100 Code in HEX 0x1004


Name of error
ERR_ECAT_ALIAS_SLAVE_ID
code
Description Repeated station name or the axis number exceeds the range.
Troubleshooting Make sure each Slave has its unique name and the axis number should be set

34-18 March, 2017


EtherCAT Programming Guide Error Code Description

within the allowable range. Refer to Section 2.1 for the Max. axis number of
the Salve.

Code in DEC
Name of error
code
4352

ERR_ECAT_NEED_INITIAL
Code in HEX 0x1100
34
Description Initialization is required before starting this operation.
Troubleshooting Please refer to Section 3.1 to execute EtherCAT initialization procedure.

Code in DEC 4353 Code in HEX 0x1101


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 0x1102


Name of error
ERR_ECAT_NEED_CONNECT
code
Description Connection has to be created before starting the operation.
Please refer to the example in Section 3.1 to execute EtherCAT initialization
Troubleshooting
procedure.

Code in DEC 4355 Code in HEX 0x1103


Name of error
ERR_ECAT_NEED_DC_OP
code
The execution is only allowed after DC time calibration is completed and the
Description
EtherCAT Master switches to OP mode.
Please refer to the example in Section 3.1 to execute EtherCAT initialization
Troubleshooting
procedure.

Code in DEC 4356 Code in HEX 0x1104


Name of error
ERR_ECAT_NEED_RALM
code
Description The API cannot be executed as the current alarm is not cleared.
Please check if there is any alarm occurrence on the Slave. If yes, please
Troubleshooting follow the troubleshooting procedure and use the API for alarm reset first
before executing this API.

March, 2017 34-19


Error Code Description EtherCAT Programming Guide

Code in DEC 4357 Code in HEX 0x1105


Name of error
ERR_ECAT_NEED_SVON
code

34 Description
Troubleshooting
The motor has to be enabled before executing the API.
Use “ECAT_Slave_Motion_Set_Svon” to enable the motor.

Code in DEC 4358 Code in HEX 0x1106


Name of error
ERR_ECAT_NEED_HOMECONFIG
code
Description Setting homing parameters is required before start homing.
Troubleshooting Please check if the homing parameters are set before homing.

Code in DEC 4359 Code in HEX 0x1107


Name of error
ERR_ECAT_NEED_STOP
code
Description This API can be executed only when the specified axis is not moving.
Troubleshooting Please refer to the description of this API in the manual.

Code in DEC 4608 Code in HEX 0x1200


Name of error
ERR_ECAT_RING_BUFFER_FULL
code
Description The cycle communication command buffer of Mailbox is full.
The number of register of API has exceeded the limit. Please use
Troubleshooting
“_ECAT_Master_Get_Api_BufferLength” to acquire the current count.

Code in DEC 4609 Code in HEX 0x1201


Name of error
ERR_ECAT_API_PARAMETER
code
Description The input API parameter is in error.
Troubleshooting Please check if the parameter of the API is correct.

Code in DEC 4610 Code in HEX 0x1202


Name of error
ERR_ECAT_SLAVE_TYPE
code
Description This API is not supported by the module.
Please refer to the manual and check if this API is applicable to the module or
Troubleshooting
servo drive.

Code in DEC 4611 Code in HEX 0x1203

34-20 March, 2017


EtherCAT Programming Guide Error Code Description

Name of error
ERR_ECAT_TARGET_REACHED
code
Description The “target reached” signal is not triggered after the waiting time is up.

Troubleshooting
Make sure the connection is normal and no alarm has occurred on the servo
drive. 34
Code in DEC 4612 Code in HEX 0x1204
Name of error
ERR_ECAT_MODE_NOT_SUPPORT
code
Description This API is not supported in this motion mode.
This API is not supported in this motion mode; Please refer to the manual to
check if the motion mode is correct.
Troubleshooting
If you are using a regular API function (Neither a user-defined PDO nor a
user-defined PDO list), please contact Delta.

Code in DEC 4613 Code in HEX 0x1205


Name of error
ERR_ECAT_MOTION_TYPE
code
This axis is not supported in this motion mode. (It is probably restricted by the
Description
group function.)
The motion axis is not supported in this motion mode or this axis has been
grouped.
Troubleshooting Please refer to the manual to check if this motion is supported by the axis. If
the error is caused by the grouping of the axes, please disable the group
function first.

Code in DEC 4614 Code in HEX 0x1206


Name of error
ERR_ECAT_PDO_NOT_MAPPING
code
Description The OD code of this motion mode is not included the PDO mapping list.
Please create the DAT file again or make sure the module supports this
Troubleshooting
motion mode.

Code in DEC 4615 Code in HEX 0x1207


Name of error
ERR_ECAT_MODULE_REVISION
code
Description 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

March, 2017 34-21


Error Code Description EtherCAT Programming Guide

Code in DEC 4616 Code in HEX 0x1208


Name of error

34
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.

Code in DEC 4617 Code in HEX 0x1209


Name of error
ERR_ECAT_HOME_MODE
code
Description Parameter setting for homing method is in error.
Troubleshooting Check the parameter setting.

Code in DEC 4618 Code in HEX 0x120a


Name of error
ERR_ECAT_HOME_OFFSET
code
Description The homing offset setting of the homing parameter is in error.
Troubleshooting Check the parameter setting.

Code in DEC 4619 Code in HEX 0x120b


Name of error
ERR_ECAT_HOME_FIRST_SPEED
code
Description The speed setting of looking for the origin during homing is in error.
Troubleshooting Check the parameter setting.

Code in DEC 4620 Code in HEX 0x120c


Name of error
ERR_ECAT_HOME_SECOND_SPEED
code
In API homing parameter, after the origin is found, the speed setting is wrong
Description
when it looks for Z pulse.
Troubleshooting Check the parameter setting.

Code in DEC 4621 Code in HEX 0x120d


Name of error
ERR_ECAT_HOME_ACC
code
Description Acceleration setting of the homing parameter is in error.
Troubleshooting Please check the parameter setting.

34-22 March, 2017


EtherCAT Programming Guide Error Code Description

Code in DEC 4622 Code in HEX 0x120e


Name of error
ERR_ECAT_MRAM_INDEX
code
Description
Troubleshooting
The address of retentive memory is in error.
Please check the parameter setting. 34
Code in DEC 4623 Code in HEX 0x120f
Name of error
ERR_ECAT_MRAM_INDEX_OUT_RANGE
code
Description Range setting of the retentive memory is in error.
Troubleshooting Please check the parameter setting.

Code in DEC 4864 Code in HEX 0x1300


Name of error
ERR_ECAT_PDO_TX_FAILED
code
Description Fail to send the PDO type command.
Please check the following:
1. Quit the current program. Check if RTSS is correctly shut down; if not,
manually shut down RTSS.
2. Check if the servo drive or the module supports the DC time you set.
Troubleshooting 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.

Code in DEC 4865 Code in HEX 0x1301


Name of error
ERR_ECAT_SDO_TIMEOUT
code
Description SDO communication timeout.
Please check the following:
1. Quit the current program. Check if RTSS is correctly shut down; if not,
manually shut down RTSS.
2. Check if the servo drive or the module supports the DC time you set.
Troubleshooting 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.

March, 2017 34-23


Error Code Description EtherCAT Programming Guide

Code in DEC 4866 Code in HEX 0x1302


Name of error
ERR_ECAT_SDO_RETURN
code

34 Description
The slave device returns SDO error code. Use API
“_ECAT_Slave_CANopen_Get_ErrorCode” to acquire the error code.
Please make sure the OD code, data content, and data size match the
Troubleshooting
specification of the slave station.

Code in DEC 4867 Code in HEX 0x1303


Name of error
ERR_ECAT_PDO_RX_FAILED
code
Description Fail to return a PDO command.
Please check the following:
1. Quit the current program. Check if RTSS is correctly shut down; if not,
manually shut down RTSS.
2. Check if the servo drive or the module supports the DC time you set.
Troubleshooting 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.

Code in DEC 4868 Code in HEX 0x1304


Name of error
ERR_ECAT_MAILBOX
code
Description Sending failure of Mailbox
Please check the following:
1. Quit the current program. Check if RTSS is correctly shut down; if not,
manually shut down RTSS.
2. Check if the servo drive or the module supports the DC time you set.
Troubleshooting 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.

Code in DEC 4869 Code in HEX 0x1305


Name of error
ERR_ECAT_SDO_BUFFER_FULL
code

34-24 March, 2017


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
Name of error
5120 Code in HEX 0x1400 34
ERR_ECAT_GROUP_NUMBER
code
Description The input number of grouped axes is over 10 the maximum.
The maximum number of the grouped axes is 10. The number should not
Troubleshooting
exceed the limit.

Code in DEC 5121 Code in HEX 0x1401


Name of error
ERR_ECAT_GROUP_ENABLE
code
Description The group function is disabled or in hold state.
Before start the operation, please make sure the group function is enabled or
Troubleshooting
is switched to hold state.

Code in DEC 5122 Code in HEX 0x1402


Name of error
ERR_ECAT_GROUP_PAUSE
code
Description This action can only be done when group function is in hold state.
Troubleshooting N/A

Code in DEC 5123 Code in HEX 0x1403


Name of error
ERR_ECAT_GROUP_SLAVE
code
Description The slave device has been used by other group or in this group.
Troubleshooting A slave station can only be used in one group at a time.

Code in DEC 5124 Code in HEX 0x1404


Name of error
ERR_ECAT_GROUP_MODE
code
Description The group function is not supported for now.
The mode you selected is not supported for now, please refer to the manual
Troubleshooting
and document for version update.

March, 2017 34-25


Error Code Description EtherCAT Programming Guide

Code in DEC 5125 Code in HEX 0x1405


Name of error
ERR_ECAT_GROUP_ALREADY_USED
code

34 Description

Troubleshooting
This group number is in use.
The group you selected has been enabled or stopped; this command is not
supported. Please make sure the group number is correct or disable the group
setting first.

Code in DEC 5126 Code in HEX 0x1406


Name of error
ERR_ECAT_GROUP_TYPE
code
The type setting has to be done before group function is enabled. Once the
Description
function is enabled, setting the type is not allowed.
Before enabling the group function, please execute API
“_ECAT_Slave_User_Motion_Control_Set_Type” and make sure no error has
Troubleshooting
occurred. Please note that the group function is disabled when using the API
“_ECAT_Slave_User_Motion_Control_Set_Type”.

Code in DEC 5127 Code in HEX 0x1407


Name of error
ERR_ECAT_GROUP_SVON
code
Description Please enable all motors in the group.
Troubleshooting Before enabling the group, please make sure each motor has been enabled.

Code in DEC 5128 Code in HEX 0x1408


Name of error
ERR_ECAT_GROUP_ALM
code
Description An alarm has occurred on one of the axes.
Before enabling the group, please make sure no alarm occurs on any of the
Troubleshooting
axes.

Code in DEC 5129 Code in HEX 0x1409


Name of error
ERR_ECAT_GROUP_DATA_BUFFER
code
Description The buffer is full. (799 data)
The Max. buffer size for user-defined data is 800. Acquire the current data
count by using API “_ECAT_Slave_User_Motion_Control_Get_DataCnt”.
Troubleshooting
Make sure the number is smaller than 799 or a command cannot be issued
successfully.

34-26 March, 2017


EtherCAT Programming Guide Error Code Description

Code in DEC 5130 Code in HEX 0x140A


Name of error
ERR_ECAT_GROUP_TIMEOUT
code
Description

Troubleshooting
No response is sent from the EtherCAT kernel during group operation.
Please check if the communication and operation is normal. If you cannot find
the cause, please contact Delta.
34
Code in DEC 5376 Code in HEX 0x1500
Name of error
ERR_ECAT_SERVO_PARA_EMPTY
code
Description This servo parameter does not exist.
Troubleshooting Please check if this parameter code is supported by Delta servo drive.

Code in DEC 5377 Code in HEX 0x1501


Name of error
ERR_ECAT_SERVO_PARA_RO
code
Description This servo parameter is read-only.
Writing in is not allowed as this parameter is read-only. Please refer to the
Troubleshooting
servo drive user manual.

Code in DEC 5378 Code in HEX 0x1502


Name of error
ERR_ECAT_SERVO_COMPARE_ENABLE
code
An error has occurred when setting the pulse compare function of the servo
Description
drive.
Troubleshooting Make sure the firmware version of the servo drive is the latest.

Code in DEC 5632 Code in HEX 0x1600


Name of error
ERR_ECAT_RECORD_TYPE
code
When the auto recording function is enabled, the acquired data cannot be
Description
modified.
Troubleshooting Please disable the auto recording function and then execute the API again.

March, 2017 34-27


Error Code Description EtherCAT Programming Guide

Code in DEC 5888 Code in HEX 0x1700


Name of error
ERR_ECAT_MPG_ENABLE
code

34 Description
This MPG group has been enabled. Please disable it first before executing the
API.
The same MPG group can only be enabled once at a time. Please disable it
Troubleshooting
and carry on the execution.

Code in DEC 5889 Code in HEX 0x1701


Name of error
ERR_ECAT_MPG_CONFIG
code
Description Setting of this MPG group is not completed.
Troubleshooting The MPG group has to set before it is enabled

Code in DEC 12288 Code in HEX 0x3000


Name of error
ERR_ECAT_SECURITY_OPERATING
code
Description Verification procedure is in progress. Please wait and then execute the API.
Troubleshooting Only one verification procedure can be executed at a time.

Code in DEC 12289 Code in HEX 0x3001


Name of error
ERR_ECAT_SECURITY_NEED_LOGIN
code
Description Login is required to proceed with the operation.
The verification requires logging in. Please refer to the description in Chapter
Troubleshooting
29.

Code in DEC 12290 Code in HEX 0x3002


Name of error
ERR_ECAT_SECURITY_CONNECT
code

Description This function fails to access the security kernel.

Restart the PAC or PC and try again. If this error occurs frequently, please
Troubleshooting
contact Delta.

Code in DEC 32825 Code in HEX 0x8039


Name of error
ERR_PATH_ECAT_NEED_ENABLE
code
Description This API requires to be enabled.
Troubleshooting Enable this API before using it.

34-28 March, 2017


EtherCAT Programming Guide Error Code Description

Code in DEC 32826 Code in HEX 0x803a


Name of error
ERR_PATH_ECAT_ECAM_ENABLE
code
Description
Troubleshooting
This API cannot be executed when E-cam is enabled.
N/A 34
Code in DEC 32827 Code in HEX 0x803b
Name of error
ERR_PATH_ECAT_ECAM_MASTERSOURCE
code
Description The master axis of E-cam is not set.
Troubleshooting Set the source of the master before E-cam is enabled.

Code in DEC 53248 Code in HEX 0xD000


Name of error
ERR_RTX_RTSS_LOAD
code
Description RTSS cannot be enabled/disabled correctly.
Make sure the RTX environment is correctly created. Restart the PAC if
Troubleshooting
necessary.

Code in DEC 53249 Code in HEX 0xD001


Name of error
ERR_RTX_CONNECT_LINK_FAILED
code
Description Fail to access RTSS shared memory or the license verification is failed.
Make sure RTX environment is correctly created. Restart the device if
Troubleshooting
necessary before executing the API.

Code in DEC 53250 Code in HEX 0xD002


Name of error
ERR_RTX_EVENT_FAILED
code
Description Fail to access the RTSS event.
Make sure RTX environment is correctly created. Restart the device if
Troubleshooting
necessary.

Code in DEC 53251 Code in HEX 0xD003


Name of error
ERR_RTX_CONNECT_FAILED
code
Description Failure of handshaking with RTSS shared memory.
Please make sure the RTX environment is correctly created. Restart the
Troubleshooting
device if necessary before executing the API.

March, 2017 34-29


Error Code Description EtherCAT Programming Guide

Code in DEC 53252 Code in HEX 0xD004


Name of error

34
ERR_RTX_CONFIG_EDITED
code
Description Restarting the computer is required to activate the default setting of RTX.
As some parameters of RTX correlates with EtherCAT Master, DO NOT
Troubleshooting adjust the relevant setting. If this error occurs, please restart the PAC and the
parameter will be set automatically.

Code in DEC 53253 Code in HEX 0xD005


Name of error
ERR_RTX_SECURITY_FAILED
code
Description The RTX license you are using might be a piracy.
Troubleshooting Software verification error. Please check if you are using the right software.

Code in DEC 53254 Code in HEX 0xD006


Name of error
ERR_RTX_COMMANDING
code
Description No response when RTX special command is issued.
Please check the following:
1. Quit the current program. Check if RTSS is correctly shut down; if not,
manually shut down RTSS.
2. Check if the servo drive or the module supports the DC time you set.
Troubleshooting 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.

Code in DEC 53255 Code in HEX 0xD007


Name of error
ERR_RTX_RTSS_SYSTEM_NOT_SUPPORT
code
Description This API is not supported by RTSS.
Troubleshooting N/A

34-30 March, 2017


EtherCAT Programming Guide Error Code Description

Code in DEC 53256 Code in HEX 0xD008


Name of error
ERR_RTX_NOT_SUPPORT
code
Description
Troubleshooting
The API is not supported by this RTX version.
N/A 34
Code in DEC 53257 Code in HEX 0xD009
Name of error
ERR_RTX_THREAD_CREATE_FAILED
code
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


Name of error
ERR_RTX_RTSS_START_FAILED
code
Description Fail to enable the RTX system.
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 53504 Code in HEX 0xD100


Name of error
ERR_RTX_WIN32_SYSTEM_NOT_SUPPORT
code
Description The callback function is not supported by Win32 system.
Make sure you are using the RTX system and calling
Troubleshooting
ECAT_RTX_RTDLL.rtdll.

Code in DEC 53505 Code in HEX 0xD101


Name of error
ERR_RTX_CALLBACK_CLOSE
code
Description Modifying the callback function is not allowed when it is enabled.
Troubleshooting Disable the callback function before setting it.

Code in DEC 53506 Code in HEX 0xD102


Name of error
ERR_RTX_CALLBACK_FUNCTION
code
Description Callback function cannot be enabled because its setting is in error.

March, 2017 34-31


Error Code Description EtherCAT Programming Guide

Use API “ECAT_Master_Callback_Set_Function” to set the function to be


Troubleshooting
called with the callback function.

34 Code in DEC
Name of error
code
53507

ERR_RTX_CALLBACK_THREAD
Code in HEX 0xD103

Description When callback function is enabled, the thread is not correctly executed.
Make sure the RTX environment is correctly created. Restart the PAC if
Troubleshooting
necessary.

Code in DEC 53760 Code in HEX 0xD200


Name of error
ERR_RTX_ERRORLOG_NOT_ENABLE
code
Description Auto recording function is not enabled.
Troubleshooting Enable the auto recording function.

Code in DEC 53761 Code in HEX 0xD201


Name of error
ERR_RTX_ERRORLOG_COUNT_ERROR
code
Description The specified index of error count is wrong.
Troubleshooting Check if the error count you specified exceeds the range.

Code in DEC 57344 Code in HEX 0xE000


Name of error
ERR_CARD_NO_FOUND
code
Description Motion card is not found.
Make sure the motion card and driver are correctly installed. Check if they are
Troubleshooting
shown in the Device Manager in Windows.

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


EtherCAT Programming Guide Error Code Description

Code in DEC 57346 Code in HEX 0xE002


Name of error
ERR_CARD_CONNECT_FAILED
code

Description

Troubleshooting
Connection error of the motion card and the driver.

Make sure the driver is successfully installed. Restart the PC if necessary.


34
Code in DEC 57347 Code in HEX 0xE003
Name of error
ERR_CARD_MEMORY_NOT_ENOUGH
code
When recording function is applied, number of motion cards exceeds the limit.
Description
(Max. is 24).
This is caused by the hardware specifications. To use more than 24 motion
Troubleshooting
cards for recording, please purchase RTX version.

Code in DEC 57348 Code in HEX 0xE004


Name of error
ERR_CARD_LOAD_AUTOCONFIG_FILE
code
Description Fail to load the AutoConfig file.
Make sure the AutoConfig file is in the correct directory and re-initialize
Troubleshooting
EtherCAT Master.

Code in DEC 57349 Code in HEX 0xE005


Name of error
ERR_CARD_SECURITY_FAILED
code
Description Security verification failed.
Troubleshooting Please contact your distributor.

Code in DEC 57350 Code in HEX 0xE006


Name of error
ERR_CARD_UPGRADE_CREATE_THREAD_FAILED
code
Description Fail to open the update window.
Troubleshooting 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.

March, 2017 34-33


Error Code Description EtherCAT Programming Guide

Code in DEC 57352 Code in HEX 0xE008


Name of error

34
ERR_CARD_UPGRADE_NO_RESOURSE
code
Description No update file (EtherCAT_DLL) is found.
Troubleshooting Please check the DLL version and operating system.

Code in DEC 57353 Code in HEX 0xE009


Name of error
ERR_CARD_UPGRADE_LOAD_RESOURSE
code
Description Fail to access the updating resource (EtherCAT_DLL).
Troubleshooting Please check the DLL version and the operating system.

Code in DEC 57354 Code in HEX 0xE00A


Name of error
ERR_CARD_UPGRADE_TIMEOUT
code
Description System update timeout.
Re-initialize the system and it will be updated. If the issue persists, please
Troubleshooting
contact Delta.

Code in DEC 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.
Troubleshooting Please check if the EtherCAT_DLL is being used by multiple programs.

Code in DEC 61441 Code in HEX 0xF001


Name of error
ERR_ECAT_NO_DLL_FOUND
code
Description Connection error of EtherCAT_DLL file, RTSS and DDL file of motion card.
Troubleshooting Make sure either RTSS environment or PCI motion card exists.

34-34 March, 2017


EtherCAT Programming Guide Error Code Description

Code in DEC 61442 Code in HEX 0xF002


Name of error
ERR_ECAT_NO_RTSS_DLL_FOUND
code
Description
Troubleshooting
Connection failure of EtherCAT_DLL and RTSSDLL.
Check if RTSS environment exists. 34
Code in DEC 61443 Code in HEX 0xF003
Name of error
ERR_ECAT_NO_CARD_DLL_FOUND
code
Description Connection between EtherCAT_DLL file and DLL file of motion card is in error.
Troubleshooting Check if PCI motion card exists.

Code in DEC 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 Code in HEX 0xF005


Name of error
ERR_ECAT_SAME_CARD_NUMBER
code
Description Repeated RTSS or motion card number.
Troubleshooting Make sure no card number is repeated.

Code in DEC 61446 Code in HEX 0xF006


Name of error
ERR_ECAT_CARDNO_ERROR
code
Description A non-existing card number of EtherCAT is used.
Troubleshooting Please check if you have switch to the correct card number on the knob.

Code in DEC 61447 Code in HEX 0xF007


Name of error
ERR_ECAT_GET_DLL_PATH
code
Description Unable to acquire the directory information of DLL file.
Troubleshooting Please check the directory of the DLL file.

March, 2017 34-35


Error Code Description EtherCAT Programming Guide

Code in DEC 61448 Code in HEX 0xF008


Error Code
ERR_ECAT_GET_DLL_VERSION
Name

34 Description
Troubleshooting
Cannot acquire the version information of DLL.
Please check the version of DLL.

Code in DEC 61449 Code in HEX 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.
Please check the following:
Troubleshooting 1. Power on the PAC and try again.
2. If the issue persists, please contact Delta.

34-36 March, 2017


Revision History
Release date Version Chapter Revision Contents
V1.0
March, 2017 N/A
(First edition)

March, 2017 1
Revision History EtherCAT Programming Guide

(This page is intentionally left blank.)

2 March, 2017

You might also like