Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / plugins / epan / ethercat / packet-ams.h
blob006fc54812a8678bb8283b45032f14708a41f18f
1 /* packet-ams.h
3 * Copyright (c) 2007 by Beckhoff Automation GmbH
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __PACKET_AMS_H__
13 #define __PACKET_AMS_H__
15 /* FIXED PORTS */
17 #define AMSPORT_ROUTER 1
18 #define AMSPORT_DEBUGGER 2
20 #define AMSPORT_LOGGER 100
21 #define AMSPORT_EVENTLOG 110
22 #define AMSPORT_R0_RTIME 200
23 #define AMSPORT_R0_TRACE (AMSPORT_R0_RTIME+90)
24 #define AMSPORT_R0_IO 300
25 #define AMSPORT_R0_SPS 400
26 #define AMSPORT_R0_NC 500
27 #define AMSPORT_R0_NCSAF 501
28 #define AMSPORT_R0_NCSVB 511
29 #define AMSPORT_R0_ISG 550
30 #define AMSPORT_R0_CNC 600
31 #define AMSPORT_R0_LINE 700
32 #define AMSPORT_R0_PLC 800
33 #define AMSPORT_R0_CAM 900
34 #define AMSPORT_R0_CAMTOOL 950
36 #define AMSPORT_R0_IOPORTBEGIN 1000
37 #define AMSPORT_R0_IOPORTEND 1199
39 #define AMSPORT_R0_USER 2000
41 #define AMSPORT_R3_SYSSERV 10000
42 #define AMSPORT_R3_CTRLPROG 10000
43 #define AMSPORT_R3_SYSCTRL 10001
44 #define AMSPORT_R3_SYSSAMPLER 10100
45 #define AMSPORT_R3_TCPRAWCONN 10200
46 #define AMSPORT_R3_TCPIPSERVER 10201
47 #define AMSPORT_R3_SYSMANAGER 10300
48 #define AMSPORT_R3_SMSSERVER 10400
49 #define AMSPORT_R3_MODBUSSERVER 10500
50 #define AMSPORT_R3_PLCCONTROL 10800
51 #define AMSPORT_R3_NCCTRL 11000
52 #define AMSPORT_R3_NCINTERPRETER 11500
53 #define AMSPORT_R3_STRECKECTRL 12000
54 #define AMSPORT_R3_CAMCTRL 13000
55 #define AMSPORT_R3_SCOPE 14000
56 #define AMSPORT_R3_SINECH1 15000
57 #define AMSPORT_R3_CONTROLNET 16000
58 #define AMSPORT_R3_OPCSERVER 17000
59 #define AMSPORT_R3_OPCCLIENT 17500
61 #define AMSPORT_R3_CUSTOMER_FIRST 25000
62 #define AMSPORT_R3_CUSTOMER_LAST 25999
64 #define AMSPORT_FIRST 1
65 #define AMSPORT_LAST 0xFFFE
67 #define AMSPORT_UNFIXEDPORT 0
68 #define AMSPORT_USEDEFAULT 0xFFFF
70 #define AMSPORT_IOBOXBEGIN_USB 0x6E00
71 #define AMSPORT_IOBOXEND_USB 0x6EFF
72 #define AMSPORT_IODEVBEGIN 0x7000
73 #define AMSPORT_IODEVEND 0x70FF
74 #define AMSPORT_IOBOXBEGIN 0x7100
75 #define AMSPORT_IOBOXEND 0x7FFF
77 #define AMSPORT_FREEBEGIN 0x8000
78 #define AMSPORT_FREEEND 0xBFFF
81 #define AMSPORT_NAMESIZE 31
83 /* Port types */
84 typedef enum
86 PORTTYPE_INVALID = -1,
87 PORTTYPE_ROUTER = 0x00,
88 PORTTYPE_R3PORT = 0x01,
89 PORTTYPE_R0CTRLPORT = 0x02,
90 PORTTYPE_R0TASKPORT = 0x03,
91 PORTTYPE_R0IOPORT = 0x04,
92 PORTTYPE_TPPORT = 0x05,
93 PORTTYPE_MAXVAL = 0xFF
94 }AMSPORT_TYPE;
96 /* Command IDs */
98 #define AMSCMD_LOGMESSAGE 0x0001
99 #define AMSCMD_ROUTERSHUTDOWN 0x0002
100 #define AMSCMD_ROUTERACTIVATED 0x0003
101 #define AMSCMD_SYSTEMREMOVED 0x0004
102 #define AMSCMD_CLOSECONNECTION 0x0005
103 #define AMSCMD_SIGNALSTART 0x00FB
104 #define AMSCMD_SIGNALSTOP 0x00FC
105 #define AMSCMD_HANDLERETAINDATA 0x00FD
106 #define AMSCMD_DEVICECONFIGID 0x00FE
107 #define AMSCMD_DOWNLOADSYMBOLS 0x00FF
109 #define AMS_ERRLOGCMDS 0x100
111 #define AMS_TASKCMDS 0x500
112 #define AMS_CTRLCMDS 0x600
114 #define AMS_ROUTERCMDS 0x900
115 #define AMS_RTIMECMDS 0x1000
116 #define AMS_TRACECMDS (AMS_RTIMECMDS+0x900)
117 #define AMS_IOCMDS 0x2000
118 #define AMS_C1220CMDS (AMS_IOCMDS+0x100)
119 #define AMS_FCxxxxCMDS (AMS_IOCMDS+0x200)
120 #define AMS_SPSCMDS 0x3000
121 #define AMS_NCCMDS 0x4000
122 #define AMS_PLCCMDS 0x5000
123 #define AMS_LINECMDS 0x6000
124 #define AMS_CAMCMDS 0x7000
126 #define AMS_CMDSPECIFIC 0x8000
129 #define AMSERRCODEISWARNING 0x80000000
131 /* Error Arrays */
133 #define ERR_ROUTERERRS 0x0500
134 #define ERR_TASKERRS 0x0600
135 #define ERR_ADSERRS 0x0700
136 #define ERR_SYSSMPLERRS 0x0800
137 #define ERR_RTIMEERRS 0x1000
138 #define ERR_TRACEERRS (ERR_RTIMEERRS+0x900)
139 #define ERR_IOERRS 0x2000
140 #define ERR_DPSLAVE (ERR_IOERRS+0x900)
141 #define ERR_CP5412A2 (ERR_IOERRS+0xA00)
142 #define ERR_ASP (ERR_IOERRS+0xB00)
143 #define ERR_CANSLAVE (ERR_IOERRS+0xC00)
144 #define ERR_CIF30 (ERR_IOERRS+0xD00)
145 #define ERR_IBSSLAVE (ERR_IOERRS+0xE00)
146 #define ERR_SPSERRS 0x3000
147 #define ERR_NCERRS 0x4000
148 #define ERR_PLCERRS 0x6000
149 #define ERR_STRKERRS 0x7000
151 #define ERR_PRJSPECIFIC 0x7800
153 #define ERR_DRIVEERRS_C3D 0xD000
154 #define ERR_DRIVEERRS_C2D 0xE000
155 #define ERR_DRIVEERRS_C1D 0xF000
158 /* Global Error codes */
159 #define ERR_NOERROR 0
160 #define ERR_INTERNAL 1
161 #define ERR_NORTIME 2
162 #define ERR_ALLOCLOCKEDMEM 3
163 #define ERR_INSERTMAILBOX 4
164 #define ERR_WRONGRECEIVEHMSG 5
165 #define ERR_TARGETPORTNOTFOUND 6
166 #define ERR_TARGETMACHINENOTFOUND 7
167 #define ERR_UNKNOWNCMDID 8
168 #define ERR_BADTASKID 9
169 #define ERR_NOIO 10
170 #define ERR_UNKNOWNAMSCMD 11
171 #define ERR_WIN32ERROR 12
172 #define ERR_PORTNOTCONNECTED 13
173 #define ERR_INVALIDAMSLENGTH 14
174 #define ERR_INVALIDAMSNETID 15
175 #define ERR_LOWINSTLEVEL 16
176 #define ERR_NODEBUGINTAVAILABLE 17
177 #define ERR_PORTDISABLED 18
178 #define ERR_PORTALREADYCONNECTED 19
179 #define ERR_AMSSYNC_W32ERROR 20
180 #define ERR_AMSSYNC_TIMEOUT 21
181 #define ERR_AMSSYNC_AMSERROR 22
182 #define ERR_AMSSYNC_NOINDEXINMAP 23
183 #define ERR_INVALIDAMSPORT 24
184 #define ERR_NOMEMORY 25
185 #define ERR_TCPSEND 26
186 #define ERR_HOSTUNREACHABLE 27
187 #define ERR_INVALIDAMSFRAGMENT 28
190 /* ROUTER */
191 #define ROUTERERR_NOLOCKEDMEMORY 0 + ERR_ROUTERERRS
192 #define ROUTERERR_RESIZEMEMORY 1 + ERR_ROUTERERRS
193 #define ROUTERERR_MAILBOXFULL 2 + ERR_ROUTERERRS
194 #define ROUTERERR_DEBUGBOXFULL 3 + ERR_ROUTERERRS
195 #define ROUTERERR_UNKNOWNPORTTYPE 4 + ERR_ROUTERERRS
196 #define ROUTERERR_NOTINITIALIZED 5 + ERR_ROUTERERRS
197 #define ROUTERERR_PORTALREADYINUSE 6 + ERR_ROUTERERRS
198 #define ROUTERERR_NOTREGISTERED 7 + ERR_ROUTERERRS
199 #define ROUTERERR_NOMOREQUEUES 8 + ERR_ROUTERERRS
200 #define ROUTERERR_INVALIDPORT 9 + ERR_ROUTERERRS
201 #define ROUTERERR_NOTACTIVATED 10 + ERR_ROUTERERRS
202 #define ROUTERERR_FRAGMENTBOXFULL 11 + ERR_ROUTERERRS
203 #define ROUTERERR_FRAGMENTTIMEOUT 12 + ERR_ROUTERERRS
204 #define ROUTERERR_TOBEREMOVED 13 + ERR_ROUTERERRS
206 #define TASKERR_UNKNOWNTASKTYPE 0 + ERR_TASKERRS
207 #define TASKERR_TASKTERMINATED 1 + ERR_TASKERRS
208 #define TASKERR_EVENTTIMEOUT 2 + ERR_TASKERRS
211 /* System Sampler */
212 #define SMPLERR_INTERNAL 0 + ERR_SYSSMPLERRS
213 #define SMPLERR_INVALIDTYPE 1 + ERR_SYSSMPLERRS
216 /* RTIME */
217 #define RTERR_INTERNAL 0 + ERR_RTIMEERRS
218 #define RTERR_BADTIMERPERIODS 1 + ERR_RTIMEERRS
219 #define RTERR_INVALIDTASKPTR 2 + ERR_RTIMEERRS
220 #define RTERR_INVALIDSTACKPTR 3 + ERR_RTIMEERRS
221 #define RTERR_PRIOEXISTS 4 + ERR_RTIMEERRS
222 #define RTERR_NOMORETCB 5 + ERR_RTIMEERRS
223 #define RTERR_NOMORESEMAS 6 + ERR_RTIMEERRS
224 #define RTERR_NOMOREQUEUES 7 + ERR_RTIMEERRS
225 #define RTERR_SHUTDOWNTIMEOUT 8 + ERR_RTIMEERRS
226 #define RTERR_CHECKHOSTOSNOPCR 9 + ERR_RTIMEERRS
227 #define RTERR_CHECKHOSTOSNOIDT 10 + ERR_RTIMEERRS
228 #define RTERR_CHECKHOSTOSNOPHYSMEM 11 + ERR_RTIMEERRS
229 #define RTERR_CHECKHOSTOSMAPERR 12 + ERR_RTIMEERRS
230 #define RTERR_EXTIRQALREADYDEF 13 + ERR_RTIMEERRS
231 #define RTERR_EXTIRQNOTDEF 14 + ERR_RTIMEERRS
232 #define RTERR_EXTIRQINSTALLFAILED 15 + ERR_RTIMEERRS
233 #define RTERR_IRQLNOTLESSOREQUAL 16 + ERR_RTIMEERRS
234 #define RTERR_SYSCLOCKFAILURE 17 + ERR_RTIMEERRS
237 /* TRACE */
238 #define TRACEERR_REGISTRY 0 + ERR_TRACEERRS
239 #define TRACEERR_MEMMAP 1 + ERR_TRACEERRS
240 #define TRACEERR_NOTAVAIL 2 + ERR_TRACEERRS
243 /* IO */
244 #define IOERR_INTERNAL (0 + ERR_IOERRS)
245 #define IOERR_BADCARDNO (1 + ERR_IOERRS)
246 #define IOERR_INVALIDCARDADDR (2 + ERR_IOERRS)
247 #define IOERR_CDLLISTFULL (3 + ERR_IOERRS)
248 #define IOERR_BADCDLPARAM (4 + ERR_IOERRS)
249 #define IOERR_OPENIOFAILED (5 + ERR_IOERRS)
250 #define IOERR_RESETIOFAILED (6 + ERR_IOERRS)
251 #define IOERR_UNKNOWNDEVICE (7 + ERR_IOERRS)
252 #define IOERR_UNKNOWNDEVICEID (8 + ERR_IOERRS)
253 #define IOERR_UNKNOWNIMAGEID (9 + ERR_IOERRS)
254 #define IOERR_GETIOSTATE (10 + ERR_IOERRS)
255 #define IOERR_BADIMAGEID (11 + ERR_IOERRS)
256 #define IOERR_NOMORECLIENTSPACE (12 + ERR_IOERRS)
257 #define IOERR_CLIENTINFONOTFOUND (13 + ERR_IOERRS)
258 #define IOERR_CDLNOTINUSE (14 + ERR_IOERRS)
259 #define IOERR_TIMEOUTWITHDEVICE (15 + ERR_IOERRS)
260 #define IOERR_C1220FUNC_1 (16 + ERR_IOERRS)
261 #define IOERR_C1220FUNC_9 (17 + ERR_IOERRS)
262 #define IOERR_C1220FUNC_C (18 + ERR_IOERRS)
263 #define IOERR_C1220FUNC_10 (19 + ERR_IOERRS)
264 #define IOERR_C1220FUNC_1_MAXSEND (20 + ERR_IOERRS)
265 #define IOERR_C1220FUNC_1_ADDRSET (21 + ERR_IOERRS)
266 #define IOERR_C1220FUNC_1_BREAK (22 + ERR_IOERRS)
267 #define IOERR_C1220FUNC_1_BREAK0 (23 + ERR_IOERRS)
268 #define IOERR_C1220FUNC_1_BREAK1 (24 + ERR_IOERRS)
269 #define IOERR_C1220FUNC_1_BREAK2 (25 + ERR_IOERRS)
270 #define IOERR_C1220FUNC_1_BREAK3 (26 + ERR_IOERRS)
271 #define IOERR_C1220FUNC_1_BREAK4 (27 + ERR_IOERRS)
272 #define IOERR_C1220FUNC_1_BREAK5 (28 + ERR_IOERRS)
273 #define IOERR_C1220FUNC_1_BREAK6 (29 + ERR_IOERRS)
274 #define IOERR_C1220FUNC_1_BREAK7 (30 + ERR_IOERRS)
275 #define IOERR_C1220FUNC_1_BREAK8 (31 + ERR_IOERRS)
276 #define IOERR_C1220FUNC_1_BREAK9 (32 + ERR_IOERRS)
277 #define IOERR_C1220FUNC_1_BREAK10 (33 + ERR_IOERRS)
278 #define IOERR_C1220FUNC_1_BREAK11 (34 + ERR_IOERRS)
279 #define IOERR_C1220FUNC_1_BREAK12 (35 + ERR_IOERRS)
280 #define IOERR_C1220FUNC_1_BREAK13 (36 + ERR_IOERRS)
281 #define IOERR_C1220FUNC_1_BREAK14 (37 + ERR_IOERRS)
282 #define IOERR_C1220FUNC_1_BREAK15 (38 + ERR_IOERRS)
283 #define IOERR_C1220FUNC_1_BREAK16 (39 + ERR_IOERRS)
284 #define IOERR_SPC3DEVINITDP (40 + ERR_IOERRS)
285 #define IOERR_SPC3UPDATEOUTPUT (41 + ERR_IOERRS)
286 #define IOERR_CIF30READDIAG (42 + ERR_IOERRS)
287 #define IOERR_CIF30COMMNOTSTARTED (43 + ERR_IOERRS)
288 #define IOERR_CIF30SLAVEPARASIZE (44 + ERR_IOERRS)
289 #define IOERR_CIF30NOPARAS (45 + ERR_IOERRS)
290 #define IOERR_CIF30SLAVEERROR (46 + ERR_IOERRS)
291 #define IOERR_CIF30WATCHDOGEXPIRED (47 + ERR_IOERRS)
292 #define IOERR_UNKNOWNDEVICECMD (48 + ERR_IOERRS)
293 #define IOERR_CIF40MESSAGEHANDLING (49 + ERR_IOERRS)
294 #define IOERR_CIF40PARAERROR (50 + ERR_IOERRS)
295 #define IOERR_CIF40WATCHDOGEXPIRED (51 + ERR_IOERRS)
296 #define IOERR_CIF40FLAGERROR (52 + ERR_IOERRS)
297 #define IOERR_CIF40COMMNOTSTARTED (53 + ERR_IOERRS)
298 #define IOERR_CIF40READDIAG (54 + ERR_IOERRS)
299 #define IOERR_CIF40SLAVEERROR (55 + ERR_IOERRS)
300 #define IOERR_CIF40GLOBALERROR (56 + ERR_IOERRS)
301 #define IOERR_CIF40CONFIGLIST (57 + ERR_IOERRS)
302 #define IOERR_CP5412A2SLAVEPARASIZE (58 + ERR_IOERRS)
303 #define IOERR_CP5412A2NOPARAS (59 + ERR_IOERRS)
304 #define IOERR_CP5412A2SLAVEERROR (60 + ERR_IOERRS)
305 #define IOERR_CP5412A2FATAL (61 + ERR_IOERRS)
306 #define IOERR_CP5412A2MAILBOXUSED (62 + ERR_IOERRS)
307 #define IOERR_BEGINCONFIGWHILETICKER (63 + ERR_IOERRS)
308 #define IOERR_UNEXPECTEDBOXCOUNT (64 + ERR_IOERRS)
309 #define IOERR_C1200CHECKADDR (65 + ERR_IOERRS)
310 #define IOERR_C1200INTENSITYTEST (66 + ERR_IOERRS)
311 #define IOERR_NOIMAGE (67 + ERR_IOERRS)
312 #define IOERR_INVALIDIMAGEOFFSSIZE (68 + ERR_IOERRS)
313 #define IOERR_FORCESCOUNTEXCEEDEDMAXIMUM (69 + ERR_IOERRS)
314 #define IOERR_SERCOSLIFECOUNTERERR (70 + ERR_IOERRS)
315 #define IOERR_C1220NOTFOUND (71 + ERR_IOERRS)
316 #define IOERR_AMSDEVICENOAMSINTF (72 + ERR_IOERRS)
317 #define IOERR_AMSDEVICEAMSCMDIDNOTSUPP (73 + ERR_IOERRS)
318 #define IOERR_AMSDEVICEAMSSERVICERUNNING (74 + ERR_IOERRS)
319 #define IOERR_PLCINTERFACE_BUSY (75 + ERR_IOERRS)
320 #define IOERR_PLCINTERFACE_FAULT (76 + ERR_IOERRS)
321 #define IOERR_PLCINTERFACE_TIMEOUT (77 + ERR_IOERRS)
322 #define IOERR_PLCINTERFACE_RESETTIMEOUT (78 + ERR_IOERRS)
323 #define IOERR_PLCINTERFACE_NODATAEXCH (79 + ERR_IOERRS)
324 #define IOERR_PLCINTERFACE_RESET (80 + ERR_IOERRS)
325 #define IOERR_CP5412A2INVALIDADDR (81 + ERR_IOERRS)
326 #define IOERR_CP5412A2INVALIDPORT (82 + ERR_IOERRS)
327 #define IOERR_AMSDEVICEBADBOXNO (83 + ERR_IOERRS)
328 #define IOERR_AMSDEVICEBADTYPE (84 + ERR_IOERRS)
329 #define IOERR_AMSDEVICEILLEGALADDRESS (85 + ERR_IOERRS)
330 #define IOERR_CP5412A2INVALIDBOX (86 + ERR_IOERRS)
331 #define IOERR_AMSDEVICEFIFOOVERFLOW (87 + ERR_IOERRS)
332 #define IOERR_AMSDEVICEAMSSEQUENCEERROR (88 + ERR_IOERRS)
333 #define IOERR_CP5412A2DPV1SYNTAXERROR (89 + ERR_IOERRS)
334 #define IOERR_CP5412A2DEVICENOTRUNNING (90 + ERR_IOERRS)
335 #define IOERR_AMSDEVICENOTRUNNING (91 + ERR_IOERRS)
336 #define IOERR_AMSDEVICEBOXNOTDEFINED (92 + ERR_IOERRS)
337 #define IOERR_CP5412A2BADSERVICEPARA (93 + ERR_IOERRS)
338 #define IOERR_CP5412A2FIFOOVERFLOW (94 + ERR_IOERRS)
339 #define IOERR_COMPORTOPENFAILED (95 + ERR_IOERRS)
340 #define IOERR_CIF30BADMESSAGERESPONSE (96 + ERR_IOERRS)
341 #define IOERR_CIF30DELETEDATABASE (97 + ERR_IOERRS)
342 #define IOERR_CIF30STARTSEQFAILED (98 + ERR_IOERRS)
343 #define IOERR_CIF30DOWNLOADFAILED (99 + ERR_IOERRS)
344 #define IOERR_CIF30ENDSEQFAILED (100 + ERR_IOERRS)
345 #define IOERR_CIF30BUSLOADFAILED (101 + ERR_IOERRS)
346 #define IOERR_PLCINTERFACE_RESETREQ (102 + ERR_IOERRS)
347 #define IOERR_CP5412A2INVALIDCYCLETICKS (103 + ERR_IOERRS)
348 #define IOERR_CP5412A2DPBUSFAULT (104 + ERR_IOERRS)
349 #define IOERR_INVALIDTERMCONFIG (105 + ERR_IOERRS)
350 #define IOERR_SERCANSBREAK (106 + ERR_IOERRS)
351 #define IOERR_SERCANSPHASE0 (107 + ERR_IOERRS)
352 #define IOERR_SERCANSPHASE1 (108 + ERR_IOERRS)
353 #define IOERR_SERCANSPHASE2 (109 + ERR_IOERRS)
354 #define IOERR_SERCANSPHASE3 (110 + ERR_IOERRS)
355 #define IOERR_SERCANSPHASE4 (111 + ERR_IOERRS)
356 #define IOERR_SERCANSNCSERVICECHNFAILED (112 + ERR_IOERRS)
357 #define IOERR_RESOURCECONFICT (113 + ERR_IOERRS)
358 #define IOERR_C1220INITSTRINGCOMM (114 + ERR_IOERRS)
359 #define IOERR_C1220REGSTRINGSLAVE (115 + ERR_IOERRS)
360 #define IOERR_C1220STRREGFAULT (116 + ERR_IOERRS)
361 #define IOERR_IOSTATEBUSY (117 + ERR_IOERRS)
362 #define IOERR_IBSSCITWATCHDOGEXPIRED (118 + ERR_IOERRS)
363 #define IOERR_IBSSCITSYNCMAILBOXERROR (119 + ERR_IOERRS)
364 #define IOERR_IBSSCITCONFIRMDIAGERROR (120 + ERR_IOERRS)
365 #define IOERR_IBSSCITCREATECFGERROR (121 + ERR_IOERRS)
366 #define IOERR_IBSSCITCOMPLETEREADCFGERROR (122 + ERR_IOERRS)
367 #define IOERR_IBSSCITSTARTDATATRANSFERERROR (123 + ERR_IOERRS)
368 #define IOERR_IBSSCITSETFAULTINDICATION (124 + ERR_IOERRS)
369 #define IOERR_IBSSCITSETDEVICESTATEINDICATION (125 + ERR_IOERRS)
370 #define IOERR_IBSSCITSETBUSERRORINDICATION (126 + ERR_IOERRS)
371 #define IOERR_IBSSCITSTOPDATATRANSFERERROR (127 + ERR_IOERRS)
372 #define IOERR_IBSSCITSETVALUEINDICATION (128 + ERR_IOERRS)
373 #define IOERR_IBSSCITINITIATEREQ (129 + ERR_IOERRS)
374 #define IOERR_IBSSCITACTIVATECFGERROR (130 + ERR_IOERRS)
375 #define IOERR_IBSSCITCOMPACTLOADPDRLERROR (131 + ERR_IOERRS)
376 #define IOERR_IBSSCITCONTROLPARAMERROR (132 + ERR_IOERRS)
377 #define IOERR_IBSSCITDEACTIVATECFGERROR (133 + ERR_IOERRS)
378 #define IOERR_IBSSCITINVALIDPORT (134 + ERR_IOERRS)
379 #define IOERR_C1220FUNC_7_ADDRESSTEST (135 + ERR_IOERRS)
380 #define IOERR_FCXXXXMAILBOXUSED (136 + ERR_IOERRS)
381 #define IOERR_FCXXXXDPRAMTOOSMALL (137 + ERR_IOERRS)
382 #define IOERR_COMUPS_PORTINUSE (138 + ERR_IOERRS)
383 #define IOERR_COMUPS_NOUPSORNOPOWER (139 + ERR_IOERRS)
384 #define IOERR_COMUPS_LOWBATTERY (140 + ERR_IOERRS)
385 #define IOERR_UPS_ALREADY_EXISTS (141 + ERR_IOERRS)
386 #define IOERR_FCXXXXSTARTUPFAILED (142 + ERR_IOERRS)
387 #define IOERR_C1220GETSTRINGCOMMTXSTATEFAILED (143 + ERR_IOERRS)
388 #define IOERR_C1220SENDSTRINGTOSLAVEFAILED (144 + ERR_IOERRS)
389 #define IOERR_CP5613FIRMWARELOADFAILED (145 + ERR_IOERRS)
390 #define IOERR_CP5613DPOPENFAILED (146 + ERR_IOERRS)
391 #define IOERR_CP5613FATALERROR (147 + ERR_IOERRS)
392 #define IOERR_CP5613DPUSEROPENFAILED (148 + ERR_IOERRS)
393 #define IOERR_CP5613DPSETMODESTOPFAILED (149 + ERR_IOERRS)
394 #define IOERR_CP5613DPSETMODECLEARFAILED (150 + ERR_IOERRS)
395 #define IOERR_CP5613DPSETMODEOPERATEFAILED (151 + ERR_IOERRS)
396 #define IOERR_CP5613NODATAAVAILABLE (152 + ERR_IOERRS)
397 #define IOERR_CP5613DPSERVICEFAILED (153 + ERR_IOERRS)
398 #define IOERR_CP5613DPSETMODEOFFLINEFAILED (154 + ERR_IOERRS)
399 #define IOERR_CP5613DPUSERCLOSEFAILED (155 + ERR_IOERRS)
400 #define IOERR_CP5613DPCLOSEFAILED (156 + ERR_IOERRS)
401 #define IOERR_CP5613OTHERSERVICERETURNED (157 + ERR_IOERRS)
402 #define IOERR_CP5613DPOKASYNC (158 + ERR_IOERRS)
403 #define IOERR_CP5613DPERROREVENT (159 + ERR_IOERRS)
404 #define IOERR_CP5613DPERROREVENTNET (160 + ERR_IOERRS)
405 #define IOERR_CP5613DPERRORREQPAR (161 + ERR_IOERRS)
406 #define IOERR_CP5613DPERRORCI (162 + ERR_IOERRS)
407 #define IOERR_CP5613DPERRORRES (163 + ERR_IOERRS)
408 #define IOERR_CP5613DPERRORUSRABORT (164 + ERR_IOERRS)
409 #define IOERR_PKWSYNTAXERROR (165 + ERR_IOERRS)
410 #define IOERR_CP5412A2CDLCFGFAULT (166 + ERR_IOERRS)
411 #define IOERR_IBSSCITINITLOADCFGERROR (168 + ERR_IOERRS)
412 #define IOERR_IBSSCITLOADCFGERROR (169 + ERR_IOERRS)
413 #define IOERR_IBSSCITTERMLOADCFGERROR (170 + ERR_IOERRS)
414 #define IOERR_IBSSCITINITLOADPDRLERROR (171 + ERR_IOERRS)
415 #define IOERR_IBSSCITLOADPDRLERROR (172 + ERR_IOERRS)
416 #define IOERR_IBSSCITTERMLOADPDRLERROR (173 + ERR_IOERRS)
417 #define IOERR_IBSSCITDELETEOBJECTERROR (174 + ERR_IOERRS)
418 #define IOERR_IBSSCITCONTROLACTIVECFGGERROR (175 + ERR_IOERRS)
419 #define IOERR_IBSSCITINITLOADPDDLERROR (176 + ERR_IOERRS)
420 #define IOERR_IBSSCITLOADPDDLERROR (177 + ERR_IOERRS)
421 #define IOERR_IBSSCITTERMLOADPDDLERROR (178 + ERR_IOERRS)
422 #define IOERR_NOMOREMAPSINIMAGE (179 + ERR_IOERRS)
423 #define IOERR_IBSSCITSETSLAVEINFOERROR (180 + ERR_IOERRS)
424 #define IOERR_CIF40NOTREADY (190 + ERR_IOERRS)
425 #define IOERR_C1220SETAMSNETIDFAILED (191 + ERR_IOERRS)
426 #define IOERR_AMSDEVICEIORESETACTIVE (192 + ERR_IOERRS)
427 #define IOERR_C1220INITPROGRAMMABLECDL (193 + ERR_IOERRS)
428 #define IOERR_FCXXXXINVALIDBOXNODOWNLOADED (194 + ERR_IOERRS)
431 #define IOERR_CP5412A2_RESET (4 + ERR_CP5412A2)
432 #define IOERR_CP5412A2_LOADBUSPARA (5 + ERR_CP5412A2)
433 #define IOERR_CP5412A2_LOADSLAVE (6 + ERR_CP5412A2)
434 #define IOERR_CP5412A2_LOADPRMDATA (7 + ERR_CP5412A2)
435 #define IOERR_CP5412A2_LOADCFGDATA (8 + ERR_CP5412A2)
436 #define IOERR_CP5412A2_LOADSLAVECDL (9 + ERR_CP5412A2)
437 #define IOERR_CP5412A2_ACTIVATESLAVE (10 + ERR_CP5412A2)
438 #define IOERR_CP5412A2_ADDSLAVE (11 + ERR_CP5412A2)
439 #define IOERR_CP5412A2_DELETESLAVE (12 + ERR_CP5412A2)
440 #define IOERR_CP5412A2_STARTDATAEXCH (13 + ERR_CP5412A2)
441 #define IOERR_CP5412A2_STOPDATAEXCH (14 + ERR_CP5412A2)
442 #define IOERR_CP5412A2_DEBUGDPM (15 + ERR_CP5412A2)
445 /* FC Box - stamndadisiert */
447 #define FCERR_FMNOERROR 0
448 #define FCERR_FMDEACTIVATED 1
449 #define FCERR_FMNOANSWER 2
450 #define FCERR_FMMASTERLOCK 3
451 #define FCERR_FMINVALIDRESPONSE 4
452 #define FCERR_FMPRMFAULT 5
453 #define FCERR_FMFEATURENOTSUPPORTED 6
454 #define FCERR_FMCFGFAULT 7
455 #define FCERR_FMSTATIONNOTREADY 8
456 #define FCERR_FMSTATDIAG 9
457 #define FCERR_FMDIAGOVERFLOW 10
458 #define FCERR_FMPHYSICALFAULT 11
459 #define FCERR_FMDATATRANSFERLEFT 12
460 #define FCERR_FMSYNIFAULT 13
461 #define FCERR_FMTELEGRAMFAULT 14
462 #define FCERR_FMNORESSOURCES 15
463 #define FCERR_FMSERVICENOTACTIVATED 16
464 #define FCERR_FMUNEXPECTEDTELEGRAM 17
465 #define FCERR_FMSTATIONREADY 18
466 #define FCERR_FMADSSTARTUP 19
467 #define FCERR_FMINVALIDINDICATION 20
468 #define FCERR_FMSTATIONINFAULT 21
469 #define FCERR_FMINDICATIONMISSED 22
470 #define FCERR_FMWAITFORINDICATIONS 23
472 #define FCERR_FMFBUSSPECIFIC_1 40
473 #define FCERR_FMFBUSSPECIFIC_2 41
474 #define FCERR_FMFBUSSPECIFIC_3 42
475 #define FCERR_FMFBUSSPECIFIC_4 43
476 #define FCERR_FMFBUSSPECIFIC_5 44
477 #define FCERR_FMFBUSSPECIFIC_6 45
478 #define FCERR_FMFBUSSPECIFIC_7 46
479 #define FCERR_FMFBUSSPECIFIC_8 47
480 #define FCERR_FMFBUSSPECIFIC_9 48
483 /* FC520x */
485 #define FCERR_FMFC520XHEARTBEATFAULT 40
486 #define FCERR_FMFC520XSHUTDOWNRECEIVED 41
487 #define FCERR_FMFC520XEKEYERROR_VENDOR 42
488 #define FCERR_FMFC520XEKEYERROR_DEVTYPE 43
489 #define FCERR_FMFC520XEKEYERROR_PRODCODE 44
490 #define FCERR_FMFC520XEKEYERROR_REVISION 45
491 #define FCERR_FMFC520XSTARTUPATTR 46
492 #define FCERR_FMFC520XIOLENGTH_PROD 47
493 #define FCERR_FMFC520XIOLENGTH_CONS 48
495 #define FCERR_FMFC520XDEVICEOPERATE_RUN 0
496 #define FCERR_FMFC520XDEVICEOPERATE_IDLE 1
497 #define FCERR_FMFC520XDEVICEDUPMAC 2
498 #define FCERR_FMFC520XDEVICESELFTEST 3
499 #define FCERR_FMFC520XDEVICESTANDBY 4
500 #define FCERR_FMFC520XDEVICEMAJORFAULT 5
501 #define FCERR_FMFC520XDEVICEMINORFAULT 6
502 #define FCERR_FMFC520XDEVICEBUSSENSEFAIL 7
504 #define FCERR_FMFC520XCANBUSON 0x01
505 #define FCERR_FMFC520XCANBUSOFF 0x02
506 #define FCERR_FMFC520XCANWARNINGLIMIT 0x04
507 #define FCERR_FMFC520XCANOVERRUN 0x08
510 /* DP-Slave-Errors */
512 #define DPSLAVEERROR_NOERROR (FCERR_FMNOERROR + ERR_DPSLAVE)
513 #define DPSLAVEERROR_STATIONDEACTIVATED (FCERR_FMDEACTIVATED + ERR_DPSLAVE)
514 #define DPSLAVEERROR_STATIONNONEXISTENT (FCERR_FMNOANSWER + ERR_DPSLAVE)
515 #define DPSLAVEERROR_MASTERLOCK (FCERR_FMMASTERLOCK + ERR_DPSLAVE)
516 #define DPSLAVEERROR_INVALIDSLAVERESPONSE (FCERR_FMINVALIDRESPONSE + ERR_DPSLAVE)
517 #define DPSLAVEERROR_PRMFAULT (FCERR_FMPRMFAULT + ERR_DPSLAVE)
518 #define DPSLAVEERROR_NOTSUPPORTED (FCERR_FMFEATURENOTSUPPORTED + ERR_DPSLAVE)
519 #define DPSLAVEERROR_CFGFAULT (FCERR_FMCFGFAULT + ERR_DPSLAVE)
520 #define DPSLAVEERROR_STATIONNOTREADY (FCERR_FMSTATIONNOTREADY + ERR_DPSLAVE)
521 #define DPSLAVEERROR_STATDIAG (FCERR_FMSTATDIAG + ERR_DPSLAVE)
522 #define DPSLAVEERROR_DIAGOVERFLOW (FCERR_FMDIAGOVERFLOW + ERR_DPSLAVE)
523 #define DPSLAVEERROR_PHYSICALFAULT (FCERR_FMPHYSICALFAULT + ERR_DPSLAVE)
524 #define DPSLAVEERROR_TELEGRAMFAULT (FCERR_FMTELEGRAMFAULT + ERR_DPSLAVE)
525 #define DPSLAVEERROR_NORESSOURCES (FCERR_FMNORESSOURCES + ERR_DPSLAVE)
526 #define DPSLAVEERROR_SERVICENOTACTIVATED (FCERR_FMSERVICENOTACTIVATED + ERR_DPSLAVE)
527 #define DPSLAVEERROR_UNEXPECTEDTELEGRAM (FCERR_FMUNEXPECTEDTELEGRAM + ERR_DPSLAVE)
528 #define DPSLAVEERROR_STATIONREADY (FCERR_FMSTATIONREADY + ERR_DPSLAVE)
529 #define DPSLAVEERROR_ADSSTARTUP (FCERR_FMADSSTARTUP + ERR_DPSLAVE)
532 /* CAN-Node-Errors */
534 #define CANNODEERROR_NOERROR (0 + ERR_CANSLAVE)
535 #define CANNODEERROR_STATIONNONEXISTENT (1 + ERR_CANSLAVE)
536 #define CANNODEERROR_PRMFAULT (4 + ERR_CANSLAVE)
537 #define CANNODEERROR_CFGFAULT (6 + ERR_CANSLAVE)
538 #define CANNODEERROR_DEACTIVATED (8 + ERR_CANSLAVE)
539 #define CANNODEERROR_PREOPERATIONAL (12 + ERR_CANSLAVE)
540 #define CANNODEERROR_NOT_OPERATIONAL (13 + ERR_CANSLAVE)
543 /* IBS-Device-Errors */
545 #define IBSDEVICEERROR_NOERROR (0 + ERR_IBSSLAVE)
546 #define IBSDEVICEERROR_STATIONDEACTIVATED (1 + ERR_IBSSLAVE)
547 #define IBSDEVICEERROR_STATIONNONEXISTENT (2 + ERR_IBSSLAVE)
548 #define IBSDEVICEERROR_CFGFAULT (6 + ERR_IBSSLAVE)
549 #define IBSDEVICEERROR_DIAGOVERFLOW (10 + ERR_IBSSLAVE)
550 #define IBSDEVICEERROR_PHYSICALFAULT (11 + ERR_IBSSLAVE)
553 /* PLC */
554 #define PLCWRN_LOADINGBOOTPRJ ((0 + ERR_PLCERRS) | AMSERRCODEISWARNING)
555 #define PLCWRN_LOADINGRETAINDATA ((1 + ERR_PLCERRS) | AMSERRCODEISWARNING)
558 /* NC */
559 #define ERR_NCR0MANERRS (ERR_NCERRS+0x0000)
560 #define ERR_NCCHNERRS (ERR_NCERRS+0x0100)
563 /* NC: R0-Manager Error Codes */
564 #define NCERR_INTERNAL (0x0000 + ERR_NCR0MANERRS)
565 #define NCERR_NOMEMORY (0x0001 + ERR_NCR0MANERRS)
567 #define NCERR_UNKNOWNCHANNELID (0x0010 + ERR_NCR0MANERRS)
568 #define NCERR_UNKNOWNGROUPID (0x0011 + ERR_NCR0MANERRS)
569 #define NCERR_UNKNOWNAXISID (0x0012 + ERR_NCR0MANERRS)
570 #define NCERR_UNKNOWNENCODERID (0x0013 + ERR_NCR0MANERRS)
571 #define NCERR_UNKNOWNCONTROLLERID (0x0014 + ERR_NCR0MANERRS)
572 #define NCERR_UNKNOWNDRIVEID (0x0015 + ERR_NCR0MANERRS)
573 #define NCERR_UNKNOWNTABULARID (0x0016 + ERR_NCR0MANERRS)
575 #define NCERR_UNKNOWNPLCTONCADDR (0x0020 + ERR_NCR0MANERRS)
576 #define NCERR_UNKNOWNNCTOPLCADDR (0x0021 + ERR_NCR0MANERRS)
577 #define NCERR_UNKNOWNENCINADDR (0x0022 + ERR_NCR0MANERRS)
578 #define NCERR_UNKNOWNENCOUTADDR (0x0023 + ERR_NCR0MANERRS)
579 #define NCERR_UNKNOWNDRIVEINADDR (0x0024 + ERR_NCR0MANERRS)
580 #define NCERR_UNKNOWNDRIVEOUTADDR (0x0025 + ERR_NCR0MANERRS)
582 #define NCERR_UNKNOWNDSLAVETYPE (0x0030 + ERR_NCR0MANERRS)
583 #define NCERR_UNKNOWNAXISTYPE (0x0031 + ERR_NCR0MANERRS)
584 #define NCERR_UNKNOWNCHNTYPE (0x0032 + ERR_NCR0MANERRS)
586 #define NCERR_AXISINCOMPATIBLE (0x0040 + ERR_NCR0MANERRS)
588 #define NCERR_CHANNELINCOMPLETE (0x0050 + ERR_NCR0MANERRS)
589 #define NCERR_GROUPINCOMPLETE (0x0051 + ERR_NCR0MANERRS)
590 #define NCERR_AXISINCOMPLETE (0x0052 + ERR_NCR0MANERRS)
592 #define NCERR_CHANNELEXISTS (0x0060 + ERR_NCR0MANERRS)
593 #define NCERR_GROUPEXISTS (0x0061 + ERR_NCR0MANERRS)
594 #define NCERR_AXISEXISTS (0x0062 + ERR_NCR0MANERRS)
595 #define NCERR_TABULAREXISTS (0x0063 + ERR_NCR0MANERRS)
597 #define NCERR_WRONGCHANNELINDEX (0x0070 + ERR_NCR0MANERRS)
598 #define NCERR_WRONGGROUPINDEX (0x0071 + ERR_NCR0MANERRS)
601 /* Channel Error Codes */
602 #define NCCHNERR_GROUPINDEX (0x0001 + ERR_NCCHNERRS)
603 #define NCCHNERR_ADDR_GROUP (0x0002 + ERR_NCCHNERRS)
604 #define NCCHNERR_NO_PLCINTERFACE (0x0003 + ERR_NCCHNERRS)
605 #define NCCHNERR_ILLEGALMFUNCNR (0x0004 + ERR_NCCHNERRS)
606 #define NCCHNERR_NOMEMORY (0x0005 + ERR_NCCHNERRS)
607 #define NCCHNERR_ISBUSY (0x0006 + ERR_NCCHNERRS)
608 #define NCCHNERR_NOTSUPPORTED (0x0007 + ERR_NCCHNERRS)
609 #define NCCHNERR_ILLEGALSETTING (0x0008 + ERR_NCCHNERRS)
611 #define NCCHNERR_NOFILE (0x0010 + ERR_NCCHNERRS)
612 #define NCCHNERR_ITPSYNTAXLT (0x0011 + ERR_NCCHNERRS)
613 #define NCCHNERR_ITPSYNTAXRT (0x0012 + ERR_NCCHNERRS)
614 #define NCCHNERR_SUBNOTFOUND (0x0013 + ERR_NCCHNERRS)
615 #define NCCHNERR_LOADBUFFERFULL (0x0014 + ERR_NCCHNERRS)
616 #define NCCHNERR_INVALIDIDENTIFIER (0x0015 + ERR_NCCHNERRS)
617 #define NCCHNERR_UNKNOWNIDENTIFIER (0x0016 + ERR_NCCHNERRS)
618 #define NCCHNERR_SUBINCOMPLETE (0x0017 + ERR_NCCHNERRS)
620 #define NCCHNERR_ZERODIVIDE (0x0020 + ERR_NCCHNERRS)
621 #define NCCHNERR_BADCIRCLE (0x0021 + ERR_NCCHNERRS)
622 #define NCCHNERR_INVALIDOPERATION (0x0022 + ERR_NCCHNERRS)
624 #define NCCHNERR_CALLSTACKOVR (0x0030 + ERR_NCCHNERRS)
625 #define NCCHNERR_CALLSTACKUDR (0x0031 + ERR_NCCHNERRS)
626 #define NCCHNERR_CALCSTACKOVR (0x0032 + ERR_NCCHNERRS)
627 #define NCCHNERR_CALCSTACKUDR (0x0033 + ERR_NCCHNERRS)
629 #define NCCHNERR_REGINDEX (0x0040 + ERR_NCCHNERRS)
630 #define NCCHNERR_GFUNCINDEX (0x0041 + ERR_NCCHNERRS)
631 #define NCCHNERR_MFUNCINDEX (0x0042 + ERR_NCCHNERRS)
632 #define NCCHNERR_EXTENDEDADDR (0x0043 + ERR_NCCHNERRS)
633 #define NCCHNERR_INTERNALINDEXH (0x0044 + ERR_NCCHNERRS)
634 #define NCCHNERR_MDBACCESSINDEX (0x0045 + ERR_NCCHNERRS)
636 #define NCTRAFOERR_CANNOTCHANGE (0x0050 + ERR_NCCHNERRS)
637 #define NCTRAFOERR_CANNOTCORRECT (0x0051 + ERR_NCCHNERRS)
638 #define NCTRAFOERR_PLANE (0x0052 + ERR_NCCHNERRS)
639 #define NCTRAFOERR_DPARAMINVALID (0x0053 + ERR_NCCHNERRS)
640 #define NCTRAFOERR_TOOLRADIUSINV (0x0054 + ERR_NCCHNERRS)
641 #define NCTRAFOERR_CHANGETOOLRAD (0x0055 + ERR_NCCHNERRS)
642 #define NCTRAFOERR_CDOVERFLOW (0x0056 + ERR_NCCHNERRS)
643 #define NCTRAFOERR_CDON (0x0057 + ERR_NCCHNERRS)
644 #define NCTRAFOERR_CDCHECK (0x0058 + ERR_NCCHNERRS)
645 #define NCTRAFOERR_CDUNEXPECTED (0x0059 + ERR_NCCHNERRS)
646 #define NCTRAFOERR_CDNEGRADIUS (0x005A + ERR_NCCHNERRS)
647 #define NCTRAFOERR_CDOCCURED (0x005B + ERR_NCCHNERRS)
648 #define NCTRAFOERR_COOKEDTBLFULL (0x005C + ERR_NCCHNERRS)
649 #define NCTRAFOERR_TFTBLFULL (0x005D + ERR_NCCHNERRS)
650 #define NCTRAFOERR_EXECTFTBLFULL (0x005E + ERR_NCCHNERRS)
651 #define NCTRAFOERR_EXECTFT (0x005F + ERR_NCCHNERRS)
653 #define NCBACKUPERR_WRITEDATA (0x0060 + ERR_NCCHNERRS)
654 #define NCBACKUPERR_TARGETENTRY (0x0061 + ERR_NCCHNERRS)
657 #define MACHINEIDENTRYDONTCARE 0xFF
658 #define AMS_NETIDLEN 23
660 typedef struct AmsNetId_
662 uint8_t b[6];
663 } AmsNetId;
664 #define AmsNetId_Len (int)sizeof(AmsNetId)
666 typedef struct AmsAddr_
668 AmsNetId netId;
669 uint16_t port;
670 } AmsAddr;
672 typedef union ErrCodeUnion
674 int32_t errCode;
675 int32_t hRcv;
676 } ErrCodeUnion;
678 typedef union tUserUnion
680 int32_t hUser;
681 struct
683 uint16_t fragmentNo;
684 uint16_t packetNo;
685 } a;
686 } UserUnion;
688 typedef struct
690 AmsAddr target;
691 AmsAddr sender;
692 uint16_t cmdId;
693 uint16_t stateFlags;
694 uint32_t cbData;
696 ErrCodeUnion anErrCodeUnion;
697 UserUnion aUserUnion;
698 } AmsHead;
699 #define AmsHead_Len (int)sizeof(AmsHead)
702 /* State flags */
704 #define AMSCMDSF_RESPONSE 0x0001
705 #define AMSCMDSF_NORETURN 0x0002
706 #define AMSCMDSF_ADSCMD 0x0004
707 #define AMSCMDSF_SYSCMD 0x0008
708 #define AMSCMDSF_HIGHPRIO 0x0010
709 #define AMSCMDSF_TIMESTAMPADDED 0x0020
710 #define AMSCMDSF_UDP 0x0040
711 #define AMSCMDSF_INITCMD 0x0080
712 #define AMSCMDSF_BROADCAST 0x8000
715 /* AmsCmd */
717 typedef struct
719 AmsHead head;
720 } AmsCmd, *PAmsCmd;
723 /* ADS */
725 #define ADS_FIXEDNAMESIZE 16
728 /* ADS Service Ids */
729 #define ADSSRVID_INVALID 0x00
730 #define ADSSRVID_READDEVICEINFO 0x01
731 #define ADSSRVID_READ 0x02
732 #define ADSSRVID_WRITE 0x03
733 #define ADSSRVID_READSTATE 0x04
734 #define ADSSRVID_WRITECTRL 0x05
735 #define ADSSRVID_ADDDEVICENOTE 0x06
736 #define ADSSRVID_DELDEVICENOTE 0x07
737 #define ADSSRVID_DEVICENOTE 0x08
738 #define ADSSRVID_READWRITE 0x09
740 /* ADS reserved index groups */
741 #define ADSIGRP_SYMTAB 0xF000
742 #define ADSIGRP_SYMNAME 0xF001
743 #define ADSIGRP_SYMVAL 0xF002
745 #define ADSIGRP_SYM_HNDBYNAME 0xF003
746 #define ADSIGRP_SYM_VALBYNAME 0xF004
747 #define ADSIGRP_SYM_VALBYHND 0xF005
748 #define ADSIGRP_SYM_RELEASEHND 0xF006
749 #define ADSIGRP_SYM_INFOBYNAME 0xF007
750 #define ADSIGRP_SYM_VERSION 0xF008
751 #define ADSIGRP_SYM_INFOBYNAMEEX 0xF009
753 #define ADSIGRP_SYM_DOWNLOAD 0xF00A
754 #define ADSIGRP_SYM_UPLOAD 0xF00B
755 #define ADSIGRP_SYM_UPLOADINFO 0xF00C
756 #define ADSIGRP_SYM_DOWNLOAD2 0xF00D
757 #define ADSIGRP_SYM_DT_UPLOAD 0xF00E
758 #define ADSIGRP_SYM_UPLOADINFO2 0xF00F
760 #define ADSIGRP_SYMNOTE 0xF010
762 #define ADSIGRP_SYM_DT_INFOBYNAMEEX 0xF011
763 #define ADSIGRP_SYM_ADDRBYHND 0xF012
766 #define ADSIGRP_IOIMAGE_RWIB 0xF020
767 #define ADSIGRP_IOIMAGE_RWIX 0xF021
768 #define ADSIGRP_IOIMAGE_RISIZE 0xF025
770 #define ADSIGRP_IOIMAGE_RWOB 0xF030
771 #define ADSIGRP_IOIMAGE_RWOX 0xF031
772 #define ADSIGRP_IOIMAGE_ROSIZE 0xF035
773 #define ADSIGRP_IOIMAGE_CLEARI 0xF040
774 #define ADSIGRP_IOIMAGE_CLEARO 0xF050
776 #define ADSIGRP_IOIMAGE_RWIOB 0xF060
778 #define ADSIGRP_IOIMAGE_CREATE 0xF068
780 #define ADSIGRP_SUMUP_READ 0xF080
782 #define ADSIGRP_SUMUP_WRITE 0xF081
783 #define ADS_SUMUP_IGRP(p, i) (((uint32_t*)p)[(i)*3+0])
784 #define ADS_SUMUP_IOFFS(p, i) (((uint32_t*)p)[(i)*3+1])
785 #define ADS_SUMUP_LENGTH(p, i) (((uint32_t*)p)[(i)*3+2])
787 #define ADSIGRP_DEVICE_DATA 0xF100
788 #define ADSIOFFS_DEVDATA_ADSSTATE 0x0000
789 #define ADSIOFFS_DEVDATA_DEVSTATE 0x0002
790 #define ADSIOFFS_DEVDATA_CONFIGID 0x0004
791 #define ADSIOFFS_DEVDATA_ADSVERSIONCHECK 0x0005
793 #define ADSIGRP_TASK_DATA 0xF200
794 /* ADSIGRP_TASK_DATA reserved until 0xF2FF*/
796 #define ADSIGRP_CANOPEN_BEGIN 0xF300
797 #define ADSIGRP_CANOPEN_SDO 0xF302
798 #define ADSIGRP_CANOPEN_SDO_INFO_LIST 0xF3FC
799 #define ADSIGRP_CANOPEN_SDO_INFO_OBJ 0xF3FD
800 #define ADSIGRP_CANOPEN_SDO_INFO_ENTRY 0xF3FE
801 #define ADSIGRP_CANOPEN_END 0xF3FF
803 #define ADSIGRP_ECAT_FOE_BEGIN 0xF400
804 #define ADSIGRP_ECAT_FOE_FOPENREAD 0xF401
805 #define ADSIGRP_ECAT_FOE_FOPENWRITE 0xF402
806 #define ADSIGRP_ECAT_FOE_FCLOSE 0xF403
807 #define ADSIGRP_ECAT_FOE_FREAD 0xF404
808 #define ADSIGRP_ECAT_FOE_FWRITE 0xF405
809 #define ADSIGRP_ECAT_FOE_PROGRESSINFO 0xF406
810 #define ADSIGRP_ECAT_FOE_END 0xF41F
812 #define ADSIGRP_ECAT_SOE 0xF420
813 #define ADSIOFFS_ECAT_SOE_ELEMENT_MASK 0x00FF0000
814 #define ADSIOFFS_ECAT_SOE_DATASTATE 0x00010000
815 #define ADSIOFFS_ECAT_SOE_NAME 0x00020000
816 #define ADSIOFFS_ECAT_SOE_ATTRIBUTE 0x00040000
817 #define ADSIOFFS_ECAT_SOE_UNIT 0x00080000
818 #define ADSIOFFS_ECAT_SOE_MIN 0x00100000
819 #define ADSIOFFS_ECAT_SOE_MAX 0x00200000
820 #define ADSIOFFS_ECAT_SOE_VALUE 0x00400000
821 #define ADSIOFFS_ECAT_SOE_DEFAULT 0x00800000
822 #define ADSIOFFS_ECAT_SOE_DRIVENO_MASK 0x07000000
823 #define ADSIOFFS_ECAT_SOE_COMMAND 0x08000000
825 #define ADSIGRP_ECAT_VOE 0xF430
828 typedef enum nAdsState
830 ADSSTATE_INVALID =0,
831 ADSSTATE_IDLE =1,
832 ADSSTATE_RESET =2,
833 ADSSTATE_INIT =3,
834 ADSSTATE_START =4,
835 ADSSTATE_RUN =5,
836 ADSSTATE_STOP =6,
837 ADSSTATE_SAVECFG =7,
838 ADSSTATE_LOADCFG =8,
839 ADSSTATE_POWERFAILURE =9,
840 ADSSTATE_POWERGOOD =10,
841 ADSSTATE_ERROR =11,
842 ADSSTATE_SHUTDOWN =12,
843 ADSSTATE_SUSPEND =13,
844 ADSSTATE_RESUME =14,
845 ADSSTATE_CONFIG =15,
846 ADSSTATE_RECONFIG =16,
847 ADSSTATE_MAXSTATES
848 } ADSSTATE;
850 typedef enum nAdsTransMode
852 ADSTRANS_NOTRANS =0,
853 ADSTRANS_CLIENTCYCLE =1,
854 ADSTRANS_CLIENTONCHA =2,
855 ADSTRANS_SERVERCYCLE =3,
856 ADSTRANS_SERVERONCHA =4,
857 ADSTRANS_CLIENT1REQ =10,
858 ADSTRANS_MAXMODES
859 }ADSTRANSMODE;
862 /* ADS error codes */
863 #define ADSERR_NOERR 0x00
865 #define ADSERR_DEVICE_ERROR (0x700)
866 #define ADSERR_DEVICE_SRVNOTSUPP (0x701)
867 #define ADSERR_DEVICE_INVALIDGRP (0x702)
868 #define ADSERR_DEVICE_INVALIDOFFSET (0x703)
869 #define ADSERR_DEVICE_INVALIDACCESS (0x704)
870 #define ADSERR_DEVICE_INVALIDSIZE (0x705)
871 #define ADSERR_DEVICE_INVALIDDATA (0x706)
872 #define ADSERR_DEVICE_NOTREADY (0x707)
873 #define ADSERR_DEVICE_BUSY (0x708)
874 #define ADSERR_DEVICE_INVALIDCONTEXT (0x709)
875 #define ADSERR_DEVICE_NOMEMORY (0x70A)
876 #define ADSERR_DEVICE_INVALIDPARM (0x70B)
877 #define ADSERR_DEVICE_NOTFOUND (0x70C)
878 #define ADSERR_DEVICE_SYNTAX (0x70D)
879 #define ADSERR_DEVICE_INCOMPATIBLE (0x70E)
880 #define ADSERR_DEVICE_EXISTS (0x70F)
881 #define ADSERR_DEVICE_SYMBOLNOTFOUND (0x710)
882 #define ADSERR_DEVICE_SYMBOLVERSIONINVALID (0x711)
883 #define ADSERR_DEVICE_INVALIDSTATE (0x712)
884 #define ADSERR_DEVICE_TRANSMODENOTSUPP (0x713)
885 #define ADSERR_DEVICE_NOTIFYHNDINVALID (0x714)
886 #define ADSERR_DEVICE_CLIENTUNKNOWN (0x715)
887 #define ADSERR_DEVICE_NOMOREHDLS (0x716)
888 #define ADSERR_DEVICE_INVALIDWATCHSIZE (0x717)
889 #define ADSERR_DEVICE_NOTINIT (0x718)
890 #define ADSERR_DEVICE_TIMEOUT (0x719)
891 #define ADSERR_DEVICE_NOINTERFACE (0x71A)
892 #define ADSERR_DEVICE_INVALIDINTERFACE (0x71B)
893 #define ADSERR_DEVICE_INVALIDCLSID (0x71C)
894 #define ADSERR_DEVICE_INVALIDOBJID (0x71D)
895 #define ADSERR_DEVICE_PENDING (0x71E)
896 #define ADSERR_DEVICE_ABORTED (0x71F)
897 #define ADSERR_DEVICE_WARNING (0x720)
898 #define ADSERR_DEVICE_INVALIDARRAYIDX (0x721)
899 #define ADSERR_DEVICE_SYMBOLNOTACTIVE (0x722)
900 #define ADSERR_DEVICE_ACCESSDENIED (0x723)
902 #define ADSERR_CLIENT_ERROR (0x740)
903 #define ADSERR_CLIENT_INVALIDPARM (0x741)
904 #define ADSERR_CLIENT_LISTEMPTY (0x742)
905 #define ADSERR_CLIENT_VARUSED (0x743)
906 #define ADSERR_CLIENT_DUPLINVOKEID (0x744)
907 #define ADSERR_CLIENT_SYNCTIMEOUT (0x745)
908 #define ADSERR_CLIENT_W32ERROR (0x746)
909 #define ADSERR_CLIENT_TIMEOUTINVALID (0x747)
910 #define ADSERR_CLIENT_PORTNOTOPEN (0x748)
911 #define ADSERR_CLIENT_NOAMSADDR (0x749)
912 #define ADSERR_CLIENT_SYNCINTERNAL (0x750)
913 #define ADSERR_CLIENT_ADDHASH (0x751)
914 #define ADSERR_CLIENT_REMOVEHASH (0x752)
915 #define ADSERR_CLIENT_NOMORESYM (0x753)
916 #define ADSERR_CLIENT_SYNCRESINVALID (0x754)
917 #define ADSERR_CLIENT_SYNCPORTLOCKED (0x755)
920 #define FACILITY_TC_ADS 0x1811
921 #define FACILITY_TC_CNC 0x1821
922 #define FACILITY_TC_IO 0x1831
925 #if 0 /* Unused ?? */
926 #define ADS_E_ERROR (0x98110000L + ADSERR_DEVICE_ERROR)
927 #define ADS_E_SRVNOTSUPP (0x98110000L + ADSERR_DEVICE_SRVNOTSUPP)
928 #define ADS_E_INVALIDGRP (0x98110000L + ADSERR_DEVICE_INVALIDGRP)
929 #define ADS_E_INVALIDOFFSET (0x98110000L + ADSERR_DEVICE_INVALIDOFFSET)
930 #define ADS_E_INVALIDACCESS (0x98110000L + ADSERR_DEVICE_INVALIDACCESS)
931 #define ADS_E_INVALIDSIZE (0x98110000L + ADSERR_DEVICE_INVALIDSIZE)
932 #define ADS_E_INVALIDDATA (0x98110000L + ADSERR_DEVICE_INVALIDDATA)
933 #define ADS_E_NOTREADY (0x98110000L + ADSERR_DEVICE_NOTREADY)
934 #define ADS_E_BUSY (0x98110000L + ADSERR_DEVICE_BUSY)
935 #define ADS_E_INVALIDCONTEXT (0x98110000L + ADSERR_DEVICE_INVALIDCONTEXT)
936 #define ADS_E_NOMEMORY (0x98110000L + ADSERR_DEVICE_NOMEMORY)
937 #define ADS_E_INVALIDPARM (0x98110000L + ADSERR_DEVICE_INVALIDPARM)
938 #define ADS_E_NOTFOUND (0x98110000L + ADSERR_DEVICE_NOTFOUND)
939 #define ADS_E_SYNTAX (0x98110000L + ADSERR_DEVICE_SYNTAX)
940 #define ADS_E_INCOMPATIBLE (0x98110000L + ADSERR_DEVICE_INCOMPATIBLE)
941 #define ADS_E_EXISTS (0x98110000L + ADSERR_DEVICE_EXISTS)
942 #define ADS_E_SYMBOLNOTFOUND (0x98110000L + ADSERR_DEVICE_SYMBOLNOTFOUND)
943 #define ADS_E_SYMBOLVERSIONINVALID (0x98110000L + ADSERR_DEVICE_SYMBOLVERSIONINVALID)
944 #define ADS_E_INVALIDSTATE (0x98110000L + ADSERR_DEVICE_INVALIDSTATE)
945 #define ADS_E_TRANSMODENOTSUPP (0x98110000L + ADSERR_DEVICE_TRANSMODENOTSUPP)
946 #define ADS_E_NOTIFYHNDINVALID (0x98110000L + ADSERR_DEVICE_NOTIFYHNDINVALID)
947 #define ADS_E_CLIENTUNKNOWN (0x98110000L + ADSERR_DEVICE_CLIENTUNKNOWN)
948 #define ADS_E_NOMOREHDLS (0x98110000L + ADSERR_DEVICE_NOMOREHDLS)
949 #define ADS_E_INVALIDWATCHSIZE (0x98110000L + ADSERR_DEVICE_INVALIDWATCHSIZE)
950 #define ADS_E_NOTINIT (0x98110000L + ADSERR_DEVICE_NOTINIT)
951 #define ADS_E_TIMEOUT (0x98110000L + ADSERR_DEVICE_TIMEOUT)
952 #define ADS_E_NOINTERFACE (0x98110000L + ADSERR_DEVICE_NOINTERFACE)
953 #define ADS_E_INVALIDINTERFACE (0x98110000L + ADSERR_DEVICE_INVALIDINTERFACE)
954 #define ADS_E_INVALIDCLSID (0x98110000L + ADSERR_DEVICE_INVALIDCLSID)
955 #define ADS_E_INVALIDOBJID (0x98110000L + ADSERR_DEVICE_INVALIDOBJID)
956 #define ADS_E_PENDING (0x98110000L + ADSERR_DEVICE_PENDING)
957 #define ADS_E_ABORTED (0x98110000L + ADSERR_DEVICE_ABORTED)
958 #define ADS_E_WARNING (0x98110000L + ADSERR_DEVICE_WARNING)
959 #define ADS_E_INVALIDARRAYIDX (0x98110000L + ADSERR_DEVICE_INVALIDARRAYIDX)
960 #define ADS_E_SYMBOLNOTACTIVE (0x98110000L + ADSERR_DEVICE_SYMBOLNOTACTIVE)
961 #define ADS_E_ACCESSDENIED (0x98110000L + ADSERR_DEVICE_ACCESSDENIED)
962 #endif
964 #ifndef ANYSIZE_ARRAY
965 #define ANYSIZE_ARRAY 1
966 #endif
968 /* ADS AMS command */
969 /*typedef struct
971 uint32_t hNotification;
972 uint32_t cbSampleSize;
973 uint8_t data[ANYSIZE_ARRAY];
974 } AdsNotificationSample, *PAdsNotificationSample;*/
975 #define AdsNotificationSample_Min_Len 4
977 typedef struct
979 uint32_t invokeId;
980 } TAdsReadDeviceInfoReq;
982 #define TAdsReadDeviceInfoReq_Len (int)sizeof(TAdsReadDeviceInfoReq)
984 /*typedef struct
986 uint16_t adsState;
987 uint16_t deviceState;
988 uint32_t cbLength;
989 uint16_t firstDataWord;
990 } TAdsWriteControlReq, TAdsWriteControlInd;*/
991 #define TAdsWriteControlReq_Len 10
993 typedef struct
995 uint32_t invokeId;
996 } TAdsReadStateReq;
997 #define TAdsReadStateReq_Len (int)sizeof(TAdsReadStateReq)
999 typedef struct
1001 uint32_t indexGroup;
1002 uint32_t indexOffset;
1003 uint32_t cbLength;
1004 } TAdsReadReq;
1005 #define TAdsReadReq_Len (int)sizeof(TAdsReadReq)
1007 /*typedef struct
1009 uint32_t indexGroup;
1010 uint32_t indexOffset;
1011 uint32_t cbLength;
1012 uint16_t firstDataWord;
1013 } TAdsWriteReq;*/
1014 #define TAdsWriteReq_Len 14
1017 typedef struct
1019 uint32_t indexGroup;
1020 uint32_t indexOffset;
1021 uint32_t cbReadLength;
1022 uint32_t cbWriteLength;
1023 uint16_t firstDataWord;
1024 } TAdsReadWriteReq;*/
1025 #define TAdsReadWriteReq_Len 18
1027 typedef struct
1029 uint32_t cbLength;
1030 uint32_t nTransMode;
1031 uint32_t nMaxDelay;
1032 uint32_t nCycleTime;
1033 uint8_t nCmpMax[sizeof(double)];
1034 uint8_t nCmpMin[sizeof(double)];
1035 } AdsNotificationAttrib;
1037 typedef struct
1039 uint32_t indexGroup;
1040 uint32_t indexOffset;
1041 AdsNotificationAttrib noteAttrib;
1042 } TAdsAddDeviceNotificationReq;
1043 #define TAdsAddDeviceNotificationReq_Len (int)sizeof(TAdsAddDeviceNotificationReq)
1045 typedef struct
1047 uint32_t hNotification;
1048 } TAdsDelDeviceNotificationReq;
1049 #define TAdsDelDeviceNotificationReq_Len (int)sizeof(TAdsDelDeviceNotificationReq)
1051 typedef struct
1053 uint32_t cbLength;
1054 uint32_t nStamps;
1055 } TAdsDeviceNotificationReq;
1056 #define TAdsDeviceNotificationReq_Len (int)sizeof(TAdsDeviceNotificationReq)
1058 typedef struct
1060 uint32_t result;
1061 } TAdsRes;
1062 #define TAdsRes_Len (int)sizeof(TAdsRes)
1064 typedef struct
1066 uint8_t version;
1067 uint8_t revision;
1068 uint16_t build;
1069 } AdsVersion, *PAdsVersion;
1071 typedef struct
1073 uint32_t result;
1074 AdsVersion version;
1075 char sName[ADS_FIXEDNAMESIZE];
1076 } TAdsReadDeviceInfoRes;
1077 #define TAdsReadDeviceInfoRes_Len (int)sizeof(TAdsReadDeviceInfoRes)
1079 typedef struct
1081 uint32_t result;
1082 } TAdsWriteControlRes;
1083 #define TAdsWriteControlRes_Len (int)sizeof(TAdsWriteControlRes)
1085 typedef struct
1087 uint32_t result;
1088 uint16_t adsState;
1089 uint16_t deviceState;
1090 } TAdsReadStateRes;
1091 #define TAdsReadStateRes_Len (int)sizeof(TAdsReadStateRes)
1093 typedef struct
1095 uint32_t result;
1096 uint32_t cbLength;
1097 uint16_t firstDataWord;
1098 } TAdsReadRes;
1099 #define TAdsReadRes_Len (int)sizeof(TAdsReadRes)
1101 typedef struct
1103 uint32_t result;
1104 uint32_t cbLength;
1105 uint16_t firstDataWord;
1106 } TAdsReadWriteRes;
1107 #define TAdsReadWriteRes_Len (int)sizeof(TAdsReadWriteRes)
1109 typedef struct
1111 uint32_t result;
1112 } TAdsWriteRes;
1113 #define TAdsWriteRes_Len (int)sizeof(TAdsWriteRes)
1115 typedef struct
1117 uint32_t result;
1118 uint32_t handle;
1119 } TAdsAddDeviceNotificationRes;
1120 #define TAdsAddDeviceNotificationRes_Len (int)sizeof(TAdsAddDeviceNotificationRes)
1122 typedef struct
1124 uint32_t result;
1125 } TAdsDelDeviceNotificationRes;
1126 #define TAdsDelDeviceNotificationRes_Len (int)sizeof(TAdsDelDeviceNotificationRes)
1129 /* structure for decoding the header -----------------------------------------*/
1130 /*typedef struct
1132 uint16_t reserved;
1133 uint32_t cbLength;
1134 } TcpAdsParserHDR;
1135 typedef TcpAdsParserHDR;*/
1136 #define TcpAdsParserHDR_Len 6
1139 #endif
1143 * Editor modelines
1145 * Local Variables:
1146 * c-basic-offset: 3
1147 * tab-width: 8
1148 * indent-tabs-mode: nil
1149 * End:
1151 * ex: set shiftwidth=3 tabstop=8 expandtab:
1152 * :indentSize=3:tabSize=8:noTabs=true: