Go to the documentation of this file.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 _ethercatsoe_
00047 #define _ethercatsoe_
00048
00049 #ifdef __cplusplus
00050 extern "C"
00051 {
00052 #endif
00053
00054 #define EC_SOE_DATASTATE_B 0x01
00055 #define EC_SOE_NAME_B 0x02
00056 #define EC_SOE_ATTRIBUTE_B 0x04
00057 #define EC_SOE_UNIT_B 0x08
00058 #define EC_SOE_MIN_B 0x10
00059 #define EC_SOE_MAX_B 0x20
00060 #define EC_SOE_VALUE_B 0x40
00061 #define EC_SOE_DEFAULT_B 0x80
00062
00063 #define EC_SOE_MAXNAME 60
00064 #define EC_SOE_MAXMAPPING 64
00065
00066 #define EC_IDN_MDTCONFIG 24
00067 #define EC_IDN_ATCONFIG 16
00068
00070 PACKED_BEGIN
00071 typedef struct PACKED
00072 {
00074 uint16 currentlength;
00076 uint16 maxlength;
00077 char name[EC_SOE_MAXNAME];
00078 } ec_SoEnamet;
00079 PACKED_END
00080
00082 PACKED_BEGIN
00083 typedef struct PACKED
00084 {
00086 uint16 currentlength;
00088 uint16 maxlength;
00089 union
00090 {
00091 uint8 byte[8];
00092 uint16 word[4];
00093 uint32 dword[2];
00094 uint64 lword[1];
00095 };
00096 } ec_SoElistt;
00097 PACKED_END
00098
00100 PACKED_BEGIN
00101 typedef struct PACKED
00102 {
00104 uint16 currentlength;
00106 uint16 maxlength;
00107 uint16 idn[EC_SOE_MAXMAPPING];
00108 } ec_SoEmappingt;
00109 PACKED_END
00110
00111 #define EC_SOE_LENGTH_1 0x00
00112 #define EC_SOE_LENGTH_2 0x01
00113 #define EC_SOE_LENGTH_4 0x02
00114 #define EC_SOE_LENGTH_8 0x03
00115 #define EC_SOE_TYPE_BINARY 0x00
00116 #define EC_SOE_TYPE_UINT 0x01
00117 #define EC_SOE_TYPE_INT 0x02
00118 #define EC_SOE_TYPE_HEX 0x03
00119 #define EC_SOE_TYPE_STRING 0x04
00120 #define EC_SOE_TYPE_IDN 0x05
00121 #define EC_SOE_TYPE_FLOAT 0x06
00122 #define EC_SOE_TYPE_PARAMETER 0x07
00123
00125 PACKED_BEGIN
00126 typedef struct PACKED
00127 {
00129 uint32 evafactor :16;
00131 uint32 length :2;
00133 uint32 list :1;
00135 uint32 command :1;
00137 uint32 datatype :3;
00138 uint32 reserved1 :1;
00140 uint32 decimals :4;
00142 uint32 wppreop :1;
00144 uint32 wpsafeop :1;
00146 uint32 wpop :1;
00147 uint32 reserved2 :1;
00148 } ec_SoEattributet;
00149 PACKED_END
00150
00151 #ifdef EC_VER1
00152 int ec_SoEread(uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout);
00153 int ec_SoEwrite(uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout);
00154 int ec_readIDNmap(uint16 slave, int *Osize, int *Isize);
00155 #endif
00156
00157 int ecx_SoEread(ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout);
00158 int ecx_SoEwrite(ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout);
00159 int ecx_readIDNmap(ecx_contextt *context, uint16 slave, int *Osize, int *Isize);
00160
00161 #ifdef __cplusplus
00162 }
00163 #endif
00164
00165 #endif