While ((hr = pEnumGUID->Next (1, &serverGUID, &numberServers)) = S_OK) pEnumGUID->Next(maxServers,serverGUIDs, &numberServers) Hr = m_spServerList->EnumClassesOfCategories(2, catid, 0, NULL, (IEnumGUID**)&pEnumGUID) list all the OPC interfaces.Ĭatid=CATID_OPCDAServer10 //= CATID_OPCDAServer10 //OPC1.0 (I looked into it, but didn't need it myself so I have forgotten which interface it was). Interestingly, you can get the CLSID for these remote servers, but I believe there is a separate COM object you must create on the remote computer in order to back calculate a readable name for these.
#Kepserverex opc server code#
Here is also some commented out code demonstrating how you can enumerate all remote OPC servers. M_IOPCServer = (IOPCServer*) MultiQI.pItf Since we only asked for 1, lets just get it. CoCreateInstanceEx should have returned an array of pointers to interfaces. Hr = CoCreateInstanceEx (opcServerId, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER, &ServerInfo, 1, MultiQI) Create the OPC server object and query for the IOPCServer interface of the object. Wprintf(L"Couldn't get class id for %s\n Return value: %p", serverName, (void *)hr) try to attach to an existing OPC Server (so our OPC server is a proxy) qDebug() CLSIDFromProgID(serverName,&opcServerId) Printf("Co create returned: %p\n",(void *)hr) The Focas 1 OPC Server also supports the new Unsolicited communications mode of the Fast Ethernet card.
#Kepserverex opc server driver#
m_spServerList2 = (IOPCServerList2*)MultiQI.pItf Kepwares 32 bit GE FANUC Focas1 Ethernet CNC interface device driver works in conjunction with the OPC Server KEPServerEX, to provide data exchange between OPC Clients and GE CNC of the i series. hr = CoCreateInstance (CLSID_OpcServerList, NULL, CLSCTX_LOCAL_SERVER ,IID_IOPCServerList, (void**)&m_spServerList) HRESULT hr = CoCreateInstanceEx (CLSID_OpcServerList, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER, &ServerInfo, 1, MultiQI) // ,IID_IOPCServer, (void**)&m_IOPCServer) Create the OPC server object and query for the IOPCServer interface of the object This code should get a list of OPC servers on a remote or local machine assuming that OPCEnum is running.Ĭonst CLSID CLSID_OpcServerList = the first part of an OPC client is to connect to the OPCEnum service on the remote machine so we can look up the clsid of the OPC Server (given as a string). You can create an COM object on the remote server which will translate a OPC server name into a CLSID. If you are connecting to an OPC server which is installed on a remote computer which has not been installed locally, you must create a connection to OPCEnum (hopefully installed on both local and remote computer). Printf("OPC Server clsid: %p %p %p %p%p%p%p%p%p%p%p\n", (void*)opcServerId.Data1, (void*)opcServerId.Data2, (void*)opcServerId.Data3, (void*)opcServerId.Data4, (void*)opcServerId.Data4, (void*)opcServerId.Data4, (void*)opcServerId.Data4, (void*)opcServerId.Data4, (void*)opcServerId.Data4, (void*)opcServerId.Data4, (void*)opcServerId.Data4) If you are looking for a class id for an OPC server running locally, you can use this function: CLSID clsid
However I have developed OPC clients in c++.