ethercatsoe.h
Go to the documentation of this file.
1 /*
2  * Simple Open EtherCAT Master Library
3  *
4  * File : ethercatsoe.h
5  * Version : 1.3.0
6  * Date : 24-02-2013
7  * Copyright (C) 2005-2013 Speciaal Machinefabriek Ketels v.o.f.
8  * Copyright (C) 2005-2013 Arthur Ketels
9  * Copyright (C) 2008-2009 TU/e Technische Universiteit Eindhoven
10  *
11  * SOEM is free software; you can redistribute it and/or modify it under
12  * the terms of the GNU General Public License version 2 as published by the Free
13  * Software Foundation.
14  *
15  * SOEM is distributed in the hope that it will be useful, but WITHOUT ANY
16  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18  * for more details.
19  *
20  * As a special exception, if other files instantiate templates or use macros
21  * or inline functions from this file, or you compile this file and link it
22  * with other works to produce a work based on this file, this file does not
23  * by itself cause the resulting work to be covered by the GNU General Public
24  * License. However the source code for this file must still be made available
25  * in accordance with section (3) of the GNU General Public License.
26  *
27  * This exception does not invalidate any other reasons why a work based on
28  * this file might be covered by the GNU General Public License.
29  *
30  * The EtherCAT Technology, the trade name and logo “EtherCAT” are the intellectual
31  * property of, and protected by Beckhoff Automation GmbH. You can use SOEM for
32  * the sole purpose of creating, using and/or selling or otherwise distributing
33  * an EtherCAT network master provided that an EtherCAT Master License is obtained
34  * from Beckhoff Automation GmbH.
35  *
36  * In case you did not receive a copy of the EtherCAT Master License along with
37  * SOEM write to Beckhoff Automation GmbH, Eiserstraße 5, D-33415 Verl, Germany
38  * (www.beckhoff.com).
39  */
40 
46 #ifndef _ethercatsoe_
47 #define _ethercatsoe_
48 
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif
53 
54 #define EC_SOE_DATASTATE_B 0x01
55 #define EC_SOE_NAME_B 0x02
56 #define EC_SOE_ATTRIBUTE_B 0x04
57 #define EC_SOE_UNIT_B 0x08
58 #define EC_SOE_MIN_B 0x10
59 #define EC_SOE_MAX_B 0x20
60 #define EC_SOE_VALUE_B 0x40
61 #define EC_SOE_DEFAULT_B 0x80
62 
63 #define EC_SOE_MAXNAME 60
64 #define EC_SOE_MAXMAPPING 64
65 
66 #define EC_IDN_MDTCONFIG 24
67 #define EC_IDN_ATCONFIG 16
68 
70 PACKED_BEGIN
71 typedef struct PACKED
72 {
78 } ec_SoEnamet;
79 PACKED_END
80 
82 PACKED_BEGIN
83 typedef struct PACKED
84 {
89  union
90  {
91  uint8 byte[8];
95  };
96 } ec_SoElistt;
97 PACKED_END
98 
100 PACKED_BEGIN
101 typedef struct PACKED
102 {
109 PACKED_END
110 
111 #define EC_SOE_LENGTH_1 0x00
112 #define EC_SOE_LENGTH_2 0x01
113 #define EC_SOE_LENGTH_4 0x02
114 #define EC_SOE_LENGTH_8 0x03
115 #define EC_SOE_TYPE_BINARY 0x00
116 #define EC_SOE_TYPE_UINT 0x01
117 #define EC_SOE_TYPE_INT 0x02
118 #define EC_SOE_TYPE_HEX 0x03
119 #define EC_SOE_TYPE_STRING 0x04
120 #define EC_SOE_TYPE_IDN 0x05
121 #define EC_SOE_TYPE_FLOAT 0x06
122 #define EC_SOE_TYPE_PARAMETER 0x07
123 
125 PACKED_BEGIN
126 typedef struct PACKED
127 {
149 PACKED_END
150 
151 #ifdef EC_VER1
152 int ec_SoEread(uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout);
153 int ec_SoEwrite(uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout);
154 int ec_readIDNmap(uint16 slave, int *Osize, int *Isize);
155 #endif
156 
157 int ecx_SoEread(ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout);
158 int ecx_SoEwrite(ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout);
159 int ecx_readIDNmap(ecx_contextt *context, uint16 slave, int *Osize, int *Isize);
160 
161 #ifdef __cplusplus
162 }
163 #endif
164 
165 #endif
#define EC_SOE_MAXMAPPING
Definition: ethercatsoe.h:64
uint32 dword[2]
Definition: ethercatsoe.h:93
PACKED_END PACKED_BEGIN struct PACKED ec_SoElistt
uint8_t uint8
Definition: osal.h:33
PACKED_BEGIN struct PACKED ec_SoEattributet
int ecx_readIDNmap(ecx_contextt *context, uint16 slave, int *Osize, int *Isize)
Definition: ethercatsoe.c:346
#define EC_SOE_MAXNAME
Definition: ethercatsoe.h:63
uint64 lword[1]
Definition: ethercatsoe.h:94
uint8 byte[8]
Definition: ethercatsoe.h:91
uint16_t uint16
Definition: osal.h:34
uint8 driveNo
Definition: ethercatsoe.c:65
uint16 maxlength
Definition: ethercatsoe.h:76
uint32 reserved1
Definition: ethercatsoe.h:138
uint16 idn
Definition: ethercatsoe.c:69
uint32 reserved2
Definition: ethercatsoe.h:147
int ec_SoEwrite(uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout)
Definition: ethercatsoe.c:410
int ec_SoEread(uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout)
Definition: ethercatsoe.c:405
uint32 wppreop
Definition: ethercatsoe.h:142
int slave
Definition: aliastool.c:51
uint32 wpop
Definition: ethercatsoe.h:146
int ec_readIDNmap(uint16 slave, int *Osize, int *Isize)
Definition: ethercatsoe.c:415
PACKED_END int ecx_SoEread(ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout)
Definition: ethercatsoe.c:112
uint64_t uint64
Definition: osal.h:37
uint32 wpsafeop
Definition: ethercatsoe.h:144
uint8 elementflags
Definition: ethercatsoe.c:66
PACKED_END PACKED_BEGIN struct PACKED ec_SoEmappingt
uint32 evafactor
Definition: ethercatsoe.h:129
PACKED_BEGIN struct PACKED ec_SoEnamet
uint16 length
Definition: ethercatmain.h:347
int ecx_SoEwrite(ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout)
Definition: ethercatsoe.c:234
uint32 decimals
Definition: ethercatsoe.h:140
uint16 word[4]
Definition: ethercatsoe.h:92
uint32 list
Definition: ethercatsoe.h:133
uint32_t uint32
Definition: osal.h:35
uint32 datatype
Definition: ethercatsoe.h:137
char name[EC_SOE_MAXNAME]
Definition: ethercatsoe.h:77
uint16 currentlength
Definition: ethercatsoe.h:74
uint32 command
Definition: ethercatsoe.h:135


soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Sat Jun 8 2019 18:02:17