Delta EtherCAT Programming Manual page 35

Table of Contents

Advertisement

EtherCAT Operation Example
(5) Speed control
Press the ← or → key (as shown in figure 3.4.2.4) to execute the following program:
RetCode = _ECAT_Slave_PV_Start_Move(gESCCardNo, gNodeID, gSlotID, Velocity,
3
Tacc, Tdec);
/* Set the parameters of speed mode (the acceleration and deceleration time) and enable
speed control. */
// The servo motor will run in forward direction if the rpm value is greater than 0, and will
run in reverse direction when the rpm value is smaller than 0.
Press the STOP key (as shown in figure 3.4.2.4) to execute the following program:
RetCode = _ECAT_Slave_Motion_Emg_Stop(gESCCardNo, gNodeID, gSlotID);
(6) Status display
Command values of the motion:
RetCode = _ECAT_Slave_Motion_Get_Command(gESCCardNo, gNodeID, gSlotID,
&Cmd);
// Get the command value (CMD. field).
RetCode = _ECAT_Slave_Motion_Get_Position(gESCCardNo, gNodeID, gSlotID, &Pos);
// Get the feedback value of the command (FBK. field).
Motion status:
RetCode = _ECAT_Slave_Motion_Get_Current_Speed(gESCCardNo,gNodeID, gSlotID,
&Spd);
// Get the current moving speed (SPD. field).
RetCode = _ECAT_Slave_Motion_Get_StatusWord(gESCCardNo, gNodeID, gSlotID,
&Status);
// Get the current status (IO Sts. field).
RetCode = _ECAT_Slave_Motion_Get_Mdone(gESCCardNo, gNodeID, gSlotID,
&MCDone);
// Get the current status of the motor. (Motion field)
3-14
Figure 3.4.2.5
EtherCAT Programming Guide
March, 2017

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents