-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSimpleOPCFunctions.h
More file actions
26 lines (22 loc) · 1.08 KB
/
SimpleOPCFunctions.h
File metadata and controls
26 lines (22 loc) · 1.08 KB
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
#ifndef _SIMPLEOPCFUNCTIONS_H
#define _SIMPLEOPCFUNCTIONS_H
#include <atlbase.h> // required for using the "_T" macro
#include <iostream>
#include <ObjIdl.h>
#include "SimpleOPCClient/opcda.h"
#include "SimpleOPCClient/opcerror.h"
// Group and settings default names to work properly
#define OPC_SERVER_NAME L"Matrikon.OPC.Simulation.1"
#define VT VT_R4
IOPCServer *InstantiateServer(wchar_t ServerName[]);
void AddTheGroup(IOPCServer* pIOPCServer, IOPCItemMgt* &pIOPCItemMgt,
OPCHANDLE& hServerGroup);
void AddTheItem(IOPCItemMgt* pIOPCItemMgt, OPCHANDLE& hServerItem,wchar_t *item_id, OPCHANDLE hClientItem);
void ReadItem(IUnknown* pGroupIUnknown, OPCHANDLE hServerItem, VARIANT& varValue);
void RemoveItem(IOPCItemMgt* pIOPCItemMgt, OPCHANDLE hServerItem);
void RemoveGroup(IOPCServer* pIOPCServer, OPCHANDLE hServerGroup);
void SetDataCallback(IUnknown* pGroupIUnknown, IOPCDataCallback* pSOCDataCallback,
IConnectionPoint* &pIConnectionPoint, DWORD *pdwCookie);
bool VarToStr (VARIANT pvar, char *buffer);
bool GenerateVar (VARIANT* pvar, VARTYPE var_type, void* var_value);
#endif