View Code
1 / 以下是用于loDriver::ldFlags的标志。
2 #define loDF_IGNCASE (0x80) / ItemId对比时忽略大小写。
3 #define loDF_IGNACCPATH (0x40) / ItemMgmt::AddItem()中忽略访问路径。
4 #define loDF_NOCONV (0x100) / 不允许数据类型转换。
5 #define loDF_NOCOMP (0x200) / 标签值不作比较,时间戳进行比较
6 #define loDF_CHECKITEM (0x1000) / 引发ldAskItemID()被调用
7 #define loDF_CANONAME (0x2000)
8 / 例如:ldAskItemId( " level.one ")返回 " level:1 "标签,如果loDF_CANONAME被指定,创建OPC ITEM的时候 " level:1 "就被指定,但会花费一些内存,未命名的标签将被忽略。
9 #define loDF_SUBSCRIBE_RAW (0x80000)
10 / 影响loDriver::ldSubscribe(),如果被指定,不同的组不同的客户端的活动标签的每个变化都会激发ldSubscribe(),否则,只有活动的全局变化才会被监控。
11
12 / 以下标签改变空枚举器返回。
13 #define loDf_EE_SOK (1) / 返回S_OK和空枚举器
14 #define loDf_EE_NULL (2) / 返回S_FALSE和NULL枚举器
15 #define loDf_EE_SFALSE (3) / 返回S_FALSE和空枚举器(默认)
16 #define loDf_DWG (0x04) / Destroy服务器和所有未释放的组
17 #define loDf_NOFORCE (0x08) / 忽略RemoveGroup()中的FORCE标记
18
19 / 以下三个标签只用于进程内服务器,线程模型
20 #define loDf_FREEMARSH (0x10000)
21 #define loDf_BOTHMODEL (0x20000)
22 #define loDf_FREEMODEL (0x40000)
23
24 / 以下是用于ldReadTags()的专门返回值
25 #define loDR_CACHED (1)
26 #define loDR_STORED (2)
27
28 / 以下是用于ldWriteTags()的专门返回值
29 #define loDW_ALLDONE (0)
30 #define loDW_TOCACHE (1)
31
32 / 以下是调用ldAskItemID()时可能的目标,将来可能返回常数。
33 #define loDAIG_MASK (0x00f0) /mask of a main goal code, no subcodes defined yet
34 #define loDAIG_LOINT (0x0000) / LOPC内在需要
35 #define loDAIG_ADDITEM (0x0010) / OPCItemMgt::AddItems()
36 #define loDAIG_VALIDATE (0x0020) / OPCItemMgt::ValidateItem()
37 #define loDAIG_BROWSE (0x0030) / OPCBrowseAddressSpace::的一个方法
38 #define loDAIG_IPROPERTY (0x0040) / OPCItemProperties::
39 #define loDAIG_IPROPQUERY (0x0041) / OPCItemProperties::QueryAvailableProperties()
40 #define loDAIG_IPROPGET (0x0042) / OPCItemProperties::GetItemProperties()
41 #define loDAIG_IPROPLOOKUP (0x0043) / OPCItemProperties::LookupItemID()
42 #define loDAIG_IPROPRQUERY (0x0045) / Query VarType of a tag referenced as property
43 #define loDAIG_IPROPRGET (0x0046) / Readig value of a tag referenced as property
44
45 typedef struct loVendorInfo /卖主信息
46 {
47 WORD lviMajor, lviMinor, lviBuild, lviReserv;
48 Char *lviInfo;
49 } loVendorInfo;
50
51 / 初始化的第一步(after initing a logging facility)
52 int loServiceCreate(loService **result,
53 const loDriver *,
54 unsigned tagcount); / 设定标签上限,只要内存允许
55 / 每个标签loAddRealTag_b*()消耗150字节,loAddRealTag*()消耗250个字节
56
57 int loServiceDestroy(loService *se) / 实际上服务器不会Destroy,非线程安全
58
59 / 创建一个新客户端连接到服务器
60 int loClientCreate(loService *se,
61 loClient **cli,
62 int ldFlags,
63 const loVendorInfo *vi,
64 void (*release_handle)( void *,
65 loService *,
66 loClient *),
67 void *release_handle_arg);
68
69 / 创建一个聚合服务器对象
70 int loClientCreate_agg(loService *se,
71 loClient **cli,
72 IUnknown *outer,
73 IUnknown **inner,
74 Int ldFlags,
75 Const loVendorInfo *vi,
76 Void (*release_handle)( void *,
77 loService *,
78 loClient *),
79 Void *release_handle_arg);
80
81 int loClientChain(loClient *cli,
82 HRESULT (*qi_chain)( void *rha,
83 loService *,
84 loClient *,
85 const IID *,
86 LPVOID *),
87 void (*release_handle)( void *rha,
88 loService *,
89 loClient *),
90 void *release_handle_arg);
91
92 #define loAM_RDWR (1) / 读写模式(默认)
93 #define loAM_RDONLY_OP (2) / 禁止写
94 #define loAM_RDONLY_ADD (4) / report all tags as read-only for Add/Validate/EnumIetmAttr
95 #define loAM_RDONLY_BROWSE (8) / report all tags as read-only for Browse
96 #define loAM_NOREAD_DEV (0x10) / perform cache read instead of device read
97 #define loAM_ERREAD_DEV (0x20) / error on device read
98
99 / 指定客户端的访问模式
100 Int loClientAccessMode(loService *,
101 loClient *,
102 int accmode);
103
104 / 返回服务器的release_handle_arg
105 Void *loClientArg(loClient *);
106
107 / 返回服务器的loDriver::ldDriverArg
108 Void *loDriverArg(loService *);
109 #define loDriverArg(se) (*((void**)se))
110
111 / 创建一个标签
112 int loAddRealTag(loService *,
113 loTagId *ti,
114 loRealTag rt,
115 const char *tName,
116 int tFlag,
117 unsigned tRight,
118 VARIANT *tValue,
119 /* OPCEUTYPE */ int tEUtype,
120 VARIANT *tEUinfo);
121
122 #define loTF_NOCOMP (loDF_NOCOMP)
123 #define loTF_NOCONV (loDF_NOCONV)
124 #define loTF_EMPTY (0x400)
125 #define loTF_CONVERT (0x800)
126 #define loTF_CHECKITEM (loDF_CHECKITEM)
127 #define loTF_CANONAME (loDF_CANONAME)
128 #define loTF_NOBROWSE (0x4000)
129
130 int loAddRealTag_a(loService *,
131 loTagId *ti,
132 loRealTag rt,
133 const char *tName,
134 int tFlag,
135 unsigned tRight,
136 VARIANT *tValue,
137 Double range_min,
138 Double range_max);
139
140 int loAddRealTag_b(loService *,
141 loTagId *ti,
142 loRealTag rt,
143 const char *tName,
144 int tFlag,
145 unsigned tRight,
146 loTagId tBase);
147
148 int loAddRealTagW(loService *,
149 loTagId *ti,
150 loRealTag rt,
151 const loWchar *tName,
152 int tFlag,
153 unsigned tRight,
154 VARIANT *tValue,
155 /* OPCEUTYPE */ int tEUtype,
156 VARIANT *tEUinfo);
157
158 int loAddRealTag_aW(loService *,
159 loTagId *ti,
160 loRealTag rt,
161 const loWchar *tName,
162 int tFlag,
163 unsigned tRight,
164 VARIANT *tValue,
165 double range_min,
166 double range_max);
167
168 int loAddRealTag_bW(loService *,
169 loTagId *ti,
170 loRealTag rt,
171 const loWchar *tName,
172 int tFlag,
173 unsigned tRight,
174 loTagId tBase);
2 #define loDF_IGNCASE (0x80) / ItemId对比时忽略大小写。
3 #define loDF_IGNACCPATH (0x40) / ItemMgmt::AddItem()中忽略访问路径。
4 #define loDF_NOCONV (0x100) / 不允许数据类型转换。
5 #define loDF_NOCOMP (0x200) / 标签值不作比较,时间戳进行比较
6 #define loDF_CHECKITEM (0x1000) / 引发ldAskItemID()被调用
7 #define loDF_CANONAME (0x2000)
8 / 例如:ldAskItemId( " level.one ")返回 " level:1 "标签,如果loDF_CANONAME被指定,创建OPC ITEM的时候 " level:1 "就被指定,但会花费一些内存,未命名的标签将被忽略。
9 #define loDF_SUBSCRIBE_RAW (0x80000)
10 / 影响loDriver::ldSubscribe(),如果被指定,不同的组不同的客户端的活动标签的每个变化都会激发ldSubscribe(),否则,只有活动的全局变化才会被监控。
11
12 / 以下标签改变空枚举器返回。
13 #define loDf_EE_SOK (1) / 返回S_OK和空枚举器
14 #define loDf_EE_NULL (2) / 返回S_FALSE和NULL枚举器
15 #define loDf_EE_SFALSE (3) / 返回S_FALSE和空枚举器(默认)
16 #define loDf_DWG (0x04) / Destroy服务器和所有未释放的组
17 #define loDf_NOFORCE (0x08) / 忽略RemoveGroup()中的FORCE标记
18
19 / 以下三个标签只用于进程内服务器,线程模型
20 #define loDf_FREEMARSH (0x10000)
21 #define loDf_BOTHMODEL (0x20000)
22 #define loDf_FREEMODEL (0x40000)
23
24 / 以下是用于ldReadTags()的专门返回值
25 #define loDR_CACHED (1)
26 #define loDR_STORED (2)
27
28 / 以下是用于ldWriteTags()的专门返回值
29 #define loDW_ALLDONE (0)
30 #define loDW_TOCACHE (1)
31
32 / 以下是调用ldAskItemID()时可能的目标,将来可能返回常数。
33 #define loDAIG_MASK (0x00f0) /mask of a main goal code, no subcodes defined yet
34 #define loDAIG_LOINT (0x0000) / LOPC内在需要
35 #define loDAIG_ADDITEM (0x0010) / OPCItemMgt::AddItems()
36 #define loDAIG_VALIDATE (0x0020) / OPCItemMgt::ValidateItem()
37 #define loDAIG_BROWSE (0x0030) / OPCBrowseAddressSpace::的一个方法
38 #define loDAIG_IPROPERTY (0x0040) / OPCItemProperties::
39 #define loDAIG_IPROPQUERY (0x0041) / OPCItemProperties::QueryAvailableProperties()
40 #define loDAIG_IPROPGET (0x0042) / OPCItemProperties::GetItemProperties()
41 #define loDAIG_IPROPLOOKUP (0x0043) / OPCItemProperties::LookupItemID()
42 #define loDAIG_IPROPRQUERY (0x0045) / Query VarType of a tag referenced as property
43 #define loDAIG_IPROPRGET (0x0046) / Readig value of a tag referenced as property
44
45 typedef struct loVendorInfo /卖主信息
46 {
47 WORD lviMajor, lviMinor, lviBuild, lviReserv;
48 Char *lviInfo;
49 } loVendorInfo;
50
51 / 初始化的第一步(after initing a logging facility)
52 int loServiceCreate(loService **result,
53 const loDriver *,
54 unsigned tagcount); / 设定标签上限,只要内存允许
55 / 每个标签loAddRealTag_b*()消耗150字节,loAddRealTag*()消耗250个字节
56
57 int loServiceDestroy(loService *se) / 实际上服务器不会Destroy,非线程安全
58
59 / 创建一个新客户端连接到服务器
60 int loClientCreate(loService *se,
61 loClient **cli,
62 int ldFlags,
63 const loVendorInfo *vi,
64 void (*release_handle)( void *,
65 loService *,
66 loClient *),
67 void *release_handle_arg);
68
69 / 创建一个聚合服务器对象
70 int loClientCreate_agg(loService *se,
71 loClient **cli,
72 IUnknown *outer,
73 IUnknown **inner,
74 Int ldFlags,
75 Const loVendorInfo *vi,
76 Void (*release_handle)( void *,
77 loService *,
78 loClient *),
79 Void *release_handle_arg);
80
81 int loClientChain(loClient *cli,
82 HRESULT (*qi_chain)( void *rha,
83 loService *,
84 loClient *,
85 const IID *,
86 LPVOID *),
87 void (*release_handle)( void *rha,
88 loService *,
89 loClient *),
90 void *release_handle_arg);
91
92 #define loAM_RDWR (1) / 读写模式(默认)
93 #define loAM_RDONLY_OP (2) / 禁止写
94 #define loAM_RDONLY_ADD (4) / report all tags as read-only for Add/Validate/EnumIetmAttr
95 #define loAM_RDONLY_BROWSE (8) / report all tags as read-only for Browse
96 #define loAM_NOREAD_DEV (0x10) / perform cache read instead of device read
97 #define loAM_ERREAD_DEV (0x20) / error on device read
98
99 / 指定客户端的访问模式
100 Int loClientAccessMode(loService *,
101 loClient *,
102 int accmode);
103
104 / 返回服务器的release_handle_arg
105 Void *loClientArg(loClient *);
106
107 / 返回服务器的loDriver::ldDriverArg
108 Void *loDriverArg(loService *);
109 #define loDriverArg(se) (*((void**)se))
110
111 / 创建一个标签
112 int loAddRealTag(loService *,
113 loTagId *ti,
114 loRealTag rt,
115 const char *tName,
116 int tFlag,
117 unsigned tRight,
118 VARIANT *tValue,
119 /* OPCEUTYPE */ int tEUtype,
120 VARIANT *tEUinfo);
121
122 #define loTF_NOCOMP (loDF_NOCOMP)
123 #define loTF_NOCONV (loDF_NOCONV)
124 #define loTF_EMPTY (0x400)
125 #define loTF_CONVERT (0x800)
126 #define loTF_CHECKITEM (loDF_CHECKITEM)
127 #define loTF_CANONAME (loDF_CANONAME)
128 #define loTF_NOBROWSE (0x4000)
129
130 int loAddRealTag_a(loService *,
131 loTagId *ti,
132 loRealTag rt,
133 const char *tName,
134 int tFlag,
135 unsigned tRight,
136 VARIANT *tValue,
137 Double range_min,
138 Double range_max);
139
140 int loAddRealTag_b(loService *,
141 loTagId *ti,
142 loRealTag rt,
143 const char *tName,
144 int tFlag,
145 unsigned tRight,
146 loTagId tBase);
147
148 int loAddRealTagW(loService *,
149 loTagId *ti,
150 loRealTag rt,
151 const loWchar *tName,
152 int tFlag,
153 unsigned tRight,
154 VARIANT *tValue,
155 /* OPCEUTYPE */ int tEUtype,
156 VARIANT *tEUinfo);
157
158 int loAddRealTag_aW(loService *,
159 loTagId *ti,
160 loRealTag rt,
161 const loWchar *tName,
162 int tFlag,
163 unsigned tRight,
164 VARIANT *tValue,
165 double range_min,
166 double range_max);
167
168 int loAddRealTag_bW(loService *,
169 loTagId *ti,
170 loRealTag rt,
171 const loWchar *tName,
172 int tFlag,
173 unsigned tRight,
174 loTagId tBase);