@tier0/node-opc-da 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +171 -0
- package/docs/opcda.idl +1166 -0
- package/package.json +30 -0
- package/src/constants.js +212 -0
- package/src/enumString.js +161 -0
- package/src/filetime.js +79 -0
- package/src/index.js +62 -0
- package/src/opcAsyncIO.js +102 -0
- package/src/opcBrowser.js +285 -0
- package/src/opcCommon.js +84 -0
- package/src/opcGroupStateManager.js +248 -0
- package/src/opcItemIO.js +60 -0
- package/src/opcItemManager.js +415 -0
- package/src/opcItemProperties.js +102 -0
- package/src/opcServer.js +447 -0
- package/src/opcSyncIO.js +213 -0
- package/src/opctypes.js +116 -0
package/docs/opcda.idl
ADDED
|
@@ -0,0 +1,1166 @@
|
|
|
1
|
+
/* ========================================================================
|
|
2
|
+
* Copyright (c) 2005-2011 The OPC Foundation, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* OPC Foundation MIT License 1.00
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person
|
|
7
|
+
* obtaining a copy of this software and associated documentation
|
|
8
|
+
* files (the "Software"), to deal in the Software without
|
|
9
|
+
* restriction, including without limitation the rights to use,
|
|
10
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the
|
|
12
|
+
* Software is furnished to do so, subject to the following
|
|
13
|
+
* conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be
|
|
16
|
+
* included in all copies or substantial portions of the Software.
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
19
|
+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22
|
+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
23
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
24
|
+
* OTHER DEALINGS IN THE SOFTWARE.
|
|
25
|
+
*
|
|
26
|
+
* The complete license agreement can be found here:
|
|
27
|
+
* http://opcfoundation.org/License/MIT/1.00/
|
|
28
|
+
* ======================================================================*/
|
|
29
|
+
|
|
30
|
+
import "oaidl.idl";
|
|
31
|
+
import "ocidl.idl";
|
|
32
|
+
import "objidl.idl";
|
|
33
|
+
|
|
34
|
+
//==============================================================================
|
|
35
|
+
// Category ID declarations (defined as interfaces to ensure they show up in the typelib).
|
|
36
|
+
|
|
37
|
+
[uuid(63D5F430-CFE4-11d1-B2C8-0060083BA1FB)] interface CATID_OPCDAServer10 : IUnknown {}
|
|
38
|
+
[uuid(63D5F432-CFE4-11d1-B2C8-0060083BA1FB)] interface CATID_OPCDAServer20 : IUnknown {}
|
|
39
|
+
[uuid(CC603642-66D7-48f1-B69A-B625E73652D7)] interface CATID_OPCDAServer30 : IUnknown {}
|
|
40
|
+
[uuid(3098EDA4-A006-48b2-A27F-247453959408)] interface CATID_XMLDAServer10 : IUnknown {}
|
|
41
|
+
|
|
42
|
+
cpp_quote("#define CATID_OPCDAServer10 IID_CATID_OPCDAServer10")
|
|
43
|
+
cpp_quote("#define CATID_OPCDAServer20 IID_CATID_OPCDAServer20")
|
|
44
|
+
cpp_quote("#define CATID_OPCDAServer30 IID_CATID_OPCDAServer30")
|
|
45
|
+
cpp_quote("#define CATID_XMLDAServer10 IID_CATID_XMLDAServer10")
|
|
46
|
+
|
|
47
|
+
//==============================================================================
|
|
48
|
+
// Structures, Typedefs and Enumerations.
|
|
49
|
+
|
|
50
|
+
typedef DWORD OPCHANDLE;
|
|
51
|
+
|
|
52
|
+
typedef enum tagOPCDATASOURCE
|
|
53
|
+
{
|
|
54
|
+
OPC_DS_CACHE = 1,
|
|
55
|
+
OPC_DS_DEVICE
|
|
56
|
+
}
|
|
57
|
+
OPCDATASOURCE;
|
|
58
|
+
|
|
59
|
+
typedef enum tagOPCBROWSETYPE
|
|
60
|
+
{
|
|
61
|
+
OPC_BRANCH = 1,
|
|
62
|
+
OPC_LEAF,
|
|
63
|
+
OPC_FLAT
|
|
64
|
+
}
|
|
65
|
+
OPCBROWSETYPE;
|
|
66
|
+
|
|
67
|
+
typedef enum tagOPCNAMESPACETYPE
|
|
68
|
+
{
|
|
69
|
+
OPC_NS_HIERARCHIAL = 1,
|
|
70
|
+
OPC_NS_FLAT
|
|
71
|
+
}
|
|
72
|
+
OPCNAMESPACETYPE;
|
|
73
|
+
|
|
74
|
+
typedef enum tagOPCBROWSEDIRECTION
|
|
75
|
+
{
|
|
76
|
+
OPC_BROWSE_UP = 1,
|
|
77
|
+
OPC_BROWSE_DOWN,
|
|
78
|
+
OPC_BROWSE_TO
|
|
79
|
+
}
|
|
80
|
+
OPCBROWSEDIRECTION;
|
|
81
|
+
|
|
82
|
+
typedef enum tagOPCEUTYPE
|
|
83
|
+
{
|
|
84
|
+
OPC_NOENUM = 0,
|
|
85
|
+
OPC_ANALOG,
|
|
86
|
+
OPC_ENUMERATED
|
|
87
|
+
}
|
|
88
|
+
OPCEUTYPE;
|
|
89
|
+
|
|
90
|
+
typedef enum tagOPCSERVERSTATE
|
|
91
|
+
{
|
|
92
|
+
OPC_STATUS_RUNNING = 1,
|
|
93
|
+
OPC_STATUS_FAILED,
|
|
94
|
+
OPC_STATUS_NOCONFIG,
|
|
95
|
+
OPC_STATUS_SUSPENDED,
|
|
96
|
+
OPC_STATUS_TEST,
|
|
97
|
+
OPC_STATUS_COMM_FAULT
|
|
98
|
+
}
|
|
99
|
+
OPCSERVERSTATE;
|
|
100
|
+
|
|
101
|
+
typedef enum tagOPCENUMSCOPE
|
|
102
|
+
{
|
|
103
|
+
OPC_ENUM_PRIVATE_CONNECTIONS = 1,
|
|
104
|
+
OPC_ENUM_PUBLIC_CONNECTIONS,
|
|
105
|
+
OPC_ENUM_ALL_CONNECTIONS,
|
|
106
|
+
OPC_ENUM_PRIVATE,
|
|
107
|
+
OPC_ENUM_PUBLIC,
|
|
108
|
+
OPC_ENUM_ALL
|
|
109
|
+
}
|
|
110
|
+
OPCENUMSCOPE;
|
|
111
|
+
|
|
112
|
+
typedef struct tagOPCGROUPHEADER
|
|
113
|
+
{
|
|
114
|
+
DWORD dwSize;
|
|
115
|
+
DWORD dwItemCount;
|
|
116
|
+
OPCHANDLE hClientGroup;
|
|
117
|
+
DWORD dwTransactionID;
|
|
118
|
+
HRESULT hrStatus;
|
|
119
|
+
}
|
|
120
|
+
OPCGROUPHEADER;
|
|
121
|
+
|
|
122
|
+
typedef struct tagOPCITEMHEADER1
|
|
123
|
+
{
|
|
124
|
+
OPCHANDLE hClient;
|
|
125
|
+
DWORD dwValueOffset;
|
|
126
|
+
WORD wQuality;
|
|
127
|
+
WORD wReserved;
|
|
128
|
+
FILETIME ftTimeStampItem;
|
|
129
|
+
}
|
|
130
|
+
OPCITEMHEADER1;
|
|
131
|
+
|
|
132
|
+
typedef struct tagOPCITEMHEADER2
|
|
133
|
+
{
|
|
134
|
+
OPCHANDLE hClient;
|
|
135
|
+
DWORD dwValueOffset;
|
|
136
|
+
WORD wQuality;
|
|
137
|
+
WORD wReserved;
|
|
138
|
+
}
|
|
139
|
+
OPCITEMHEADER2;
|
|
140
|
+
|
|
141
|
+
typedef struct tagOPCGROUPHEADERWRITE
|
|
142
|
+
{
|
|
143
|
+
DWORD dwItemCount;
|
|
144
|
+
OPCHANDLE hClientGroup;
|
|
145
|
+
DWORD dwTransactionID;
|
|
146
|
+
HRESULT hrStatus;
|
|
147
|
+
}
|
|
148
|
+
OPCGROUPHEADERWRITE;
|
|
149
|
+
|
|
150
|
+
typedef struct tagOPCITEMHEADERWRITE
|
|
151
|
+
{
|
|
152
|
+
OPCHANDLE hClient;
|
|
153
|
+
HRESULT dwError;
|
|
154
|
+
}
|
|
155
|
+
OPCITEMHEADERWRITE;
|
|
156
|
+
|
|
157
|
+
typedef struct tagOPCITEMSTATE
|
|
158
|
+
{
|
|
159
|
+
OPCHANDLE hClient;
|
|
160
|
+
FILETIME ftTimeStamp;
|
|
161
|
+
WORD wQuality;
|
|
162
|
+
WORD wReserved;
|
|
163
|
+
VARIANT vDataValue;
|
|
164
|
+
}
|
|
165
|
+
OPCITEMSTATE;
|
|
166
|
+
|
|
167
|
+
typedef struct tagOPCSERVERSTATUS
|
|
168
|
+
{
|
|
169
|
+
FILETIME ftStartTime;
|
|
170
|
+
FILETIME ftCurrentTime;
|
|
171
|
+
FILETIME ftLastUpdateTime;
|
|
172
|
+
OPCSERVERSTATE dwServerState;
|
|
173
|
+
DWORD dwGroupCount;
|
|
174
|
+
DWORD dwBandWidth;
|
|
175
|
+
WORD wMajorVersion;
|
|
176
|
+
WORD wMinorVersion;
|
|
177
|
+
WORD wBuildNumber;
|
|
178
|
+
WORD wReserved;
|
|
179
|
+
[string] LPWSTR szVendorInfo;
|
|
180
|
+
}
|
|
181
|
+
OPCSERVERSTATUS;
|
|
182
|
+
|
|
183
|
+
typedef struct tagOPCITEMDEF
|
|
184
|
+
{
|
|
185
|
+
[string] LPWSTR szAccessPath;
|
|
186
|
+
[string] LPWSTR szItemID;
|
|
187
|
+
BOOL bActive ;
|
|
188
|
+
OPCHANDLE hClient;
|
|
189
|
+
DWORD dwBlobSize;
|
|
190
|
+
[size_is(dwBlobSize)] BYTE* pBlob;
|
|
191
|
+
VARTYPE vtRequestedDataType;
|
|
192
|
+
WORD wReserved;
|
|
193
|
+
}
|
|
194
|
+
OPCITEMDEF;
|
|
195
|
+
|
|
196
|
+
typedef struct tagOPCITEMATTRIBUTES
|
|
197
|
+
{
|
|
198
|
+
[string] LPWSTR szAccessPath;
|
|
199
|
+
[string] LPWSTR szItemID;
|
|
200
|
+
BOOL bActive;
|
|
201
|
+
OPCHANDLE hClient;
|
|
202
|
+
OPCHANDLE hServer;
|
|
203
|
+
DWORD dwAccessRights;
|
|
204
|
+
DWORD dwBlobSize;
|
|
205
|
+
[size_is(dwBlobSize)] BYTE* pBlob;
|
|
206
|
+
VARTYPE vtRequestedDataType;
|
|
207
|
+
VARTYPE vtCanonicalDataType;
|
|
208
|
+
OPCEUTYPE dwEUType;
|
|
209
|
+
VARIANT vEUInfo;
|
|
210
|
+
}
|
|
211
|
+
OPCITEMATTRIBUTES;
|
|
212
|
+
|
|
213
|
+
typedef struct tagOPCITEMRESULT
|
|
214
|
+
{
|
|
215
|
+
OPCHANDLE hServer;
|
|
216
|
+
VARTYPE vtCanonicalDataType;
|
|
217
|
+
WORD wReserved;
|
|
218
|
+
DWORD dwAccessRights;
|
|
219
|
+
DWORD dwBlobSize;
|
|
220
|
+
[size_is(dwBlobSize)] BYTE* pBlob;
|
|
221
|
+
}
|
|
222
|
+
OPCITEMRESULT;
|
|
223
|
+
|
|
224
|
+
typedef struct tagOPCITEMPROPERTY
|
|
225
|
+
{
|
|
226
|
+
VARTYPE vtDataType;
|
|
227
|
+
WORD wReserved;
|
|
228
|
+
DWORD dwPropertyID;
|
|
229
|
+
[string] LPWSTR szItemID;
|
|
230
|
+
[string] LPWSTR szDescription;
|
|
231
|
+
VARIANT vValue;
|
|
232
|
+
HRESULT hrErrorID;
|
|
233
|
+
DWORD dwReserved;
|
|
234
|
+
}
|
|
235
|
+
OPCITEMPROPERTY;
|
|
236
|
+
|
|
237
|
+
typedef struct tagOPCITEMPROPERTIES
|
|
238
|
+
{
|
|
239
|
+
HRESULT hrErrorID;
|
|
240
|
+
DWORD dwNumProperties;
|
|
241
|
+
[size_is(dwNumProperties)] OPCITEMPROPERTY* pItemProperties;
|
|
242
|
+
DWORD dwReserved;
|
|
243
|
+
}
|
|
244
|
+
OPCITEMPROPERTIES;
|
|
245
|
+
|
|
246
|
+
typedef struct tagOPCBROWSEELEMENT
|
|
247
|
+
{
|
|
248
|
+
[string] LPWSTR szName;
|
|
249
|
+
[string] LPWSTR szItemID;
|
|
250
|
+
DWORD dwFlagValue;
|
|
251
|
+
DWORD dwReserved;
|
|
252
|
+
OPCITEMPROPERTIES ItemProperties;
|
|
253
|
+
}
|
|
254
|
+
OPCBROWSEELEMENT;
|
|
255
|
+
|
|
256
|
+
typedef struct tagOPCITEMVQT
|
|
257
|
+
{
|
|
258
|
+
VARIANT vDataValue;
|
|
259
|
+
BOOL bQualitySpecified;
|
|
260
|
+
WORD wQuality;
|
|
261
|
+
WORD wReserved;
|
|
262
|
+
BOOL bTimeStampSpecified;
|
|
263
|
+
DWORD dwReserved;
|
|
264
|
+
FILETIME ftTimeStamp;
|
|
265
|
+
}
|
|
266
|
+
OPCITEMVQT;
|
|
267
|
+
|
|
268
|
+
typedef enum tagOPCBROWSEFILTER
|
|
269
|
+
{
|
|
270
|
+
OPC_BROWSE_FILTER_ALL = 1,
|
|
271
|
+
OPC_BROWSE_FILTER_BRANCHES,
|
|
272
|
+
OPC_BROWSE_FILTER_ITEMS,
|
|
273
|
+
}
|
|
274
|
+
OPCBROWSEFILTER;
|
|
275
|
+
|
|
276
|
+
//==============================================================================
|
|
277
|
+
// IOPCServer
|
|
278
|
+
|
|
279
|
+
[
|
|
280
|
+
object,
|
|
281
|
+
uuid(39c13a4d-011e-11d0-9675-0020afd8adb3),
|
|
282
|
+
pointer_default(unique)
|
|
283
|
+
]
|
|
284
|
+
interface IOPCServer : IUnknown
|
|
285
|
+
{
|
|
286
|
+
HRESULT AddGroup(
|
|
287
|
+
[in, string] LPCWSTR szName,
|
|
288
|
+
[in] BOOL bActive,
|
|
289
|
+
[in] DWORD dwRequestedUpdateRate,
|
|
290
|
+
[in] OPCHANDLE hClientGroup,
|
|
291
|
+
[unique, in] LONG* pTimeBias,
|
|
292
|
+
[unique, in] FLOAT* pPercentDeadband,
|
|
293
|
+
[in] DWORD dwLCID,
|
|
294
|
+
[out] OPCHANDLE* phServerGroup,
|
|
295
|
+
[out] DWORD* pRevisedUpdateRate,
|
|
296
|
+
[in] REFIID riid,
|
|
297
|
+
[out, iid_is(riid)] LPUNKNOWN* ppUnk
|
|
298
|
+
);
|
|
299
|
+
|
|
300
|
+
HRESULT GetErrorString(
|
|
301
|
+
[in] HRESULT dwError,
|
|
302
|
+
[in] LCID dwLocale,
|
|
303
|
+
[out, string] LPWSTR* ppString
|
|
304
|
+
);
|
|
305
|
+
|
|
306
|
+
HRESULT GetGroupByName(
|
|
307
|
+
[in, string] LPCWSTR szName,
|
|
308
|
+
[in] REFIID riid,
|
|
309
|
+
[out, iid_is(riid)] LPUNKNOWN* ppUnk
|
|
310
|
+
);
|
|
311
|
+
|
|
312
|
+
HRESULT GetStatus(
|
|
313
|
+
[out] OPCSERVERSTATUS** ppServerStatus
|
|
314
|
+
);
|
|
315
|
+
|
|
316
|
+
HRESULT RemoveGroup(
|
|
317
|
+
[in] OPCHANDLE hServerGroup,
|
|
318
|
+
[in] BOOL bForce
|
|
319
|
+
);
|
|
320
|
+
|
|
321
|
+
HRESULT CreateGroupEnumerator(
|
|
322
|
+
[in] OPCENUMSCOPE dwScope,
|
|
323
|
+
[in] REFIID riid,
|
|
324
|
+
[out, iid_is(riid)] LPUNKNOWN* ppUnk
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
//==============================================================================
|
|
329
|
+
// IOPCServerPublicGroups
|
|
330
|
+
|
|
331
|
+
[
|
|
332
|
+
object,
|
|
333
|
+
uuid(39c13a4e-011e-11d0-9675-0020afd8adb3),
|
|
334
|
+
pointer_default(unique)
|
|
335
|
+
]
|
|
336
|
+
interface IOPCServerPublicGroups : IUnknown
|
|
337
|
+
{
|
|
338
|
+
HRESULT GetPublicGroupByName(
|
|
339
|
+
[in, string] LPCWSTR szName,
|
|
340
|
+
[in] REFIID riid,
|
|
341
|
+
[out, iid_is(riid)] LPUNKNOWN* ppUnk
|
|
342
|
+
);
|
|
343
|
+
|
|
344
|
+
HRESULT RemovePublicGroup(
|
|
345
|
+
[in] OPCHANDLE hServerGroup,
|
|
346
|
+
[in] BOOL bForce
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
//==============================================================================
|
|
351
|
+
// IOPCBrowseServerAddressSpace
|
|
352
|
+
|
|
353
|
+
[
|
|
354
|
+
object,
|
|
355
|
+
uuid(39c13a4f-011e-11d0-9675-0020afd8adb3),
|
|
356
|
+
pointer_default(unique)
|
|
357
|
+
]
|
|
358
|
+
interface IOPCBrowseServerAddressSpace: IUnknown
|
|
359
|
+
{
|
|
360
|
+
HRESULT QueryOrganization(
|
|
361
|
+
[out] OPCNAMESPACETYPE* pNameSpaceType
|
|
362
|
+
);
|
|
363
|
+
|
|
364
|
+
HRESULT ChangeBrowsePosition(
|
|
365
|
+
[in] OPCBROWSEDIRECTION dwBrowseDirection,
|
|
366
|
+
[in, string] LPCWSTR szString
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
HRESULT BrowseOPCItemIDs(
|
|
370
|
+
[in] OPCBROWSETYPE dwBrowseFilterType,
|
|
371
|
+
[in, string] LPCWSTR szFilterCriteria,
|
|
372
|
+
[in] VARTYPE vtDataTypeFilter,
|
|
373
|
+
[in] DWORD dwAccessRightsFilter,
|
|
374
|
+
[out] LPENUMSTRING* ppIEnumString
|
|
375
|
+
);
|
|
376
|
+
|
|
377
|
+
HRESULT GetItemID(
|
|
378
|
+
[in] LPWSTR szItemDataID,
|
|
379
|
+
[out, string] LPWSTR* szItemID
|
|
380
|
+
);
|
|
381
|
+
|
|
382
|
+
HRESULT BrowseAccessPaths(
|
|
383
|
+
[in, string] LPCWSTR szItemID,
|
|
384
|
+
[out] LPENUMSTRING* ppIEnumString
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
//==============================================================================
|
|
389
|
+
// IOPCGroupStateMgt
|
|
390
|
+
|
|
391
|
+
[
|
|
392
|
+
object,
|
|
393
|
+
uuid(39c13a50-011e-11d0-9675-0020afd8adb3),
|
|
394
|
+
pointer_default(unique)
|
|
395
|
+
]
|
|
396
|
+
interface IOPCGroupStateMgt : IUnknown
|
|
397
|
+
{
|
|
398
|
+
HRESULT GetState(
|
|
399
|
+
[out] DWORD* pUpdateRate,
|
|
400
|
+
[out] BOOL* pActive,
|
|
401
|
+
[out, string] LPWSTR* ppName,
|
|
402
|
+
[out] LONG* pTimeBias,
|
|
403
|
+
[out] FLOAT* pPercentDeadband,
|
|
404
|
+
[out] DWORD* pLCID,
|
|
405
|
+
[out] OPCHANDLE* phClientGroup,
|
|
406
|
+
[out] OPCHANDLE* phServerGroup
|
|
407
|
+
);
|
|
408
|
+
|
|
409
|
+
HRESULT SetState(
|
|
410
|
+
[unique, in] DWORD* pRequestedUpdateRate,
|
|
411
|
+
[out] DWORD* pRevisedUpdateRate,
|
|
412
|
+
[unique, in] BOOL* pActive,
|
|
413
|
+
[unique, in] LONG* pTimeBias,
|
|
414
|
+
[unique, in] FLOAT* pPercentDeadband,
|
|
415
|
+
[unique, in] DWORD* pLCID,
|
|
416
|
+
[unique, in] OPCHANDLE* phClientGroup
|
|
417
|
+
);
|
|
418
|
+
|
|
419
|
+
HRESULT SetName(
|
|
420
|
+
[in, string] LPCWSTR szName
|
|
421
|
+
);
|
|
422
|
+
|
|
423
|
+
HRESULT CloneGroup(
|
|
424
|
+
[in, string] LPCWSTR szName,
|
|
425
|
+
[in] REFIID riid,
|
|
426
|
+
[out, iid_is(riid)] LPUNKNOWN* ppUnk
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
//==============================================================================
|
|
431
|
+
// IOPCPublicGroupStateMgt
|
|
432
|
+
|
|
433
|
+
[
|
|
434
|
+
object,
|
|
435
|
+
uuid(39c13a51-011e-11d0-9675-0020afd8adb3),
|
|
436
|
+
pointer_default(unique)
|
|
437
|
+
]
|
|
438
|
+
interface IOPCPublicGroupStateMgt : IUnknown
|
|
439
|
+
{
|
|
440
|
+
HRESULT GetState(
|
|
441
|
+
[out] BOOL* pPublic
|
|
442
|
+
);
|
|
443
|
+
|
|
444
|
+
HRESULT MoveToPublic(
|
|
445
|
+
void
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
//==============================================================================
|
|
450
|
+
// IOPCSyncIO
|
|
451
|
+
|
|
452
|
+
[
|
|
453
|
+
object,
|
|
454
|
+
uuid(39c13a52-011e-11d0-9675-0020afd8adb3),
|
|
455
|
+
pointer_default(unique)
|
|
456
|
+
]
|
|
457
|
+
interface IOPCSyncIO : IUnknown
|
|
458
|
+
{
|
|
459
|
+
HRESULT Read(
|
|
460
|
+
[in] OPCDATASOURCE dwSource,
|
|
461
|
+
[in] DWORD dwCount,
|
|
462
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
463
|
+
[out, size_is(,dwCount)] OPCITEMSTATE** ppItemValues,
|
|
464
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
465
|
+
);
|
|
466
|
+
|
|
467
|
+
HRESULT Write(
|
|
468
|
+
[in] DWORD dwCount,
|
|
469
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
470
|
+
[in, size_is(dwCount)] VARIANT* pItemValues,
|
|
471
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
//==============================================================================
|
|
476
|
+
// IOPCAsyncIO
|
|
477
|
+
|
|
478
|
+
[
|
|
479
|
+
object,
|
|
480
|
+
uuid(39c13a53-011e-11d0-9675-0020afd8adb3),
|
|
481
|
+
pointer_default(unique)
|
|
482
|
+
]
|
|
483
|
+
interface IOPCAsyncIO : IUnknown
|
|
484
|
+
{
|
|
485
|
+
HRESULT Read(
|
|
486
|
+
[in] DWORD dwConnection,
|
|
487
|
+
[in] OPCDATASOURCE dwSource,
|
|
488
|
+
[in] DWORD dwCount,
|
|
489
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
490
|
+
[out] DWORD* pTransactionID,
|
|
491
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
492
|
+
);
|
|
493
|
+
|
|
494
|
+
HRESULT Write(
|
|
495
|
+
[in] DWORD dwConnection,
|
|
496
|
+
[in] DWORD dwCount,
|
|
497
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
498
|
+
[in, size_is(dwCount)] VARIANT* pItemValues,
|
|
499
|
+
[out] DWORD* pTransactionID,
|
|
500
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
501
|
+
);
|
|
502
|
+
|
|
503
|
+
HRESULT Refresh(
|
|
504
|
+
[in] DWORD dwConnection,
|
|
505
|
+
[in] OPCDATASOURCE dwSource,
|
|
506
|
+
[out] DWORD* pTransactionID
|
|
507
|
+
);
|
|
508
|
+
|
|
509
|
+
HRESULT Cancel(
|
|
510
|
+
[in] DWORD dwTransactionID
|
|
511
|
+
);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
//==============================================================================
|
|
515
|
+
// IOPCItemMgt
|
|
516
|
+
|
|
517
|
+
[
|
|
518
|
+
object,
|
|
519
|
+
uuid(39c13a54-011e-11d0-9675-0020afd8adb3),
|
|
520
|
+
pointer_default(unique)
|
|
521
|
+
]
|
|
522
|
+
interface IOPCItemMgt: IUnknown
|
|
523
|
+
{
|
|
524
|
+
HRESULT AddItems(
|
|
525
|
+
[in] DWORD dwCount,
|
|
526
|
+
[in, size_is(dwCount)] OPCITEMDEF* pItemArray,
|
|
527
|
+
[out, size_is(,dwCount)] OPCITEMRESULT** ppAddResults,
|
|
528
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
529
|
+
);
|
|
530
|
+
|
|
531
|
+
HRESULT ValidateItems(
|
|
532
|
+
[in] DWORD dwCount,
|
|
533
|
+
[in, size_is(dwCount)] OPCITEMDEF* pItemArray,
|
|
534
|
+
[in] BOOL bBlobUpdate,
|
|
535
|
+
[out, size_is(,dwCount)] OPCITEMRESULT** ppValidationResults,
|
|
536
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
537
|
+
);
|
|
538
|
+
|
|
539
|
+
HRESULT RemoveItems(
|
|
540
|
+
[in] DWORD dwCount,
|
|
541
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
542
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
543
|
+
);
|
|
544
|
+
|
|
545
|
+
HRESULT SetActiveState(
|
|
546
|
+
[in] DWORD dwCount,
|
|
547
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
548
|
+
[in] BOOL bActive,
|
|
549
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
550
|
+
);
|
|
551
|
+
|
|
552
|
+
HRESULT SetClientHandles(
|
|
553
|
+
[in] DWORD dwCount,
|
|
554
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
555
|
+
[in, size_is(dwCount)] OPCHANDLE* phClient,
|
|
556
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
557
|
+
);
|
|
558
|
+
|
|
559
|
+
HRESULT SetDatatypes(
|
|
560
|
+
[in] DWORD dwCount,
|
|
561
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
562
|
+
[in, size_is(dwCount)] VARTYPE* pRequestedDatatypes,
|
|
563
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
564
|
+
);
|
|
565
|
+
|
|
566
|
+
HRESULT CreateEnumerator(
|
|
567
|
+
[in] REFIID riid,
|
|
568
|
+
[out, iid_is(riid)] LPUNKNOWN* ppUnk
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
//==============================================================================
|
|
573
|
+
// IEnumOPCItemAttributes
|
|
574
|
+
|
|
575
|
+
[
|
|
576
|
+
object,
|
|
577
|
+
uuid(39c13a55-011e-11d0-9675-0020afd8adb3),
|
|
578
|
+
pointer_default(unique)
|
|
579
|
+
]
|
|
580
|
+
interface IEnumOPCItemAttributes : IUnknown
|
|
581
|
+
{
|
|
582
|
+
HRESULT Next(
|
|
583
|
+
[in] ULONG celt,
|
|
584
|
+
[out, size_is(,*pceltFetched)] OPCITEMATTRIBUTES** ppItemArray,
|
|
585
|
+
[out] ULONG* pceltFetched
|
|
586
|
+
);
|
|
587
|
+
|
|
588
|
+
HRESULT Skip(
|
|
589
|
+
[in] ULONG celt
|
|
590
|
+
);
|
|
591
|
+
|
|
592
|
+
HRESULT Reset(
|
|
593
|
+
void
|
|
594
|
+
);
|
|
595
|
+
|
|
596
|
+
HRESULT Clone(
|
|
597
|
+
[out] IEnumOPCItemAttributes** ppEnumItemAttributes
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
//==============================================================================
|
|
602
|
+
// IOPCDataCallback
|
|
603
|
+
|
|
604
|
+
[
|
|
605
|
+
object,
|
|
606
|
+
uuid(39c13a70-011e-11d0-9675-0020afd8adb3),
|
|
607
|
+
pointer_default(unique)
|
|
608
|
+
]
|
|
609
|
+
interface IOPCDataCallback : IUnknown
|
|
610
|
+
{
|
|
611
|
+
HRESULT OnDataChange(
|
|
612
|
+
[in] DWORD dwTransid,
|
|
613
|
+
[in] OPCHANDLE hGroup,
|
|
614
|
+
[in] HRESULT hrMasterquality,
|
|
615
|
+
[in] HRESULT hrMastererror,
|
|
616
|
+
[in] DWORD dwCount,
|
|
617
|
+
[in, size_is(dwCount)] OPCHANDLE* phClientItems,
|
|
618
|
+
[in, size_is(dwCount)] VARIANT* pvValues,
|
|
619
|
+
[in, size_is(dwCount)] WORD* pwQualities,
|
|
620
|
+
[in, size_is(dwCount)] FILETIME* pftTimeStamps,
|
|
621
|
+
[in, size_is(dwCount)] HRESULT* pErrors
|
|
622
|
+
);
|
|
623
|
+
|
|
624
|
+
HRESULT OnReadComplete(
|
|
625
|
+
[in] DWORD dwTransid,
|
|
626
|
+
[in] OPCHANDLE hGroup,
|
|
627
|
+
[in] HRESULT hrMasterquality,
|
|
628
|
+
[in] HRESULT hrMastererror,
|
|
629
|
+
[in] DWORD dwCount,
|
|
630
|
+
[in, size_is(dwCount)] OPCHANDLE* phClientItems,
|
|
631
|
+
[in, size_is(dwCount)] VARIANT* pvValues,
|
|
632
|
+
[in, size_is(dwCount)] WORD* pwQualities,
|
|
633
|
+
[in, size_is(dwCount)] FILETIME* pftTimeStamps,
|
|
634
|
+
[in, size_is(dwCount)] HRESULT* pErrors
|
|
635
|
+
);
|
|
636
|
+
|
|
637
|
+
HRESULT OnWriteComplete(
|
|
638
|
+
[in] DWORD dwTransid,
|
|
639
|
+
[in] OPCHANDLE hGroup,
|
|
640
|
+
[in] HRESULT hrMastererr,
|
|
641
|
+
[in] DWORD dwCount,
|
|
642
|
+
[in, size_is(dwCount)] OPCHANDLE* pClienthandles,
|
|
643
|
+
[in, size_is(dwCount)] HRESULT* pErrors
|
|
644
|
+
);
|
|
645
|
+
|
|
646
|
+
HRESULT OnCancelComplete(
|
|
647
|
+
[in] DWORD dwTransid,
|
|
648
|
+
[in] OPCHANDLE hGroup
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
//==============================================================================
|
|
653
|
+
// IOPCAsyncIO2
|
|
654
|
+
|
|
655
|
+
[
|
|
656
|
+
object,
|
|
657
|
+
uuid(39c13a71-011e-11d0-9675-0020afd8adb3),
|
|
658
|
+
pointer_default(unique)
|
|
659
|
+
]
|
|
660
|
+
interface IOPCAsyncIO2 : IUnknown
|
|
661
|
+
{
|
|
662
|
+
HRESULT Read(
|
|
663
|
+
[in] DWORD dwCount,
|
|
664
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
665
|
+
[in] DWORD dwTransactionID,
|
|
666
|
+
[out] DWORD* pdwCancelID,
|
|
667
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
668
|
+
);
|
|
669
|
+
|
|
670
|
+
HRESULT Write(
|
|
671
|
+
[in] DWORD dwCount,
|
|
672
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
673
|
+
[in, size_is(dwCount)] VARIANT* pItemValues,
|
|
674
|
+
[in] DWORD dwTransactionID,
|
|
675
|
+
[out] DWORD* pdwCancelID,
|
|
676
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
677
|
+
);
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
HRESULT Refresh2(
|
|
681
|
+
[in] OPCDATASOURCE dwSource,
|
|
682
|
+
[in] DWORD dwTransactionID,
|
|
683
|
+
[out] DWORD* pdwCancelID
|
|
684
|
+
);
|
|
685
|
+
|
|
686
|
+
HRESULT Cancel2(
|
|
687
|
+
[in] DWORD dwCancelID
|
|
688
|
+
);
|
|
689
|
+
|
|
690
|
+
HRESULT SetEnable(
|
|
691
|
+
[in] BOOL bEnable
|
|
692
|
+
);
|
|
693
|
+
|
|
694
|
+
HRESULT GetEnable(
|
|
695
|
+
[out] BOOL* pbEnable
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
//==============================================================================
|
|
700
|
+
// IOPCItemProperties
|
|
701
|
+
|
|
702
|
+
[
|
|
703
|
+
object,
|
|
704
|
+
uuid(39c13a72-011e-11d0-9675-0020afd8adb3),
|
|
705
|
+
pointer_default(unique)
|
|
706
|
+
]
|
|
707
|
+
interface IOPCItemProperties : IUnknown
|
|
708
|
+
{
|
|
709
|
+
HRESULT QueryAvailableProperties (
|
|
710
|
+
[in] LPWSTR szItemID,
|
|
711
|
+
[out] DWORD* pdwCount,
|
|
712
|
+
[out, size_is(,*pdwCount)] DWORD** ppPropertyIDs,
|
|
713
|
+
[out, size_is(,*pdwCount)] LPWSTR** ppDescriptions,
|
|
714
|
+
[out, size_is(,*pdwCount)] VARTYPE** ppvtDataTypes
|
|
715
|
+
);
|
|
716
|
+
|
|
717
|
+
HRESULT GetItemProperties (
|
|
718
|
+
[in] LPWSTR szItemID,
|
|
719
|
+
[in] DWORD dwCount,
|
|
720
|
+
[in, size_is(dwCount)] DWORD* pdwPropertyIDs,
|
|
721
|
+
[out, size_is(,dwCount)] VARIANT** ppvData,
|
|
722
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
723
|
+
);
|
|
724
|
+
|
|
725
|
+
HRESULT LookupItemIDs(
|
|
726
|
+
[in] LPWSTR szItemID,
|
|
727
|
+
[in] DWORD dwCount,
|
|
728
|
+
[in, size_is(dwCount)] DWORD* pdwPropertyIDs,
|
|
729
|
+
[out, string, size_is(,dwCount)] LPWSTR** ppszNewItemIDs,
|
|
730
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
//==============================================================================
|
|
735
|
+
// IOPCItemDeadbandMgt
|
|
736
|
+
|
|
737
|
+
[
|
|
738
|
+
object,
|
|
739
|
+
uuid(5946DA93-8B39-4ec8-AB3D-AA73DF5BC86F),
|
|
740
|
+
pointer_default(unique)
|
|
741
|
+
]
|
|
742
|
+
interface IOPCItemDeadbandMgt : IUnknown
|
|
743
|
+
{
|
|
744
|
+
HRESULT SetItemDeadband(
|
|
745
|
+
[in] DWORD dwCount,
|
|
746
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
747
|
+
[in, size_is(dwCount)] FLOAT* pPercentDeadband,
|
|
748
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
749
|
+
);
|
|
750
|
+
|
|
751
|
+
HRESULT GetItemDeadband(
|
|
752
|
+
[in] DWORD dwCount,
|
|
753
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
754
|
+
[out, size_is(,dwCount)] FLOAT** ppPercentDeadband,
|
|
755
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
756
|
+
);
|
|
757
|
+
|
|
758
|
+
HRESULT ClearItemDeadband(
|
|
759
|
+
[in] DWORD dwCount,
|
|
760
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
761
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
762
|
+
);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
//==============================================================================
|
|
766
|
+
// IOPCItemSamplingMgt
|
|
767
|
+
|
|
768
|
+
[
|
|
769
|
+
object,
|
|
770
|
+
uuid(3E22D313-F08B-41a5-86C8-95E95CB49FFC),
|
|
771
|
+
pointer_default(unique)
|
|
772
|
+
]
|
|
773
|
+
interface IOPCItemSamplingMgt : IUnknown
|
|
774
|
+
{
|
|
775
|
+
HRESULT SetItemSamplingRate (
|
|
776
|
+
[in] DWORD dwCount,
|
|
777
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
778
|
+
[in, size_is(dwCount)] DWORD* pdwRequestedSamplingRate,
|
|
779
|
+
[out, size_is(,dwCount)] DWORD** ppdwRevisedSamplingRate,
|
|
780
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
781
|
+
);
|
|
782
|
+
|
|
783
|
+
HRESULT GetItemSamplingRate (
|
|
784
|
+
[in] DWORD dwCount,
|
|
785
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
786
|
+
[out, size_is(,dwCount)] DWORD** ppdwSamplingRate,
|
|
787
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
788
|
+
);
|
|
789
|
+
|
|
790
|
+
HRESULT ClearItemSamplingRate(
|
|
791
|
+
[in] DWORD dwCount,
|
|
792
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
793
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
794
|
+
);
|
|
795
|
+
|
|
796
|
+
HRESULT SetItemBufferEnable(
|
|
797
|
+
[in] DWORD dwCount,
|
|
798
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
799
|
+
[in, size_is(dwCount)] BOOL* pbEnable,
|
|
800
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
801
|
+
);
|
|
802
|
+
|
|
803
|
+
HRESULT GetItemBufferEnable(
|
|
804
|
+
[in] DWORD dwCount,
|
|
805
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
806
|
+
[out, size_is(,dwCount)] BOOL** ppbEnable,
|
|
807
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
808
|
+
);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
//==============================================================================
|
|
812
|
+
// IOPCBrowse
|
|
813
|
+
|
|
814
|
+
[
|
|
815
|
+
object,
|
|
816
|
+
uuid(39227004-A18F-4b57-8B0A-5235670F4468),
|
|
817
|
+
pointer_default(unique)
|
|
818
|
+
]
|
|
819
|
+
interface IOPCBrowse : IUnknown
|
|
820
|
+
{
|
|
821
|
+
HRESULT GetProperties(
|
|
822
|
+
[in] DWORD dwItemCount,
|
|
823
|
+
[in, string, size_is(dwItemCount)] LPWSTR* pszItemIDs,
|
|
824
|
+
[in] BOOL bReturnPropertyValues,
|
|
825
|
+
[in] DWORD dwPropertyCount,
|
|
826
|
+
[in, size_is(dwPropertyCount)] DWORD* pdwPropertyIDs,
|
|
827
|
+
[out, size_is(,dwItemCount)] OPCITEMPROPERTIES** ppItemProperties
|
|
828
|
+
);
|
|
829
|
+
|
|
830
|
+
HRESULT Browse(
|
|
831
|
+
[in, string] LPWSTR szItemID,
|
|
832
|
+
[in,out, string] LPWSTR* pszContinuationPoint,
|
|
833
|
+
[in] DWORD dwMaxElementsReturned,
|
|
834
|
+
[in] OPCBROWSEFILTER dwBrowseFilter,
|
|
835
|
+
[in, string] LPWSTR szElementNameFilter,
|
|
836
|
+
[in, string] LPWSTR szVendorFilter,
|
|
837
|
+
[in] BOOL bReturnAllProperties,
|
|
838
|
+
[in] BOOL bReturnPropertyValues,
|
|
839
|
+
[in] DWORD dwPropertyCount,
|
|
840
|
+
[in, size_is(dwPropertyCount)] DWORD* pdwPropertyIDs,
|
|
841
|
+
[out] BOOL* pbMoreElements,
|
|
842
|
+
[out] DWORD* pdwCount,
|
|
843
|
+
[out, size_is(,*pdwCount)] OPCBROWSEELEMENT** ppBrowseElements
|
|
844
|
+
);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
//==============================================================================
|
|
848
|
+
// IOPCItemIO
|
|
849
|
+
|
|
850
|
+
[
|
|
851
|
+
object,
|
|
852
|
+
uuid(85C0B427-2893-4cbc-BD78-E5FC5146F08F),
|
|
853
|
+
pointer_default(unique)
|
|
854
|
+
]
|
|
855
|
+
interface IOPCItemIO: IUnknown
|
|
856
|
+
{
|
|
857
|
+
HRESULT Read(
|
|
858
|
+
[in] DWORD dwCount,
|
|
859
|
+
[in, size_is(dwCount)] LPCWSTR* pszItemIDs,
|
|
860
|
+
[in, size_is(dwCount)] DWORD* pdwMaxAge,
|
|
861
|
+
[out, size_is(,dwCount)] VARIANT** ppvValues,
|
|
862
|
+
[out, size_is(,dwCount)] WORD** ppwQualities,
|
|
863
|
+
[out, size_is(,dwCount)] FILETIME** ppftTimeStamps,
|
|
864
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
865
|
+
);
|
|
866
|
+
|
|
867
|
+
HRESULT WriteVQT(
|
|
868
|
+
[in] DWORD dwCount,
|
|
869
|
+
[in, size_is(dwCount)] LPCWSTR* pszItemIDs,
|
|
870
|
+
[in, size_is(dwCount)] OPCITEMVQT* pItemVQT,
|
|
871
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
//==============================================================================
|
|
876
|
+
// IOPCSyncIO2
|
|
877
|
+
|
|
878
|
+
[
|
|
879
|
+
object,
|
|
880
|
+
uuid(730F5F0F-55B1-4c81-9E18-FF8A0904E1FA),
|
|
881
|
+
pointer_default(unique)
|
|
882
|
+
]
|
|
883
|
+
interface IOPCSyncIO2: IOPCSyncIO
|
|
884
|
+
{
|
|
885
|
+
HRESULT ReadMaxAge(
|
|
886
|
+
[in] DWORD dwCount,
|
|
887
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
888
|
+
[in, size_is(dwCount)] DWORD* pdwMaxAge,
|
|
889
|
+
[out, size_is(,dwCount)] VARIANT** ppvValues,
|
|
890
|
+
[out, size_is(,dwCount)] WORD** ppwQualities,
|
|
891
|
+
[out, size_is(,dwCount)] FILETIME** ppftTimeStamps,
|
|
892
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
893
|
+
);
|
|
894
|
+
|
|
895
|
+
HRESULT WriteVQT (
|
|
896
|
+
[in] DWORD dwCount,
|
|
897
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
898
|
+
[in, size_is(dwCount)] OPCITEMVQT* pItemVQT,
|
|
899
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
900
|
+
);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
//==============================================================================
|
|
904
|
+
// IOPCAsyncIO3
|
|
905
|
+
|
|
906
|
+
[
|
|
907
|
+
object,
|
|
908
|
+
uuid(0967B97B-36EF-423e-B6F8-6BFF1E40D39D),
|
|
909
|
+
pointer_default(unique)
|
|
910
|
+
]
|
|
911
|
+
interface IOPCAsyncIO3: IOPCAsyncIO2
|
|
912
|
+
{
|
|
913
|
+
HRESULT ReadMaxAge(
|
|
914
|
+
[in] DWORD dwCount,
|
|
915
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
916
|
+
[in, size_is(dwCount)] DWORD* pdwMaxAge,
|
|
917
|
+
[in] DWORD dwTransactionID,
|
|
918
|
+
[out] DWORD* pdwCancelID,
|
|
919
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
920
|
+
);
|
|
921
|
+
|
|
922
|
+
HRESULT WriteVQT(
|
|
923
|
+
[in] DWORD dwCount,
|
|
924
|
+
[in, size_is(dwCount)] OPCHANDLE* phServer,
|
|
925
|
+
[in, size_is(dwCount)] OPCITEMVQT* pItemVQT,
|
|
926
|
+
[in] DWORD dwTransactionID,
|
|
927
|
+
[out] DWORD* pdwCancelID,
|
|
928
|
+
[out, size_is(,dwCount)] HRESULT** ppErrors
|
|
929
|
+
);
|
|
930
|
+
|
|
931
|
+
HRESULT RefreshMaxAge(
|
|
932
|
+
[in] DWORD dwMaxAge,
|
|
933
|
+
[in] DWORD dwTransactionID,
|
|
934
|
+
[out] DWORD* pdwCancelID
|
|
935
|
+
);
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
//==============================================================================
|
|
939
|
+
// IOPCGroupStateMgt2
|
|
940
|
+
|
|
941
|
+
[
|
|
942
|
+
uuid(8E368666-D72E-4f78-87ED-647611C61C9F),
|
|
943
|
+
pointer_default(unique)
|
|
944
|
+
]
|
|
945
|
+
interface IOPCGroupStateMgt2 : IOPCGroupStateMgt
|
|
946
|
+
{
|
|
947
|
+
HRESULT SetKeepAlive(
|
|
948
|
+
[in] DWORD dwKeepAliveTime,
|
|
949
|
+
[out] DWORD* pdwRevisedKeepAliveTime
|
|
950
|
+
);
|
|
951
|
+
|
|
952
|
+
HRESULT GetKeepAlive(
|
|
953
|
+
[out] DWORD* pdwKeepAliveTime
|
|
954
|
+
);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
//==============================================================================
|
|
958
|
+
// Type Library
|
|
959
|
+
|
|
960
|
+
[
|
|
961
|
+
uuid(3B540B51-0378-4551-ADCC-EA9B104302BF),
|
|
962
|
+
version(3.00),
|
|
963
|
+
helpstring("OPC Data Access 3.00 Type Library")
|
|
964
|
+
]
|
|
965
|
+
library OPCDA
|
|
966
|
+
{
|
|
967
|
+
//==========================================================================
|
|
968
|
+
// Category IDs
|
|
969
|
+
|
|
970
|
+
interface CATID_OPCDAServer10;
|
|
971
|
+
interface CATID_OPCDAServer20;
|
|
972
|
+
interface CATID_OPCDAServer30;
|
|
973
|
+
interface CATID_XMLDAServer10;
|
|
974
|
+
|
|
975
|
+
//==========================================================================
|
|
976
|
+
// Constants
|
|
977
|
+
|
|
978
|
+
module OPCDA_Constants
|
|
979
|
+
{
|
|
980
|
+
// category description strings.
|
|
981
|
+
const LPCWSTR OPC_CATEGORY_DESCRIPTION_DA10 = L"OPC Data Access Servers Version 1.0";
|
|
982
|
+
const LPCWSTR OPC_CATEGORY_DESCRIPTION_DA20 = L"OPC Data Access Servers Version 2.0";
|
|
983
|
+
const LPCWSTR OPC_CATEGORY_DESCRIPTION_DA30 = L"OPC Data Access Servers Version 3.0";
|
|
984
|
+
const LPCWSTR OPC_CATEGORY_DESCRIPTION_XMLDA10 = L"OPC XML Data Access Servers Version 1.0";
|
|
985
|
+
|
|
986
|
+
// values for access rights mask.
|
|
987
|
+
const DWORD OPC_READABLE = 0x01;
|
|
988
|
+
const DWORD OPC_WRITEABLE = 0x02;
|
|
989
|
+
|
|
990
|
+
// values for browse element flags.
|
|
991
|
+
const DWORD OPC_BROWSE_HASCHILDREN = 0x01;
|
|
992
|
+
const DWORD OPC_BROWSE_ISITEM = 0x02;
|
|
993
|
+
|
|
994
|
+
// well known complex type description systems.
|
|
995
|
+
const LPCWSTR OPC_TYPE_SYSTEM_OPCBINARY = L"OPCBinary";
|
|
996
|
+
const LPCWSTR OPC_TYPE_SYSTEM_XMLSCHEMA = L"XMLSchema";
|
|
997
|
+
|
|
998
|
+
// complex data consitency window values.
|
|
999
|
+
const LPCWSTR OPC_CONSISTENCY_WINDOW_UNKNOWN = L"Unknown";
|
|
1000
|
+
const LPCWSTR OPC_CONSISTENCY_WINDOW_NOT_CONSISTENT = L"Not Consistent";
|
|
1001
|
+
|
|
1002
|
+
// complex data write behavoir values.
|
|
1003
|
+
const LPCWSTR OPC_WRITE_BEHAVIOR_BEST_EFFORT = L"Best Effort";
|
|
1004
|
+
const LPCWSTR OPC_WRITE_BEHAVIOR_ALL_OR_NOTHING = L"All or Nothing";
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
//==========================================================================
|
|
1008
|
+
// Qualities
|
|
1009
|
+
|
|
1010
|
+
module OPCDA_Qualities
|
|
1011
|
+
{
|
|
1012
|
+
// Values for fields in the quality word
|
|
1013
|
+
const WORD OPC_QUALITY_MASK = 0xC0;
|
|
1014
|
+
const WORD OPC_STATUS_MASK = 0xFC;
|
|
1015
|
+
const WORD OPC_LIMIT_MASK = 0x03;
|
|
1016
|
+
|
|
1017
|
+
// Values for QUALITY_MASK bit field
|
|
1018
|
+
const WORD OPC_QUALITY_BAD = 0x00;
|
|
1019
|
+
const WORD OPC_QUALITY_UNCERTAIN = 0x40;
|
|
1020
|
+
const WORD OPC_QUALITY_GOOD = 0xC0;
|
|
1021
|
+
|
|
1022
|
+
// STATUS_MASK Values for Quality = BAD
|
|
1023
|
+
const WORD OPC_QUALITY_CONFIG_ERROR = 0x04;
|
|
1024
|
+
const WORD OPC_QUALITY_NOT_CONNECTED = 0x08;
|
|
1025
|
+
const WORD OPC_QUALITY_DEVICE_FAILURE = 0x0c;
|
|
1026
|
+
const WORD OPC_QUALITY_SENSOR_FAILURE = 0x10;
|
|
1027
|
+
const WORD OPC_QUALITY_LAST_KNOWN = 0x14;
|
|
1028
|
+
const WORD OPC_QUALITY_COMM_FAILURE = 0x18;
|
|
1029
|
+
const WORD OPC_QUALITY_OUT_OF_SERVICE = 0x1C;
|
|
1030
|
+
const WORD OPC_QUALITY_WAITING_FOR_INITIAL_DATA = 0x20;
|
|
1031
|
+
|
|
1032
|
+
// STATUS_MASK Values for Quality = UNCERTAIN
|
|
1033
|
+
const WORD OPC_QUALITY_LAST_USABLE = 0x44;
|
|
1034
|
+
const WORD OPC_QUALITY_SENSOR_CAL = 0x50;
|
|
1035
|
+
const WORD OPC_QUALITY_EGU_EXCEEDED = 0x54;
|
|
1036
|
+
const WORD OPC_QUALITY_SUB_NORMAL = 0x58;
|
|
1037
|
+
|
|
1038
|
+
// STATUS_MASK Values for Quality = GOOD
|
|
1039
|
+
const WORD OPC_QUALITY_LOCAL_OVERRIDE = 0xD8;
|
|
1040
|
+
|
|
1041
|
+
// Values for Limit Bitfield
|
|
1042
|
+
const WORD OPC_LIMIT_OK = 0x00;
|
|
1043
|
+
const WORD OPC_LIMIT_LOW = 0x01;
|
|
1044
|
+
const WORD OPC_LIMIT_HIGH = 0x02;
|
|
1045
|
+
const WORD OPC_LIMIT_CONST = 0x03;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
//==========================================================================
|
|
1049
|
+
// Properties
|
|
1050
|
+
|
|
1051
|
+
module OPCDA_Properties
|
|
1052
|
+
{
|
|
1053
|
+
// property ids.
|
|
1054
|
+
const DWORD OPC_PROPERTY_DATATYPE = 1;
|
|
1055
|
+
const DWORD OPC_PROPERTY_VALUE = 2;
|
|
1056
|
+
const DWORD OPC_PROPERTY_QUALITY = 3;
|
|
1057
|
+
const DWORD OPC_PROPERTY_TIMESTAMP = 4;
|
|
1058
|
+
const DWORD OPC_PROPERTY_ACCESS_RIGHTS = 5;
|
|
1059
|
+
const DWORD OPC_PROPERTY_SCAN_RATE = 6;
|
|
1060
|
+
const DWORD OPC_PROPERTY_EU_TYPE = 7;
|
|
1061
|
+
const DWORD OPC_PROPERTY_EU_INFO = 8;
|
|
1062
|
+
const DWORD OPC_PROPERTY_EU_UNITS = 100;
|
|
1063
|
+
const DWORD OPC_PROPERTY_DESCRIPTION = 101;
|
|
1064
|
+
const DWORD OPC_PROPERTY_HIGH_EU = 102;
|
|
1065
|
+
const DWORD OPC_PROPERTY_LOW_EU = 103;
|
|
1066
|
+
const DWORD OPC_PROPERTY_HIGH_IR = 104;
|
|
1067
|
+
const DWORD OPC_PROPERTY_LOW_IR = 105;
|
|
1068
|
+
const DWORD OPC_PROPERTY_CLOSE_LABEL = 106;
|
|
1069
|
+
const DWORD OPC_PROPERTY_OPEN_LABEL = 107;
|
|
1070
|
+
const DWORD OPC_PROPERTY_TIMEZONE = 108;
|
|
1071
|
+
const DWORD OPC_PROPERTY_CONDITION_STATUS = 300;
|
|
1072
|
+
const DWORD OPC_PROPERTY_ALARM_QUICK_HELP = 301;
|
|
1073
|
+
const DWORD OPC_PROPERTY_ALARM_AREA_LIST = 302;
|
|
1074
|
+
const DWORD OPC_PROPERTY_PRIMARY_ALARM_AREA = 303;
|
|
1075
|
+
const DWORD OPC_PROPERTY_CONDITION_LOGIC = 304;
|
|
1076
|
+
const DWORD OPC_PROPERTY_LIMIT_EXCEEDED = 305;
|
|
1077
|
+
const DWORD OPC_PROPERTY_DEADBAND = 306;
|
|
1078
|
+
const DWORD OPC_PROPERTY_HIHI_LIMIT = 307;
|
|
1079
|
+
const DWORD OPC_PROPERTY_HI_LIMIT = 308;
|
|
1080
|
+
const DWORD OPC_PROPERTY_LO_LIMIT = 309;
|
|
1081
|
+
const DWORD OPC_PROPERTY_LOLO_LIMIT = 310;
|
|
1082
|
+
const DWORD OPC_PROPERTY_CHANGE_RATE_LIMIT = 311;
|
|
1083
|
+
const DWORD OPC_PROPERTY_DEVIATION_LIMIT = 312;
|
|
1084
|
+
const DWORD OPC_PROPERTY_SOUND_FILE = 313;
|
|
1085
|
+
|
|
1086
|
+
// complex data properties.
|
|
1087
|
+
const DWORD OPC_PROPERTY_TYPE_SYSTEM_ID = 600;
|
|
1088
|
+
const DWORD OPC_PROPERTY_DICTIONARY_ID = 601;
|
|
1089
|
+
const DWORD OPC_PROPERTY_TYPE_ID = 602;
|
|
1090
|
+
const DWORD OPC_PROPERTY_DICTIONARY = 603;
|
|
1091
|
+
const DWORD OPC_PROPERTY_TYPE_DESCRIPTION = 604;
|
|
1092
|
+
const DWORD OPC_PROPERTY_CONSISTENCY_WINDOW = 605;
|
|
1093
|
+
const DWORD OPC_PROPERTY_WRITE_BEHAVIOR = 606;
|
|
1094
|
+
const DWORD OPC_PROPERTY_UNCONVERTED_ITEM_ID = 607;
|
|
1095
|
+
const DWORD OPC_PROPERTY_UNFILTERED_ITEM_ID = 608;
|
|
1096
|
+
const DWORD OPC_PROPERTY_DATA_FILTER_VALUE = 609;
|
|
1097
|
+
|
|
1098
|
+
// property descriptions.
|
|
1099
|
+
const LPCWSTR OPC_PROPERTY_DESC_DATATYPE = L"Item Canonical Data Type";
|
|
1100
|
+
const LPCWSTR OPC_PROPERTY_DESC_VALUE = L"Item Value";
|
|
1101
|
+
const LPCWSTR OPC_PROPERTY_DESC_QUALITY = L"Item Quality";
|
|
1102
|
+
const LPCWSTR OPC_PROPERTY_DESC_TIMESTAMP = L"Item Timestamp";
|
|
1103
|
+
const LPCWSTR OPC_PROPERTY_DESC_ACCESS_RIGHTS = L"Item Access Rights";
|
|
1104
|
+
const LPCWSTR OPC_PROPERTY_DESC_SCAN_RATE = L"Server Scan Rate";
|
|
1105
|
+
const LPCWSTR OPC_PROPERTY_DESC_EU_TYPE = L"Item EU Type";
|
|
1106
|
+
const LPCWSTR OPC_PROPERTY_DESC_EU_INFO = L"Item EU Info";
|
|
1107
|
+
const LPCWSTR OPC_PROPERTY_DESC_EU_UNITS = L"EU Units";
|
|
1108
|
+
const LPCWSTR OPC_PROPERTY_DESC_DESCRIPTION = L"Item Description";
|
|
1109
|
+
const LPCWSTR OPC_PROPERTY_DESC_HIGH_EU = L"High EU";
|
|
1110
|
+
const LPCWSTR OPC_PROPERTY_DESC_LOW_EU = L"Low EU";
|
|
1111
|
+
const LPCWSTR OPC_PROPERTY_DESC_HIGH_IR = L"High Instrument Range";
|
|
1112
|
+
const LPCWSTR OPC_PROPERTY_DESC_LOW_IR = L"Low Instrument Range";
|
|
1113
|
+
const LPCWSTR OPC_PROPERTY_DESC_CLOSE_LABEL = L"Contact Close Label";
|
|
1114
|
+
const LPCWSTR OPC_PROPERTY_DESC_OPEN_LABEL = L"Contact Open Label";
|
|
1115
|
+
const LPCWSTR OPC_PROPERTY_DESC_TIMEZONE = L"Item Timezone";
|
|
1116
|
+
const LPCWSTR OPC_PROPERTY_DESC_CONDITION_STATUS = L"Condition Status";
|
|
1117
|
+
const LPCWSTR OPC_PROPERTY_DESC_ALARM_QUICK_HELP = L"Alarm Quick Help";
|
|
1118
|
+
const LPCWSTR OPC_PROPERTY_DESC_ALARM_AREA_LIST = L"Alarm Area List";
|
|
1119
|
+
const LPCWSTR OPC_PROPERTY_DESC_PRIMARY_ALARM_AREA = L"Primary Alarm Area";
|
|
1120
|
+
const LPCWSTR OPC_PROPERTY_DESC_CONDITION_LOGIC = L"Condition Logic";
|
|
1121
|
+
const LPCWSTR OPC_PROPERTY_DESC_LIMIT_EXCEEDED = L"Limit Exceeded";
|
|
1122
|
+
const LPCWSTR OPC_PROPERTY_DESC_DEADBAND = L"Deadband";
|
|
1123
|
+
const LPCWSTR OPC_PROPERTY_DESC_HIHI_LIMIT = L"HiHi Limit";
|
|
1124
|
+
const LPCWSTR OPC_PROPERTY_DESC_HI_LIMIT = L"Hi Limit";
|
|
1125
|
+
const LPCWSTR OPC_PROPERTY_DESC_LO_LIMIT = L"Lo Limit";
|
|
1126
|
+
const LPCWSTR OPC_PROPERTY_DESC_LOLO_LIMIT = L"LoLo Limit";
|
|
1127
|
+
const LPCWSTR OPC_PROPERTY_DESC_CHANGE_RATE_LIMIT = L"Rate of Change Limit";
|
|
1128
|
+
const LPCWSTR OPC_PROPERTY_DESC_DEVIATION_LIMIT = L"Deviation Limit";
|
|
1129
|
+
const LPCWSTR OPC_PROPERTY_DESC_SOUND_FILE = L"Sound File";
|
|
1130
|
+
|
|
1131
|
+
// complex data properties.
|
|
1132
|
+
const LPCWSTR OPC_PROPERTY_DESC_TYPE_SYSTEM_ID = L"Type System ID";
|
|
1133
|
+
const LPCWSTR OPC_PROPERTY_DESC_DICTIONARY_ID = L"Dictionary ID";
|
|
1134
|
+
const LPCWSTR OPC_PROPERTY_DESC_TYPE_ID = L"Type ID";
|
|
1135
|
+
const LPCWSTR OPC_PROPERTY_DESC_DICTIONARY = L"Dictionary";
|
|
1136
|
+
const LPCWSTR OPC_PROPERTY_DESC_TYPE_DESCRIPTION = L"Type Description";
|
|
1137
|
+
const LPCWSTR OPC_PROPERTY_DESC_CONSISTENCY_WINDOW = L"Consistency Window";
|
|
1138
|
+
const LPCWSTR OPC_PROPERTY_DESC_WRITE_BEHAVIOR = L"Write Behavior";
|
|
1139
|
+
const LPCWSTR OPC_PROPERTY_DESC_UNCONVERTED_ITEM_ID = L"Unconverted Item ID";
|
|
1140
|
+
const LPCWSTR OPC_PROPERTY_DESC_UNFILTERED_ITEM_ID = L"Unfiltered Item ID";
|
|
1141
|
+
const LPCWSTR OPC_PROPERTY_DESC_DATA_FILTER_VALUE = L"Data Filter Value";
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
//==========================================================================
|
|
1145
|
+
// Synchronous Interfaces
|
|
1146
|
+
|
|
1147
|
+
interface IOPCServer;
|
|
1148
|
+
interface IOPCServerPublicGroups;
|
|
1149
|
+
interface IOPCBrowseServerAddressSpace;
|
|
1150
|
+
interface IOPCGroupStateMgt;
|
|
1151
|
+
interface IOPCPublicGroupStateMgt;
|
|
1152
|
+
interface IOPCSyncIO;
|
|
1153
|
+
interface IOPCAsyncIO;
|
|
1154
|
+
interface IOPCDataCallback;
|
|
1155
|
+
interface IOPCItemMgt;
|
|
1156
|
+
interface IEnumOPCItemAttributes;
|
|
1157
|
+
interface IOPCAsyncIO2;
|
|
1158
|
+
interface IOPCItemProperties;
|
|
1159
|
+
interface IOPCItemDeadbandMgt;
|
|
1160
|
+
interface IOPCItemSamplingMgt;
|
|
1161
|
+
interface IOPCBrowse;
|
|
1162
|
+
interface IOPCItemIO;
|
|
1163
|
+
interface IOPCSyncIO2;
|
|
1164
|
+
interface IOPCAsyncIO3;
|
|
1165
|
+
interface IOPCGroupStateMgt2;
|
|
1166
|
+
};
|