00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00046 #ifndef _ethercatcoe_
00047 #define _ethercatcoe_
00048
00049 #ifdef __cplusplus
00050 extern "C"
00051 {
00052 #endif
00053
00055 #define EC_MAXODLIST 1024
00056
00058 #define EC_MAXOELIST 256
00059
00060
00061 typedef struct
00062 {
00064 uint16 Slave;
00066 uint16 Entries;
00068 uint16 Index[EC_MAXODLIST];
00070 uint16 DataType[EC_MAXODLIST];
00072 uint8 ObjectCode[EC_MAXODLIST];
00074 uint8 MaxSub[EC_MAXODLIST];
00076 char Name[EC_MAXODLIST][EC_MAXNAME+1];
00077 } ec_ODlistt;
00078
00079
00080 typedef struct
00081 {
00083 uint16 Entries;
00085 uint8 ValueInfo[EC_MAXOELIST];
00087 uint16 DataType[EC_MAXOELIST];
00089 uint16 BitLength[EC_MAXOELIST];
00091 uint16 ObjAccess[EC_MAXOELIST];
00093 char Name[EC_MAXOELIST][EC_MAXNAME+1];
00094 } ec_OElistt;
00095
00096 #ifdef EC_VER1
00097 void ec_SDOerror(uint16 Slave, uint16 Index, uint8 SubIdx, int32 AbortCode);
00098 int ec_SDOread(uint16 slave, uint16 index, uint8 subindex,
00099 boolean CA, int *psize, void *p, int timeout);
00100 int ec_SDOwrite(uint16 Slave, uint16 Index, uint8 SubIndex,
00101 boolean CA, int psize, void *p, int Timeout);
00102 int ec_RxPDO(uint16 Slave, uint16 RxPDOnumber , int psize, void *p);
00103 int ec_TxPDO(uint16 slave, uint16 TxPDOnumber , int *psize, void *p, int timeout);
00104 int ec_readPDOmap(uint16 Slave, int *Osize, int *Isize);
00105 int ec_readPDOmapCA(uint16 Slave, int *Osize, int *Isize);
00106 int ec_readODlist(uint16 Slave, ec_ODlistt *pODlist);
00107 int ec_readODdescription(uint16 Item, ec_ODlistt *pODlist);
00108 int ec_readOEsingle(uint16 Item, uint8 SubI, ec_ODlistt *pODlist, ec_OElistt *pOElist);
00109 int ec_readOE(uint16 Item, ec_ODlistt *pODlist, ec_OElistt *pOElist);
00110 #endif
00111
00112 void ecx_SDOerror(ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIdx, int32 AbortCode);
00113 int ecx_SDOread(ecx_contextt *context, uint16 slave, uint16 index, uint8 subindex,
00114 boolean CA, int *psize, void *p, int timeout);
00115 int ecx_SDOwrite(ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIndex,
00116 boolean CA, int psize, void *p, int Timeout);
00117 int ecx_RxPDO(ecx_contextt *context, uint16 Slave, uint16 RxPDOnumber , int psize, void *p);
00118 int ecx_TxPDO(ecx_contextt *context, uint16 slave, uint16 TxPDOnumber , int *psize, void *p, int timeout);
00119 int ecx_readPDOmap(ecx_contextt *context, uint16 Slave, int *Osize, int *Isize);
00120 int ecx_readPDOmapCA(ecx_contextt *context, uint16 Slave, int *Osize, int *Isize);
00121 int ecx_readODlist(ecx_contextt *context, uint16 Slave, ec_ODlistt *pODlist);
00122 int ecx_readODdescription(ecx_contextt *context, uint16 Item, ec_ODlistt *pODlist);
00123 int ecx_readOEsingle(ecx_contextt *context, uint16 Item, uint8 SubI, ec_ODlistt *pODlist, ec_OElistt *pOElist);
00124 int ecx_readOE(ecx_contextt *context, uint16 Item, ec_ODlistt *pODlist, ec_OElistt *pOElist);
00125
00126 #ifdef __cplusplus
00127 }
00128 #endif
00129
00130 #endif