DELTA EtherCAT Program Guide
DELTA EtherCAT Program Guide
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 EtherCAT
TEL: 82-2-515-5303 / FAX: 82-2-515-5302
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
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
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
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
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
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
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
March, 2017
Inverter Motion Control
15.1 _ECAT_Slave_VL_Start_Move ·········································································· 15-2
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
March, 2017
24.2 _ECAT_Slave_R1_EC9144_Set_Output_Enable ··················································· 24-4
24.3 _ECAT_Slave_R1_EC9144_Get_Output _ReturnCode ··········································· 24-5
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
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 named “lib”. They can be used in Visual Studio C and Borland C++ respectively.
Function library
EtherCatDll.lib
Development environment
1.2.2 Using VB
1.2.4 Using C#
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
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.
2 ms 100 64
1 ms 100 64
0.5 ms 50 32
0.25 ms 25 16
0.125 ms 22 8
2 ms 64 32
1 ms 64 32
0.5 ms 32 16
0.25 ms 16 8
0.125 ms 8 4
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.
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.
(2) Click Browse and select the missing file, which is placed in C:\Windows\system32\.
Then, while the other options remain unchanged, press OK and the file will be loaded into RTX
system.
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
Supported Y Y
Program interface
Figure 3.1.2.1
Figure 3.1.2.2
3 Figure 3.1.2.3
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”
Figure 3.1.2.5
Figure 3.1.2.6
3
Function name
_ECAT_Slave_Home_Config
_ECAT_Slave_Home_Move
_ECAT_Slave_Motion_Sd_Stop
Properties
Supported Y Y
Program interface
Figure 3.2.2.1
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
3
Function name
_ECAT_Slave_PT_Start_Move
_ECAT_Slave_Motion_Emg_Stop
Properties
Supported Y Y
Program interface
Figure 3.3.2.1
(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.
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.
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. */
Figure 3.3.2.5
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).
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.
3
Function name
_ECAT_Slave_PV_Start_Move
_ECAT_Slave_Motion_Sd_Stop
Properties
Supported Y Y
Program interface
Figure 3.4.2.1
(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.
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);
Figure 3.4.2.5
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
Function name
_ECAT_Slave_PP_Start_Move
_ECAT_Slave_Motion_Sd_Stop
Properties
Supported Y Y
Program interface
Figure 3.5.2.1
(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.
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.
(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
Figure 3.5.2.5
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).
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
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
Supported Y Y
Program interface
Figure 3.6.2.1
(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.
Figure 3.6.2.2
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
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
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
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.
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
(11) Two-axis motion mode (Line2, Spiral, Spiral2) and its settings
Figure 3.6.2.8
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.
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”
(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
(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
(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
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.
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
(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,
(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
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
Figure 3.6.2.11
3
Figure 3.6.2.12
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
Function name
_ECAT_Slave_DIO_Get_Input_Value
Properties
Supported Y Y
Program interface
Figure 3.7.2.1
(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.
Figure 3.7.2.3
3
Function name
_ECAT_Slave_DIO_Set_Output_Value
_ECAT_Slave_DIO_Get_Output_Value
Properties
Supported Y Y
Program interface
Figure 3.8.3.1
(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.
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
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
Supported Y Y
Program interface
Figure 3.9.2.1
(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.
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.
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:
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);
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
Supported Y Y
Program interface
Figure 3.10.2.1
(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.
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.
(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. */
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
Supported N Y
Program interface
Figure 3.11.2.1
3
Figure 3.11.2.2
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.
Figure 3.11.2.4
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
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
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
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:
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:
4
4.1 Data Type and Setting Range······························································· 4-2
4.2 API list and descriptions······································································ 4-2
4 as follows.
-1.797683134862315E308 ~
F64 64-bit double-precision floating point
1.797683134862315E309
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
4
_ECAT_Slave_PDO_Get_Detail_Mapping
device
_ECAT_Slave_PDO_Get_Rx_Data Acquire all slave Rx data of the PDO mapping
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
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
Homing
_ECAT_Slave_User_Motion_Control_Get_Alm to
_ECAT_Slave_User_Motion_Control_Get_Enable_
Acquire the status in the current group.
Mode
_ECAT_Slave_User_Motion_Control_ Ralm Reset the alarm of all axes in the specified group.
4 _ECAT_Slave_DIO_Set_Output_Error_Value
communication is disconnected
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
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
_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
Software Protection
_ECAT_Security_Check_Verifykey Check the verification key
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.
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
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_Initial(CardNo);
}
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
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.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
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);
}
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
Example
U16 Status;
U16 CardNo=0;
U32 SerialNo=0;
U16 Cardnum=0;
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
Example
U16 Status;
U16 CardNo = 0;
U16 SeqID = 0;
U16 Cardnum=0;
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
Example
U16 Status;
U16 CardNo=0;
I8 FilePath[255];
U16 Cardnum=0;
strcpy(FilePath, "C:\\EtherCAT_Information.dat");
Status = _ECAT_Autoconfig_Open_File (CardNo, FilePath);
Status = _ECAT_Master_Initial(CardNo);
}
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
Example
U16 Status;
U16 CardNo=0;
I8 FilePath[255];
U16 Cardnum=0;
strcpy(FilePath, "C:\\EtherCAT_Information.dat");
Status = _ECAT_Autoconfig_Save_File (CardNo, FilePath);
}
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
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_Initial(CardNo);
}
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
Example
U16 Status;
U16 CardNo=0;
U16 Cardnum=0;
Status = _ECAT_Master_Initial(CardNo);
}
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
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)
{
}
// 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
}
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
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);
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
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 }
Status = _ECAT_Master_Initial(CardNo);
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
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_DC_Status Acquire the motion card's DC status, time and time offset
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
Example
U16 Status;
U16 Cardnum=0;
Status = _ECAT_Master_Open(&Cardnum);
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
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.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
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);
}
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.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
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 _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
Example
U16 Status;
U16 CardNo=16, Slavenum=0;
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
Example
U16 Status;
U16 CardNo=16, SeqID =2, NodeID =2;
U32 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
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
DC current status.
Example
U16 Status;
U16 CardNo=16;
U32 Status;
I32 Time, OffsetTime;
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
1: Init mode
4: Safe-OP mode
8: OP mode
Example
U16 Status;
U16 CardNo=16;
U16 MasterStatus=0;
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
Example
U16 Status;
U16 CardNo=16, SlaveNo=1, BuffLength;
6.11 _ECAT_Master_Get_Cycle_SpendTime
Syntax
U16 PASCAL _ECAT_Master_Get_Cycle_SpendTime (U16 CardNo, F64 *Tx_Time, F64
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
Tx_MaxTime F64* Time (us) Acquire the maximum consumed time of Tx in the log
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;
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
0: Completed
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;
}
}
}
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
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.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
0: Normal
Abnormal_Flag U16* Status
1: Error
physical wiring.
Example
U16 Status;
U16 CardNo=16;
U16 Abnormal_Flag, Working_Slave_Cnt;
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
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;
}
}
}
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.
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.
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
DataSize U16 byte Data size of the sent message. Unit: byte
Example
U16 Status;
U16 CardNo=16,NodeID=1,SlotNo=0;
U16 Index=0x6040, SubIndex=0, DataSize=4;
U8 Data[4]={0};
7.2 _ECAT_Slave_SDO_Read_Message
Syntax
U16 PASCAL _ECAT_Slave_SDO_Read_Message(U16 CardNo, U16 NodeID, U16 SlotNo, U16
Purpose
This is for acquiring the current SDO data (CANopen) of the slave.
Parameter
Name Data type Property Description
DataSize U16 byte Data size of the received message. Unit: byte
Example
U16 Status;
U16 CardNo=16,NodeID=1,SlotNo=0;
U16 Index=0x1000, SubIndex=0, DataSize=4;
U8 Data[4] = {0};
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
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;
U8 Data[4] = {0};
7.4 _ECAT_Slave_SDO_Quick_Read_Message
Syntax
U16 PASCAL _ECAT_Slave_SDO_Quick_Read_Message(U16 CardNo, U16 NodeID, U16
Purpose
This is for issuing SDO read command (CANopen) to the slave without waiting for the response.
Parameter
Name Data type Property Description
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;
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
0: Completed
2: Error
Example
U16 Status;
U16 CardNo=16,NodeID=1,SlotNo=0;
U16 Index=0x6040, SubIndex=0, DataSize=4;
U8 Data[4] = {0};
U32 ErrorCode;
7.6 _ECAT_Slave_SDO_Wait_All_Done
Syntax
U16 PASCAL _ECAT_Slave_SDO_Wait_All_Done(U16 CardNo, U16 AxisNum,
Purpose
This is for waiting multiple slaves to complete all SDO commands.
Parameter
Name Data type Property Description
Example
U16 Status;
U16 AxisNum = 2;
U16 CardNo=16, NodeID[2] = {0,1} ,SlotNo[2] = {0,0};
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
Example
U16 Status;
U16 CardNo=16,NodeID=1,SlotNo=0;
U32 ErrorCode;
7 0x0504 0000
0x0504 0001
0x0504 0002
SDO protocol timed out
0x0604 0042 Number and length of objects to be transferred longer than PDO length.
0x0607 0010 Data type does not match, unsuitable PDO/SDO parameter length
0x0607 0012 Data type does not match, PDO/SDO parameter length exceeded
0x0800 0021 Data cannot be transferred/saved to the application due to local control.
0x0800 0023 Dynamic generation of object directory error or no object directory available
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
Definition
1: Processing
Example
U16 Status;
U16 CardNo=16, NodeID = 1 ,SlotNo = 0, Done;
7.9 _ECAT_Slave_PDO_Get_OD_Data
Syntax
U16 PASCAL _ECAT_Slave_PDO_Get_OD_Data (U16 CardNo, U16 NodeID, U16 SlotNo, U16
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
OD Format to be read
1: Tx
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;
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
Example
U16 Status;
U8 Data = 0;
U16 CardNo=16, NodeID = 1 ,SlotNo = 0, IOType = 0;
U16 ODIndex = 0x1780, ODSubIndex = 0x01
7.11 _ECAT_Slave_PDO_Get_Information
Syntax
U16 PASCAL _ECAT_Slave_PDO_Get_Information (U16 CardNo, U16 NodeID, U16 SlotNo,
Purpose
This is for acquiring the basic information of each slave device PDO.
Parameter
Name Data type Property Description
OD format to be read
1: Master Tx
Example
U16 Status;
U16 CardNo=16, NodeID = 1 ,SlotNo = 0, IOType = 0;
U16 ODCnt, StartIndex;
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
OD format to be read
1: Master Tx
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};
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
Example
U16 Status;
U16 CardNo=16;
BYTE Data[0x600] = {0};
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
Example
U16 Status;
U16 CardNo=16;
BYTE Data[0x600] = {0};
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
Example
U16 Status;
U16 CardNo=16;
BYTE Data[0x600] = {0};
Status = _ECAT_Slave_PDO_Get_Tx_Data(CardNo, &Data);
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
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};
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
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
0: Servo Off
Enable U16 Option
1: Servo On
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U16 Enable=1;
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
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
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
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
F64 Tdec=0.1;
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
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
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
automatically.
Fault_Type U16 Option 1: Stop the current action when the rising-edge signal
automatically.
Waring_Type U16 Option 1: Stop the current action when the rising edge
automatically.
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I16 Fault_Type = 2, Waring_Type = 1;
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
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 NewPosition=2500000;
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
NewCommand I32 Value In CSV mode, the data is the current speed.
torque.
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 NewCommand=3000000;
8.8 _ECAT_Slave_Motion_Set_MoveMode
Syntax
U16 PASCAL _ECAT_Slave_Motion_Set_MoveMode(U16 CardNo, U16 AxisNo,
Purpose
This is for setting the motion mode of the axis.
Parameter
Name Data type Property Description
0: Idle mode
2. Velocity mode
6: Home mode
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0, MoveMode=1;
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
2: Velocity mode
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U8 Mode;
8.10 _ECAT_Slave_Motion_Get_ControlWord
Syntax
U16 PASCAL _ECAT_Slave_Motion_Get_ControlWord (U16 CardNo , U16 AxisNo,
Purpose
This is for acquiring the current control word of the axis.
Parameter
Name Data type Property Description
ControlWord U16* Data (Please refer to the figure below for the definition. For
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U16 ControlWord ;
Description
Definition of 6040H: CANopen communication
Bit Name
0 Switch On
2 Quick Stop
Bit Name
8
Operation Mode Specific (Operation mode)
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
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
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U16 StatusWord;
Description
Definition of 6041H: CANopen communication
0 Ready to Switch On
1 Switched On
Bit Name
7
Quick Stop
Switch On Disabled
Warning
8
8 N/A
9 Remote
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
available interpolation
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
0: Idle state
1: Accelerating
5: MailBox processing
0: Idle state
1: Motion in progress
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U16 Mdone;
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
Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
I32 Position=0;
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
Command I32* Data In CSV mode, the data is the current speed.
torque.
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 Command=0;
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
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 TargetCommand = 0;
8.16 _ECAT_Slave_Motion_Get_Actual_Position
Syntax
U16 PASCAL _ECAT_Slave_Motion_Get_Actual_Position(U16 CardNo, U16 AxisNo,
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
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 ActualPosition;
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
ActualCommand I32* Value In CSV mode, the data is the current speed.
torque.
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 ActualCommand;
8.18 _ECAT_Slave_Motion_Get_Current_Speed
Syntax
U16 PASCAL _ECAT_Slave_Motion_Get_Current_Speed(U16 CardNo, U16 AxisNo,
Purpose
This is for acquiring the current speed of the axis.
Parameter
Name Data type Property Description
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I32 Speed;
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
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I16 Torque = 0;
8.20 _ECAT_Slave_Motion_Get_Buffer_Length
Syntax
U16 PASCAL _ECAT_Slave_Motion_Get_Buffer_Length (U16 CardNo, U16 AxisNo,
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
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0, BufferLength = 0;
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
function is triggered:
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
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 Record the pulse (position) when signal is triggered for the first time
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
Record the pulse (position) when signal is triggered for the first time
0
(This API does not support Touch Probe function 2.)
11 0 Reserved
Stop capturing the pulse (position) when the trigger signal for Touch
12
0 Probe 2 is rising-edge triggered.
Start capturing the pulse (position) when the trigger signal for Touch
8
1 Probe 2 is rising-edge triggered.
Stop capturing the pulse (position) when the trigger signal for Touch
Reserved
14 ~ 15 0
(This API does not support Touch Probe function 2.)
8.22 _ECAT_Slave_Motion_Set_TouchProbe_QuickStart
Syntax
U16 PASCAL _ECAT_Slave_Motion_Set_TouchProbe_QuickStart(U16 CardNo,
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
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);
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.
8
60B8 bit 4 Start Touch Probe Start Touch Probe
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
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.
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;
}
}
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
Parameter
Name Data type Property Description
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
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
60B9.
60B9.
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
U16 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.)
CANopen-OD 60B9:
8 0
1
1
1
Touch probe 1 is enabled
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
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)
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
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.
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);
8 }
}
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
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.
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
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
TPhase2 F64 Second Duration to change from constant speed to end speed
0: T-curve(Default)
Scurve U16 Option
2: S-curve
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;
Description
Linear interpolation of CSP command (acc/deceleration)
V(pps)
9 Constant
Velocity
Start End
Velocity Velocity
T(sec)
TPhase1 TPhase2
V(pps)
Constant
Velocity
End
Start
Velocity
Velocity
T(sec)
TPhase1 TPhase2
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
Moving direction
1: Reverse
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;
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
Array for each axis (node ID); the array number should
Array of pulse
CenterPoint I32* Circle center
for each axis
TPhase2 F64 Time (second) Duration to change from constant speed to end speed
0: T-curve(Default)
Scurve U16 Option
2: S-curve
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
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;
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
Array for each axis (node ID); the array number should
Array of pulse
EndPoint I32* End point
for each axis
TPhase2 F64 Time (second) Duration to change from constant speed to end speed
0: T-curve(Default)
Scurve U16 Option
2: S-curve
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;
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
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
Array for each axis (node ID); the array number should
Array of pulse
CenterPoint I32* Circle center
for each axis
Array of pulse
EndPoint I32* End point
for each axis
TPhase2 F64 Time (second) Duration to change from constant speed to end speed
0: T-curve(Default)
Scurve U16 Option
2: S-curve
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.
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
Sprial pitch
inward direction.
Angle F64 Rotation angle of the spiral motion (360 degrees for 1
Angle
cycle)
TPhase2 F64 Time (second) Duration to change from constant speed to end speed
0: T-curve(Default)
Scurve U16 Option
2: S-curve
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
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
1: Counterclockwise
9 TPhase1
TPhase2
F64
F64
Time (second)
Time (second)
The time it takes to change from initial speed to
constant speed
end speed
0: T-curve(Default)
Scurve U16 Option
2: S-curve
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.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
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
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.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
Array of pulse
CenterPoint I32* Circle center
for each axis
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
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;
Descirption
Figure 9.9.1 Moving from current position and the known circle center to the specified height in
Z-axis direction
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
Array for each axis (node ID); the array number should
….
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
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
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
Array for each axis (node ID); the array number should
….
Array for each Array for each axis (slot ID); the array number should
SlotArray U16*
slot equal to the axis number
below:
ArcNodeBit U16 Value
As shown in figure 9.11.1, M1 and M2 is motion path
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
circle center.
circle center.
arc motion
Mode U16 Option
2: M1 is the path of arc motion and M2 is the path of
linear motion
Parameter I32 Value When this value is set to 0, it means it will not
_ECAT_Slave_CSP_Speed_Continue_Set_Combine
angle.
ignored.
ArcAngle2 F64 Angle (°)
If M2 is the path of arc motion, this value is the arc
angle.
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
Example
U16 Status;
U16 CardNo=0, AxisNum =2, AxisArray [2]={1,2}, SlotArray [2]={0, 0}, ArcNodeBit = 0;
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
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I16Enable=1;
F64 Nummerator=1.0, Denominator=2.0;
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
Mode U16 Option 2: Motor decelerates to stop after reaching the limit
Example
U16 Status;
U16 CardNo=16,AxisNo=1,SlotNo=0;
I16 PosiLimit =1000000, NegaLimit =-1000000, Mode =1;
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
Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
I32 NewTargetCmd =2000000;
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
Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0;
I32 NewTargetSpd =1000000;
F64 Tsec=0.1;
Description
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
is at constant speed.
1000%.
replaced.
NewSpeed I32 Pulse / second
When Mode is set to 2, input the speed rator to be
Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Mode=0;
I32 NewSpeed =3000;
F64 Tsec=0.1;
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.
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.
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.
9 ConstVel = 1000
ConstVel = 1200
ConstVel = 1100
Acc. Tsec
Figure 9.16.3 Set Mode to 2 to change the speed ratio of constant speed for all commands
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
Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Enable=1;
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
Example
U16Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Mode=1;
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:
20000
2
0
0
0
0
Figure 9.18.2
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
Figure 9.18.3
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
Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Ratio=100;
Description
Set Ratio to 100:
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
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;
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
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
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
Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Mode=1;
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.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
Array for each axis (node ID); the array number should
….
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;
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
….
Array for each Array for each axis (slot ID); the array number should
SlotArray U16*
slot equal to the axis number
1: Enable
Example
U16 Status;
U16 CardNo = 16, AxisNum = 2, AxisArray[2] = {0, 1}, SlotArray[2] = {0, 0};
U16 Enable = 1;
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
Example
U16 Status;
U16 CardNo=16;
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
(section 9.17). However, it takes effect only in the path that is being executed by this API.
Parameter
Name Data type Property Description
….
Array for each Array for each axis (slot ID); the array number should
SlotArray U16*
slot equal to the axis number
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
….
number
Target2Point I32*
Array of pulse
axis
9
….
Tacc_Step1 F64 Time (second) The time it spent to change from First_ConstVel to 0
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;
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
Segment mode:
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
1: T-curve (default)
Scurve U16 Option
2: S-curve
Example
U16 Status;
(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.
(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
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
Array of
TargetTime I32* Target time
milisecond
Array of
TargetVel I32* Target speed (Unit: pulse / second)
velocity
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);
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
Array of
TargetTime I32* Target time
milisecond
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);
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
Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Enable=1;
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
Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Command=0;
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
positive limit.
Status U16* Value
Bit 0: Negative limit
Example
U16 Status;
U16 CardNo=16, NodeID=7, SlotNo=0, Status=0;
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
Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Interval=0
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
Compensation mode:
1: Dual-direction compensation
Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Mode=0;
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
Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Dir=0;
I32 OrgPos=0;
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
direction.
Dir U16 Option
0: Set the compensation value for positive direction
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};
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
direction.
Dir U16 Option
0: Set the compensation value for positive direction
Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Dir=0, Num=0;
I32 Table[3]={0, 1, 2};
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
1: Enable
Example
U16 Status;
U16 CardNo = 16, AxisNo=0, SlotNo=0, Enable=1
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.
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
Target speed
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.
1: T-curve (Default)
Curve_Mode U16 Option
2: S-curve
Acceleration unit:
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;
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
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.
1: T-curve(Default)
Curve_Mode U16 Option
2: S-curve
Acceleration unit:
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};
11
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.
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
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;
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
AxisNum U16 Quantity Refer to section 2.1 for information about suggested
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};
11
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 _ECAT_Slave_Home_Move
_ECAT_Slave_Home_Status
Execute 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
Homing mode
Mode U16 Mode Please refer to the manual of the slave device for more
Homing offset
speed)
FirstVel U32 inc/second inc signifies the unit set in the slave device. Please
Example
U16 Status;
U16 CardNo=16, AxisNo=1, SlotNo=0, Mode=1;
12 I32 Offset=200;
U32 FirstVel =600000, SecondVel =100000;
U32 Acceleration = 3;
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
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
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
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
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
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
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
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
H
L
Motor Position
E S
L
H
Speed
L
Motor E Position
S
L
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
H
Motor E Position
S
L
H
Speed
L
Motor S Position
E
L
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
H
L
Motor Position
E S
H
Speed
L
Motor Position
S E
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
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
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
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
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.
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
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.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
Example
U16 Status;
U16 CardNo=1, AxisNo=1, SlotNo=0;
/*Start homing*/
Status = _ECAT_Slave_Home_Move (CardNo, AxisNo, SlotNo);
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
Status:
1: Homing in progress
Status U16* Status
2: Homing terminated while the procedure is not
completed
Example
U16 Status;
U16 CardNo=1, AxisNo=1, SlotNo=0;
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
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.
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
0x607A Sub 0)
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)
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
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
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.
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;
13
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
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.
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
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;
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
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
reached”.
Velocity_Window U16 Inc/s inc signifies the unit set in the slave device. Please
Velocity_Window_Time.
Velocity_Threshold U16 Inc/s Specify the speed range (Address: 0x606F Sub 0)
Sub 0)
“ _ECAT_Slave_Motion_Get_StatusWord” will be
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;
14
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
(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
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;
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
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.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
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;
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
Bit 1 → Torque_Profile
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;
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 _ECAT_Slave_User_Motion_Control_Set_Enable_
Mode
*Please note that before enabling the group, users
_ECAT_Slave_User_Motion_Control_Get_Alm to
_ECAT_Slave_User_Motion_Control_Get_Enable_
Acquire the status in the current group.
Mode
_ECAT_Slave_User_Motion_Control_ Ralm Reset the alarm of all axes in the specified group.
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
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.
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.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
Status:
0: Disable
Mode U16* Option
1: Enable
2: Pause
Example
U16 Status;
U16 CardNo=16, GroupNo=1;
U16 Mode;
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
Array for each axis (node ID); the array number should
….
Array for Array for each axis (slot ID); the array number should
SlotNo U16*
each slot equal to the axis number
sequence.
Type U16 Option
1: User-defined path (CSP mode); When applying this
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.
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
Example
U16 Status;
U16 CardNo=16, GroupNo=1;
I32 DataArray[2]={12,33};
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
Example
U16 Status;
U16 CardNo=16, GroupNo=1;
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
Counter U16* Value Data number that has not been processed
Example
U16 Status;
U16 CardNo=16, GroupNo=1;
U16 Counter;
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
Example
U16 Status;
U16 CardNo=16, GroupNo=1;
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
Example
U16 Status;
U16 CardNo=16, GroupNo=1;
U16 ON_OFF=1;
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
Alarm description
Alm U16* Status 0: No alarm occurs
Example
U16 Status;
U16 CardNo=16, GroupNo=1;
U16 Alm;
17
18 _ECAT_Slave_DIO_Get_Output_Value
_ECAT_Slave_DIO_Set_Output_Value
_ECAT_Slave_DIO_Get_Single_Input_Value
Acquire the DO status
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
Example
U16 Status;
U16 CardNo=16, NodeID=1, SlotNo=0;
U16 Value;
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
Example
U16 Status;
U16 CardNo=16, NodeID=1, SlotNo=0;
U16 Value;
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
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;
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
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;
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
Example
U16 Status;
U16 CardNo=16, NodeID=1, SlotNo=0, BitNum=1;
U16 Value;
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
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;
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
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;
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
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;
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 _ECAT_Slave_AIO_Set_Output_Value
_ECAT_Slave_AIO_Get_Output_Value
Set analog output value
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
Example
U16 Status=0;
U16 CardNo=16, NodeID=1, SlotNo=0;
U16 Value;
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
Example
U16 Status=0;
U16 CardNo=16, NodeID =1, SlotNo=0;
U16 Value=0x5ff;
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
Example
U16 Status=0;
U16 CardNo=16, NodeID=1, SlotNo=0;
U16 Value=0;
19
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
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;
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;
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;
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;
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
Example
U16 Status = 0;
U16 CardNo=16 , AxisNo =1, SlotNo=0;
U16 Mode=0;
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;
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;
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;
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;
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;
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;
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
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.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;
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;
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;
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;
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
Example
U16 Status = 0;
U16 CardNo=16 , AxisNo =1, SlotNo=0;
U16 Mode=0;
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;
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;
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;
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;
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;
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
Example
U16 Status = 0;
U16 CardNo=16, NodeID =7, SlotNo=0;
U16 IOStatus, BitNo=1;
21
22 _ECAT_Slave_DeltaServo_Read_Parameter
_ECAT_Slave_DeltaServo_Read_Parameter_Info
Read servo parameter values from Delta servo drives
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;
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;
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;
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;
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
Example
U16 Status = 0;
U16 CardNo=16, AxisNo = 1, SlotNo = 0, Enable=1, CompareSource=1, SignalLength=1,
SignalPolarity=1;
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;
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;
22
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.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;
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
Example
U16 Status = 0;
U16 CardNo=16 , NodeID =1, SlotNo=0;
U16 Mode=2;
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;
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;
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
Example
U16 Status = 0;
U16 CardNo=16 , NodeID =1, SlotNo=0;
U16 Avg_Times =5;
23
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
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
Example
U16 Status = 0;
U16 CardNo=16, NodeID =1, SlotNo=0;
U16 RangeMode=3;
24.2 _ECAT_Slave_R1_EC9144_Set_Output_Enable
Syntax
U16 PASCAL _ECAT_Slave_R1_EC9144_Set_Output_Enable(U16 CardNo, U16 NodeID, U16
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;
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);
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
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
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
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
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.
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
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.
1: Output
Example
U16 Status = 0;
U16 CardNo=16 , NodeID =1, SlotNo=0;
U16 MonitorIndex =0;
U16 IOType =0, Index=0x607A, SubIndex=1;
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;
// 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.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 ;
while (1)
{
Status= _ECAT_Slave_Record_Get_Cnt (CardNo, NodeID, SlotNo, &Cnt);
}
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
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];
while (1)
{
Status= _ECAT_Slave_Record_Get_Cnt (CardNo, NodeID, SlotNo, &Cnt);
if (Cnt>0)
{
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;
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;
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);
25
_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
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 );
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.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 );
26
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.
_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
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;
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;
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
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
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
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;
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;
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.
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;
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
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;
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.
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;
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.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.
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”.
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.
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.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.
Example
U16 CardNo = 0;
U16 io_status;
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;
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.
Example
U16 CardNo = 0;
I32 pos_table[4] = {1000,2000,3000,4000};
U32 table_size =4;
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.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).
Description
As shown in the above example, level_table is a data array. It translates the trigger state at the
32 positions into a 32-bit value. Then, these values are input in the array. Find more information
In 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”.
Figure 27.12.4 Output mode of user-defined intervals and trigger level (Incorrect)
27
U16 PASCAL _ECAT_Compare_Get_Channel1_Position_Table_Count (U16 CardNo,
U32* cnt)
Purpose
Acquire the current trigger counts of channel 1.
Parameter
Example
U16 CardNo = 0;
U32 cnt;
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
Example
U16 CardNo = 0;
U16 inverse = 1;
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
Example
U16 CardNo = 0;
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
Example
U16 CardNo = 0;
27
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 _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);
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;
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);
28
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
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 );
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.
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.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);
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:
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.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};
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:
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.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);
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;
}
}
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;
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;
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;
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;
30
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
Example
U16 Status = 0;
U16 CardNo = 16, NodeID = 0, SlotNo = 0;
U16 Enable = 1; // Enable digital output of R1-EC70E2D0.
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.
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
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
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};
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
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.
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};
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 description
Bit Definition Bit Definition
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
Example
33
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.
ERR_ECAT_ENVIRONMENT_
18 The Autoconfig file is not found.
RECORD_DISABLE
ERR_ECAT_ENVIRONMENT_
20 Fail to open the Autoconfig file.
RECORD_FILE_OPEN
in error.
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
3840 ERR_ESI_INITIAL Information) file or the ESI file has not been
initialized.
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.
PDO channel.
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.
4612 ERR_ECAT_MODE_NOT_ SUPPORT This API is not supported in this motion mode.
4620 ERR_ECAT_HOME_SECOND_ SPEED found, the speed setting is wrong when it looks
for Z pulse.
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
Returned
value Name of the error code Description
(Decimal)
This function fails to access the security
34
12290 ERR_ECAT_SECURITY_CONNECT
kernel.
ERR_PATH_ECAT_ECAM_
32827 The master axis of E-cam is not set.
MASTERSOURCE
ERR_RTX_ERRORLOG_COUNT_
53761 The specified index of error count is wrong.
ERROR
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.
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
error.
ERR_ECAT_SAME_CARD_
61445 Repeated RTSS or motion card number.
NUMBER
Returned
value Name of the error code Description
(Decimal)
65535 ERR_ECAT_LOADLIB_EMPTY Fail to call DLL resource in RTSS.
34
34
Name of error
ERR_ECAT_NO_ERROR
code
Description No error.
Troubleshooting N/A
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
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
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.
34 Description
Troubleshooting
EtherCAT kernel – Fail to create the scheduler function due to system
configuration error.
N/A
34 Description
Troubleshooting
The data of Object section cannot be created.
Check if the file format of ESI (EtherCAT Slave Information) is correct.
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.
34 Description
Troubleshooting
The motor has to be enabled before executing the API.
Use “ECAT_Slave_Motion_Set_Svon” to enable the motor.
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.
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.
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
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.
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.
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.
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.
Restart the PAC or PC and try again. If this error occurs frequently, please
Troubleshooting
contact Delta.
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.
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.
Description
Troubleshooting
Connection error of the motion card and the driver.
34
ERR_CARD_UPGRADE_NO_RESOURSE
code
Description No update file (EtherCAT_DLL) is found.
Troubleshooting Please check the DLL version and operating system.
34 Description
Troubleshooting
Cannot acquire the version information of DLL.
Please check the version of DLL.
March, 2017 1
Revision History EtherCAT Programming Guide
2 March, 2017