-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.go
206 lines (194 loc) · 7.8 KB
/
constants.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
package goads
// Adapted from the Beckhoff TwinCAT ADS API
const (
AMSPORT_LOGGER uint16 = 100
AMSPORT_R0_RTIME uint16 = 200
AMSPORT_R0_TRACE uint16 = 290
AMSPORT_R0_IO uint16 = 300
AMSPORT_R0_SPS uint16 = 400
AMSPORT_R0_NC uint16 = 500
AMSPORT_R0_ISG uint16 = 550
AMSPORT_R0_PCS uint16 = 600
AMSPORT_R0_PLC uint16 = 801
AMSPORT_R0_PLC_RTS1 uint16 = 801
AMSPORT_R0_PLC_RTS2 uint16 = 811
AMSPORT_R0_PLC_RTS3 uint16 = 821
AMSPORT_R0_PLC_RTS4 uint16 = 831
AMSPORT_R0_PLC_TC3 uint16 = 851
)
type ADSSRVID uint16
const (
ADSSRVID_INVALID ADSSRVID = iota
ADSSRVID_READDEVICEINFO
ADSSRVID_READ
ADSSRVID_WRITE
ADSSRVID_READSTATE
ADSSRVID_WRITECTRL
ADSSRVID_ADDDEVICENOTE
ADSSRVID_DELDEVICENOTE
ADSSRVID_DEVICENOTE
ADSSRVID_READWRITE
)
const (
ADSIGRP_SYMTAB uint32 = 0xF000
ADSIGRP_SYMNAME uint32 = 0xF001
ADSIGRP_SYMVAL uint32 = 0xF002
ADSIGRP_SYM_HNDBYNAME uint32 = 0xF003
ADSIGRP_SYM_VALBYNAME uint32 = 0xF004
ADSIGRP_SYM_VALBYHND uint32 = 0xF005
ADSIGRP_SYM_RELEASEHND uint32 = 0xF006
ADSIGRP_SYM_INFOBYNAME uint32 = 0xF007
ADSIGRP_SYM_VERSION uint32 = 0xF008
ADSIGRP_SYM_INFOBYNAMEEX uint32 = 0xF009
ADSIGRP_SYM_DOWNLOAD uint32 = 0xF00A
ADSIGRP_SYM_UPLOAD uint32 = 0xF00B
ADSIGRP_SYM_UPLOADINFO uint32 = 0xF00C
ADSIGRP_SYM_DOWNLOAD2 uint32 = 0xF00D
ADSIGRP_SYM_DT_UPLOAD uint32 = 0xF00E
ADSIGRP_SYM_UPLOADINFO2 uint32 = 0xF00F
ADSIGRP_SYMNOTE uint32 = 0xF010
ADSIGRP_SUMUP_READ uint32 = 0xF080
ADSIGRP_SUMUP_WRITE uint32 = 0xF081
ADSIGRP_SUMUP_READWRITE uint32 = 0xF082
ADSIGRP_SUMUP_READEX uint32 = 0xF083
ADSIGRP_SUMUP_READEX2 uint32 = 0xF084
ADSIGRP_SUMUP_ADDDEVNOTE uint32 = 0xF085
ADSIGRP_SUMUP_DELDEVNOTE uint32 = 0xF086
ADSIGRP_IOIMAGE_RWIB uint32 = 0xF020
ADSIGRP_IOIMAGE_RWIX uint32 = 0xF021
ADSIGRP_IOIMAGE_RISIZE uint32 = 0xF025
ADSIGRP_IOIMAGE_RWOB uint32 = 0xF030
ADSIGRP_IOIMAGE_RWOX uint32 = 0xF031
ADSIGRP_IOIMAGE_CLEARI uint32 = 0xF040
ADSIGRP_IOIMAGE_CLEARO uint32 = 0xF050
ADSIGRP_IOIMAGE_RWIOB uint32 = 0xF060
ADSIGRP_DEVICE_DATA uint32 = 0xF100
ADSIOFFS_DEVDATA_ADSSTATE uint32 = 0x0000
ADSIOFFS_DEVDATA_DEVSTATE uint32 = 0x0002
)
const (
ADSERR_NOERR uint32 = 0x00
ERR_ADSERRS uint32 = 0x0700
ADSERR_DEVICE_ERROR uint32 = (0x00 + ERR_ADSERRS)
ADSERR_DEVICE_SRVNOTSUPP uint32 = (0x01 + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDGRP uint32 = (0x02 + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDOFFSET uint32 = (0x03 + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDACCESS uint32 = (0x04 + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDSIZE uint32 = (0x05 + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDDATA uint32 = (0x06 + ERR_ADSERRS)
ADSERR_DEVICE_NOTREADY uint32 = (0x07 + ERR_ADSERRS)
ADSERR_DEVICE_BUSY uint32 = (0x08 + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDCONTEXT uint32 = (0x09 + ERR_ADSERRS)
ADSERR_DEVICE_NOMEMORY uint32 = (0x0A + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDPARM uint32 = (0x0B + ERR_ADSERRS)
ADSERR_DEVICE_NOTFOUND uint32 = (0x0C + ERR_ADSERRS)
ADSERR_DEVICE_SYNTAX uint32 = (0x0D + ERR_ADSERRS)
ADSERR_DEVICE_INCOMPATIBLE uint32 = (0x0E + ERR_ADSERRS)
ADSERR_DEVICE_EXISTS uint32 = (0x0F + ERR_ADSERRS)
ADSERR_DEVICE_SYMBOLNOTFOUND uint32 = (0x10 + ERR_ADSERRS)
ADSERR_DEVICE_SYMBOLVERSIONINVALID uint32 = (0x11 + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDSTATE uint32 = (0x12 + ERR_ADSERRS)
ADSERR_DEVICE_TRANSMODENOTSUPP uint32 = (0x13 + ERR_ADSERRS)
ADSERR_DEVICE_NOTIFYHNDINVALID uint32 = (0x14 + ERR_ADSERRS)
ADSERR_DEVICE_CLIENTUNKNOWN uint32 = (0x15 + ERR_ADSERRS)
ADSERR_DEVICE_NOMOREHDLS uint32 = (0x16 + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDWATCHSIZE uint32 = (0x17 + ERR_ADSERRS)
ADSERR_DEVICE_NOTINIT uint32 = (0x18 + ERR_ADSERRS)
ADSERR_DEVICE_TIMEOUT uint32 = (0x19 + ERR_ADSERRS)
ADSERR_DEVICE_NOINTERFACE uint32 = (0x1A + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDINTERFACE uint32 = (0x1B + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDCLSID uint32 = (0x1C + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDOBJID uint32 = (0x1D + ERR_ADSERRS)
ADSERR_DEVICE_PENDING uint32 = (0x1E + ERR_ADSERRS)
ADSERR_DEVICE_ABORTED uint32 = (0x1F + ERR_ADSERRS)
ADSERR_DEVICE_WARNING uint32 = (0x20 + ERR_ADSERRS)
ADSERR_DEVICE_INVALIDARRAYIDX uint32 = (0x21 + ERR_ADSERRS)
ADSERR_DEVICE_SYMBOLNOTACTIVE uint32 = (0x22 + ERR_ADSERRS)
ADSERR_DEVICE_ACCESSDENIED uint32 = (0x23 + ERR_ADSERRS)
ADSERR_DEVICE_LICENSENOTFOUND uint32 = (0x24 + ERR_ADSERRS)
ADSERR_DEVICE_LICENSEEXPIRED uint32 = (0x25 + ERR_ADSERRS)
ADSERR_DEVICE_LICENSEEXCEEDED uint32 = (0x26 + ERR_ADSERRS)
ADSERR_DEVICE_LICENSEINVALID uint32 = (0x27 + ERR_ADSERRS)
ADSERR_DEVICE_LICENSESYSTEMID uint32 = (0x28 + ERR_ADSERRS)
ADSERR_DEVICE_LICENSENOTIMELIMIT uint32 = (0x29 + ERR_ADSERRS)
ADSERR_DEVICE_LICENSEFUTUREISSUE uint32 = (0x2A + ERR_ADSERRS)
ADSERR_DEVICE_LICENSETIMETOLONG uint32 = (0x2B + ERR_ADSERRS)
ADSERR_DEVICE_EXCEPTION uint32 = (0x2C + ERR_ADSERRS)
ADSERR_DEVICE_LICENSEDUPLICATED uint32 = (0x2D + ERR_ADSERRS)
ADSERR_DEVICE_SIGNATUREINVALID uint32 = (0x2E + ERR_ADSERRS)
ADSERR_DEVICE_CERTIFICATEINVALID uint32 = (0x2F + ERR_ADSERRS)
ADSERR_CLIENT_ERROR uint32 = (0x40 + ERR_ADSERRS)
ADSERR_CLIENT_INVALIDPARM uint32 = (0x41 + ERR_ADSERRS)
ADSERR_CLIENT_LISTEMPTY uint32 = (0x42 + ERR_ADSERRS)
ADSERR_CLIENT_VARUSED uint32 = (0x43 + ERR_ADSERRS)
ADSERR_CLIENT_DUPLINVOKEID uint32 = (0x44 + ERR_ADSERRS)
ADSERR_CLIENT_SYNCTIMEOUT uint32 = (0x45 + ERR_ADSERRS)
ADSERR_CLIENT_W32ERROR uint32 = (0x46 + ERR_ADSERRS)
ADSERR_CLIENT_TIMEOUTINVALID uint32 = (0x47 + ERR_ADSERRS)
ADSERR_CLIENT_PORTNOTOPEN uint32 = (0x48 + ERR_ADSERRS)
ADSERR_CLIENT_NOAMSADDR uint32 = (0x49 + ERR_ADSERRS)
ADSERR_CLIENT_SYNCINTERNAL uint32 = (0x50 + ERR_ADSERRS)
ADSERR_CLIENT_ADDHASH uint32 = (0x51 + ERR_ADSERRS)
ADSERR_CLIENT_REMOVEHASH uint32 = (0x52 + ERR_ADSERRS)
ADSERR_CLIENT_NOMORESYM uint32 = (0x53 + ERR_ADSERRS)
ADSERR_CLIENT_SYNCRESINVALID uint32 = (0x54 + ERR_ADSERRS)
ADSERR_CLIENT_SYNCPORTLOCKED uint32 = (0x55 + ERR_ADSERRS)
)
type ADSTRANS uint32
const (
ADSTRANS_NOTRANS ADSTRANS = iota
ADSTRANS_CLIENTCYCLE
ADSTRANS_CLIENTONCHA
ADSTRANS_SERVERCYCLE
ADSTRANS_SERVERONCHA
)
type ADSSTATE uint16
const (
ADSSTATE_INVALID ADSSTATE = iota
ADSSTATE_IDLE
ADSSTATE_RESET
ADSSTATE_INIT
ADSSTATE_START
ADSSTATE_RUN
ADSSTATE_STOP
ADSSTATE_SAVECFG
ADSSTATE_LOADCFG
ADSSTATE_POWERFAILURE
ADSSTATE_POWERGOOD
ADSSTATE_ERROR
ADSSTATE_SHUTDOWN
ADSSTATE_SUSPEND
ADSSTATE_RESUME
ADSSTATE_CONFIG
ADSSTATE_RECONFIG
ADSSTATE_STOPPING
ADSSTATE_MAXSTATES
)
const (
ADSSYMBOLFLAG_PERSISTENT uint32 = 0x00000001
ADSSYMBOLFLAG_BITVALUE uint32 = 0x00000002
ADSSYMBOLFLAG_REFERENCETO uint32 = 0x0004
ADSSYMBOLFLAG_TYPEGUID uint32 = 0x0008
ADSSYMBOLFLAG_TCCOMIFACEPTR uint32 = 0x0010
ADSSYMBOLFLAG_READONLY uint32 = 0x0020
ADSSYMBOLFLAG_CONTEXTMASK uint32 = 0x0F00
)
const (
ADST_VOID uint32 = 0
ADST_INT16 uint32 = 2
ADST_INT32 uint32 = 3
ADST_REAL32 uint32 = 4
ADST_REAL64 uint32 = 5
ADST_INT8 uint32 = 16
ADST_UINT8 uint32 = 17
ADST_UINT16 uint32 = 18
ADST_UINT32 uint32 = 19
ADST_INT64 uint32 = 20
ADST_UINT64 uint32 = 21
ADST_STRING uint32 = 30
ADST_WSTRING uint32 = 31
ADST_REAL80 uint32 = 32
ADST_BIT uint32 = 33
ADST_MAXTYPES uint32 = 34
ADST_BIGTYPE uint32 = 65
)