Delta EtherCAT Programming Manual page 25

Table of Contents

Advertisement

EtherCAT Operation Example
(2) Initialize interface card
3
Press the Initial key to execute the following program:
for(i=0; i< gESCExistCards; i++)
{
}
RetCode = _ECAT_Master_Check_Initial_Done(gESCCardNo, &InitialDone);
/* Get the Initial status. */
// Display the Initial Status:
// InitialDone = 1: Display "Pre Initial"
// InitialDone = 0: Display "Initial Done"
// InitialDone = 99: Display "Initial Error"
(3) Set the information of the connected modules
Press the Find Slave key to execute the following program:
RetCode = _ECAT_Master_Get_SlaveNum(gESCCardNo, &SlaveNum);
// Get the number of the connected modules.
When the above program completes, the number of the found Slave devices will be
displayed in Slave Num field.
3-4
RetCode = _ECAT_Master_Get_CardSeq(i, &CardNo);
/* Get the card No. of the PC interface Card i. This card No. is the dip switch value.
EtherCAT card number in RTX version is 16. */
RetCode = _ECAT_Master_Initial(CardNo);
/* Start to initialize the interface card. */
if(RetCode != 0)
{
strMsg.Format("_ECAT_Master_Initial, RetCode = %d", RetCode);
MessageBox(strMsg);
}
Figure 3.1.2.3
Figure 3.1.2.5
EtherCAT Programming Guide
March, 2017

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents