Delta EtherCAT Programming Manual page 57

Table of Contents

Advertisement

EtherCAT Operation Example
(26) Status display
3
Command values of the motion:
RetCode = _ECAT_Slave_Motion_Get_Command(gESCCardNo, gNodeID, gSlotID,
&Cmd);
// Get the command value (CMD. field).
RetCode = _ECAT_Slave_Motion_Get_Position(gESCCardNo, gNodeID, gSlotID, &Pos);
// Get the feedback value of the command (FBK. field).
Motion status:
RetCode = _ECAT_Slave_Motion_Get_Current_Speed(gESCCardNo,gNodeID, gSlotID,
&Spd);
// Get the moving speed (SPD. field).
RetCode = _ECAT_Slave_Motion_Get_StatusWord(gESCCardNo, gNodeID, gSlotID,
&Status);
// Get the current status (IO Sts. field).
RetCode = _ECAT_Slave_Motion_Get_Mdone(gESCCardNo, gNodeID, gSlotID,
&MCDone);
// Get the current status of the motor (Motion field).
RetCode = _ECAT_Slave_Motion_Get_Buffer_Length(gESCCardNo, gNodeID, gSlotID,
&BufLen);
// Get the current buffer status (Buffer field).
(27) Reset the feedback position and clear the alarm
Press the RESET key (as shown in figure 3.6.2.4) to execute the following program:
RetCode = _ECAT_Slave_Motion_Set_Position(gESCCardNo, gNodeID, gSlotID, 0);
// Clear feedback first (Value in servo drive panel will be set to 0).
RetCode = _ECAT_Slave_Motion_Set_Command(gESCCardNo, gNodeID, gSlotID, 0);
// Then, clear the command.
Press the RALM key (as shown in figure 3.6.2.4) to execute the alarm clearing command:
RetCode = _ECAT_Slave_Motion_Ralm(gESCCardNo, gNodeID, gSlotID);
// Clear the alarm of slave station.
3-36
Figure 3.6.2.12
EtherCAT Programming Guide
March, 2017

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents