46 #ifndef _ethercatmain_ 47 #define _ethercatmain_ 56 #define EC_MAXELIST 64 60 #define EC_MAXSLAVE 200 64 #define EC_MAXIOSEGMENTS 64 66 #define EC_MAXMBX 0x3ff 68 #define EC_MAXEEPDO 0x200 74 #define EC_MAXLEN_ADAPTERNAME 128 120 #define ECT_MBXPROT_AOE 0x0001 121 #define ECT_MBXPROT_EOE 0x0002 122 #define ECT_MBXPROT_COE 0x0004 123 #define ECT_MBXPROT_FOE 0x0008 124 #define ECT_MBXPROT_SOE 0x0010 125 #define ECT_MBXPROT_VOE 0x0020 127 #define ECT_COEDET_SDO 0x01 128 #define ECT_COEDET_SDOINFO 0x02 129 #define ECT_COEDET_PDOASSIGN 0x04 130 #define ECT_COEDET_PDOCONFIG 0x08 131 #define ECT_COEDET_UPLOAD 0x10 132 #define ECT_COEDET_SDOCA 0x20 134 #define EC_SMENABLEMASK 0xfffeffff 456 int (*FOEhook)(
uint16 slave,
int packetnumber,
int datasize);
465 extern int ec_slavecount;
468 extern boolean EcatError;
469 extern int64 ec_DCtime;
473 boolean ec_iserror(
void);
475 int ec_init(
char * ifname);
476 int ec_init_redundant(
char *ifname,
char *if2name);
485 int ec_readstate(
void);
486 int ec_writestate(
uint16 slave);
488 int ec_mbxempty(
uint16 slave,
int timeout);
489 int ec_mbxsend(
uint16 slave,ec_mbxbuft *mbx,
int timeout);
490 int ec_mbxreceive(
uint16 slave, ec_mbxbuft *mbx,
int timeout);
494 int ec_eeprom2master(
uint16 slave);
495 int ec_eeprom2pdi(
uint16 slave);
502 int ec_send_processdata_group(
uint8 group);
503 int ec_receive_processdata_group(
uint8 group,
int timeout);
504 int ec_send_processdata(
void);
505 int ec_receive_processdata(
int timeout);
void ecx_siistring(ecx_contextt *context, char *str, uint16 slave, uint16 Sn)
#define EC_MAXLEN_ADAPTERNAME
void ecx_close(ecx_contextt *context)
int ecx_receive_processdata(ecx_contextt *context, int timeout)
char name[EC_MAXLEN_ADAPTERNAME]
uint16 ecx_siiSMnext(ecx_contextt *context, uint16 slave, ec_eepromSMt *SM, uint16 n)
int ecx_send_processdata_group(ecx_contextt *context, uint8 group)
void ecx_pusherror(ecx_contextt *context, const ec_errort *Ec)
void ec_clearmbx(ec_mbxbuft *Mbx)
int ecx_writeeepromAP(ecx_contextt *context, uint16 aiadr, uint16 eeproma, uint16 data, int timeout)
void ecx_packeterror(ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIdx, uint16 ErrorCode)
int ecx_init(ecx_contextt *context, char *ifname)
boolean ecx_iserror(ecx_contextt *context)
int ecx_receive_processdata_group(ecx_contextt *context, uint8 group, int timeout)
int ecx_eeprom2pdi(ecx_contextt *context, uint16 slave)
PACKED_END PACKED_BEGIN struct PACKED ec_state_status
uint64 ecx_readeepromAP(ecx_contextt *context, uint16 aiadr, uint16 eeproma, int timeout)
char desc[EC_MAXLEN_ADAPTERNAME]
uint16 ecx_statecheck(ecx_contextt *context, uint16 slave, uint16 reqstate, int timeout)
int16 ecx_siifind(ecx_contextt *context, uint16 slave, uint16 cat)
PACKED_END PACKED_BEGIN struct PACKED ec_PDOassignt
uint64 ecx_readeepromFP(ecx_contextt *context, uint16 configadr, uint16 eeproma, int timeout)
int ecx_mbxempty(ecx_contextt *context, uint16 slave, int timeout)
PACKED_BEGIN struct PACKED ec_mbxheadert
int ecx_writeeepromFP(ecx_contextt *context, uint16 configadr, uint16 eeproma, uint16 data, int timeout)
int ecx_writestate(ecx_contextt *context, uint16 slave)
uint32 ecx_readeeprom(ecx_contextt *context, uint16 slave, uint16 eeproma, int timeout)
void ec_free_adapters(ec_adaptert *adapter)
int ecx_writeeeprom(ecx_contextt *context, uint16 slave, uint16 eeproma, uint16 data, int timeout)
int ecx_readstate(ecx_contextt *context)
ec_adaptert * ec_find_adapters(void)
uint8 ec_nextmbxcnt(uint8 cnt)
int ecx_siiPDO(ecx_contextt *context, uint16 slave, ec_eepromPDOt *PDO, uint8 t)
void ecx_readeeprom1(ecx_contextt *context, uint16 slave, uint16 eeproma)
PACKED_END PACKED_BEGIN struct PACKED ec_PDOdesct
int ecx_mbxsend(ecx_contextt *context, uint16 slave, ec_mbxbuft *mbx, int timeout)
ec_PDOassignt * PDOassign
int ecx_eeprom2master(ecx_contextt *context, uint16 slave)
uint16 ecx_siiSM(ecx_contextt *context, uint16 slave, ec_eepromSMt *SM)
void ecx_esidump(ecx_contextt *context, uint16 slave, uint8 *esibuf)
ec_SMcommtypet * SMcommtype
int ecx_send_processdata(ecx_contextt *context)
int ecx_init_redundant(ecx_contextt *context, ecx_redportt *redport, char *ifname, char *if2name)
uint32 ecx_readeeprom2(ecx_contextt *context, uint16 slave, int timeout)
PACKED_BEGIN struct PACKED ec_fmmut
boolean ecx_poperror(ecx_contextt *context, ec_errort *Ec)
PACKED_END PACKED_BEGIN struct PACKED ec_alstatust
uint16 ecx_siiFMMU(ecx_contextt *context, uint16 slave, ec_eepromFMMUt *FMMU)
int ecx_mbxreceive(ecx_contextt *context, uint16 slave, ec_mbxbuft *mbx, int timeout)
PACKED_END PACKED_BEGIN struct PACKED ec_smt
uint8 ecx_siigetbyte(ecx_contextt *context, uint16 slave, uint16 address)
PACKED_BEGIN struct PACKED ec_SMcommtypet
uint8 ec_mbxbuft[EC_MAXMBX+1]