公共组可以有Server和Client创建,资料上说Client创建的是private,然后再转化为Public,所以我想Server创建的应该是Public了。不知道1。0上有没有这个接口:IOPCServerPublicGroups,
可以用它的一个函数GetPublicGroupByName来取得和组的连接,返回一个指向该组的指针
呵呵,试试看!by the way,你用什么工具开发?
我找到这段内容好像就是答案。
I think there is a general misunderstanding about the architecture of an OPC Server.
The address space of the OPC Server that you can see via the browse interface is (normally) only the offline information about the available Items of the OPC Server. The browse interface allows the client to choose the items that are required for the data transfer.
To read and write the data of Items the OPC Client needs to add an OPCGroup object to the OPCServer object. The group object is the container for the Items. The client must use the ItemIDs (result from browsing and IOPCBrowseServerAddressSpace::GetItemID) to add the items to the Group.
!!!!!!!!!!
The Client must create the groups and only the client has access that creates the group. The groups are also completely independent from the address space. The server has no groups other than the client added groups
!!!!!!!!!!
The client must use the ServerHandles which are returned at the AddItems call to read and write the data of the items.
Only the items which are added to groups by a client are available online.