Delta EtherCAT Programming Manual page 39

Table of Contents

Advertisement

EtherCAT Operation Example
(4) Set the servo motor to ON/OFF state (servo on/servo off)
3
Press the SVON key (as shown in figure 3.5.2.4) to execute the following program:
RetCode = _ECAT_Slave_Motion_Set_Svon(gESCCardNo, gNodeID, gSlotID, ON_OFF);
// ON_OFF:
// 0: Servo OFF
// 1: Servo ON
(5) Start to control the motion speed
Press the ← or → key (as shown in figure 3.5.2.4) to execute the following program:
RetCode = _ECAT_Slave_PP_Start_Move(gESCCardNo, gNodeID, gSlotID, Dist, StrVel,
MaxVel, Tacc, Tdec, gbIsABS);
// gblsABS
// 0: relative movement
// 1: absolute movement
(6) Stop the motion
Press the STOP key (as shown in figure 3.5.2.4) to enable emergency stop:
RetCode = _ECAT_Slave_Motion_Emg_Stop(gESCCardNo, gNodeID, gSlotID);
In this example, the movement is stopped urgently by setting the deceleration time to 0.
(7) Status display
Command values of the motion:
RetCode = _ECAT_Slave_Motion_Get_Command(gESCCardNo, gNodeID, gSlotID,
&Cmd);
// Get the command value (CMD. field).
RetCode = _ECAT_Slave_Motion_Get_Position(gESCCardNo, gNodeID, gSlotID, &Pos);
// Get the feedback value of the command (FBK. field).
3-18
Figure 3.5.2.4
Figure 3.5.2.5
EtherCAT Programming Guide
March, 2017

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents