63 #define EC_LOCALDELAY 200
130 boolean EcatError =
FALSE;
382 mapb = address - (mapw << 5);
386 retval = context->
esibuf[address];
409 mapb = (eadr << 1) - (mapw << 5);
410 for(lp = 0 ; lp < cnt ; lp++)
413 context->
esimap[mapw] |= (1 << mapb);
421 retval = context->
esibuf[address];
445 while ((p != cat) && (p != 0xffff))
488 for (i = 1; i <= Sn; i++)
498 for (j = 1; j <= l; j++)
645 uint16 a , w, c, e, er, Size;
678 for (er = 1; er <= e; er++)
716 uint16 slave, configadr, lowest, rval;
721 for (slave = 1; slave <= *(context->
slavecount); slave++)
725 slstat.alstatuscode = 0;
727 rval =
etohs(slstat.alstatus);
749 uint16 configadr, slstate;
775 uint16 configadr, state, rval;
796 slstat.alstatuscode = 0;
798 rval =
etohs(slstat.alstatus);
801 state = rval & 0x000f;
802 if (state != reqstate)
855 SMstat =
etohs(SMstat);
863 if ((wkc > 0) && ((SMstat & 0x08) == 0))
880 uint16 mbxwo,mbxl,configadr;
913 uint16 mbxro,mbxl,configadr;
933 SMstat =
etohs(SMstat);
941 if ((wkc > 0) && ((SMstat & 0x08) > 0))
948 if ((wkc > 0) && ((mbxh->mbxtype & 0x0f) == 0x00))
954 else if ((wkc > 0) && ((mbxh->mbxtype & 0x0f) == 0x03))
957 if ((
etohs(EMp->CANOpen) >> 12) == 0x01)
969 SMstat =
htoes(SMstat);
971 SMstat =
etohs(SMstat);
979 SMstat =
etohs(SMstat);
1080 int wkc = 1, cnt = 0;
1113 int wkc = 1, cnt = 0;
1134 int wkc, cnt = 0, retval = 0;
1145 *estat =
etohs(*estat);
1169 int wkc, cnt, nackcnt = 0;
1184 ed.addr =
htoes(eeproma);
1229 while ((nackcnt > 0) && (nackcnt < 3));
1247 int wkc, rval = 0, cnt = 0, nackcnt = 0;
1294 while ((nackcnt > 0) && (nackcnt < 3));
1302 int wkc, cnt = 0, retval = 0;
1313 *estat =
etohs(*estat);
1337 int wkc, cnt, nackcnt = 0;
1352 ed.addr =
htoes(eeproma);
1397 while ((nackcnt > 0) && (nackcnt < 3));
1415 int wkc, rval = 0, cnt = 0, nackcnt = 0;
1460 while ((nackcnt > 0) && (nackcnt < 3));
1488 ed.addr =
htoes(eeproma);
1575 int length, sublength;
1579 boolean first=
FALSE;
1580 uint16 currentsegment = 0;
1625 context->
DCl = sublength;
1636 length -= sublength;
1637 LogAdr += sublength;
1639 }
while (length && (currentsegment < context->grouplist[group].nsegments));
1652 if((length - sublength) < 0)
1663 context->
DCl = sublength;
1674 length -= sublength;
1675 LogAdr += sublength;
1677 }
while (length && (currentsegment < context->grouplist[group].nsegments));
1702 context->
DCl = sublength;
1713 length -= sublength;
1714 LogAdr += sublength;
1716 }
while (length && (currentsegment < context->grouplist[group].nsegments));
1738 boolean first =
FALSE;
1760 wkc =
etohs(le_wkc);
1761 memcpy(&le_DCtime, &(context->
port->
rxbuf[idx][context->
DCtO]),
sizeof(le_DCtime));
1778 wkc =
etohs(le_wkc) * 2;
1779 memcpy(&le_DCtime, &(context->
port->
rxbuf[idx][context->
DCtO]),
sizeof(le_DCtime));
1821 boolean ec_iserror(
void)
1842 int ec_init(
char * ifname)
1844 return ecx_init(&ecx_context, ifname);
1847 int ec_init_redundant(
char *ifname,
char *if2name)
1879 return ecx_siiSM (&ecx_context, slave, SM);
1889 return ecx_siiPDO (&ecx_context, slave, PDO, t);
1892 int ec_readstate(
void)
1897 int ec_writestate(
uint16 slave)
1907 int ec_mbxempty(
uint16 slave,
int timeout)
1914 return ecx_mbxsend (&ecx_context, slave, mbx, timeout);
1937 int ec_eeprom2master(
uint16 slave)
1942 int ec_eeprom2pdi(
uint16 slave)
1987 int ec_send_processdata_group(
uint8 group)
1992 int ec_receive_processdata_group(
uint8 group,
int timeout)
1997 int ec_send_processdata(
void)
1999 return ec_send_processdata_group(0);
2002 int ec_receive_processdata(
int timeout)
2004 return ec_receive_processdata_group(0, timeout);