background image

OPCServer 提供的接口:

IOPCCommon
HRESULT SetLocaleID ( dwLcid ) 设定位置信息
HRESULT GetLocaleID ( pdwLcid ) 取得位置信息
HRESULT QueryAvailableLocaleIDs ( pdwCount, pdwLcid ) 查询可用的位置 ID
HRESULT GetErrorString ( dwError, ppString) 取得错误信息字符串
HRESULT SetClientName (szName)设定 Clinet 的名称

IOPCServer
HRESULT  AddGroup(szName,  bActive,  dwRequestedUpdateRate,  hClientGroup,  pTimeBias, 
pPercentDeadband,  dwLCID,  phServerGroup,  pRevisedUpdateRate,  riid,  ppUnk)  新 增 一 个

 

OPCGroup
HRESULT GetErrorString(dwError, dwLocale, ppString) 取得错误信息字符串
HRESULT GetGroupByName(szName, riid, ppUnk) 依据名称取得 OPCGroup 的介面
HRESULT GetStatus(ppServerStatus) 取得 OPCServer 的状态信息
HRESULT SetClientName (szName)设定 Clinet 的名称 RemoveGroup(hServerGroup, bForce)移
除一个

OPCGroup

HRESULT CreateGroupEnumerator(dwScope, riid, ppUnk) 产生一个 OPCGroup 列举器

IConnectionPointContainer
HRESULT EnumConnectionPoints( IEnumConnectionPoints ppEnum)  列举所有的 Connection 
Points
HRESULT  FindConnectionPoint(  REFIID  riid,  IConnectionPoint  ppCP) 找 出 一 个   Connection 
Point

IOPCItemProperties
HRESULT  QueryAvailableProperties(szItemID,  pdwCount,ppPropertyIDs,  ppDescriptions, 
ppvtDataTypes ); 查询可用的 OPCItem 属性
HRESULT  GetItemProperties  (szItemID,  dwCount,  pdwPropertyIDs,ppvData,  ppErrors  )  取 得

 

OPCItem 的属性
HRESULT LookupItemIDs( szItemID, dwCount, pdwPropertyIDs,ppszNewItemIDs, ppErrors )使
用名称查询

OPCItem 的 ID

IOPCBrowseServerAddressSpace (optional)
HRESULT QueryOrganization(pNameSpaceType )查询组织名称
HRESULT ChangeBrowsePosition(dwBrowseDirection, szString )变更浏览的位置
HRESULT  BrowseOPCItemIDs(  dwBrowseFilterType,  szFilterCriteria,  vtDataTypeFilter, 
dwAccessRightsFilter, ppIEnumString )浏览 OPCServer 內所有定义的 OPCItem
HRESULT GetItemID( szItemDataID, szItemID ) 取得 OPCItem 的 ID