⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 opcda.idl

📁 This is a source code of VxWorks
💻 IDL
📖 第 1 页 / 共 2 页
字号:
// OPCDA.IDL
// REVISION:  10/14/98 04:00 PM (EST)
// VERSIONINFO	2.0.0.0
// 12/05/97 acc fixed UNCERTAIN bits, add AsyncIO2, OPCDataCallback, 
//                OPCItemProperties,  BROWSE_TO
// 06/19/98 acc change V2 uuids prior to final release
//              to avoid conflict with 'old' OPCDA Automation uuids
// 10/14/98 acc change asynchio2::refresh() to refresh2() to avoid footprint
//               conflict for implementors using multiple inheritance.
//

#ifdef _WIN32
import "oaidl.idl" ;
#else
import "vxidl.idl";
#endif

typedef enum tagOPCDATASOURCE { 
    OPC_DS_CACHE = 1, 
    OPC_DS_DEVICE } OPCDATASOURCE ;

typedef enum tagOPCBROWSETYPE { 
    OPC_BRANCH = 1, 
    OPC_LEAF, 
    OPC_FLAT} OPCBROWSETYPE;

typedef enum tagOPCNAMESPACETYPE { 
    OPC_NS_HIERARCHIAL = 1, 
    OPC_NS_FLAT} OPCNAMESPACETYPE;

typedef enum tagOPCBROWSEDIRECTION { 
    OPC_BROWSE_UP = 1, 
    OPC_BROWSE_DOWN, OPC_BROWSE_TO} OPCBROWSEDIRECTION;

// **NOTE** the 1.0 IDL contained an error for ACCESSRIGHTS. 
// They should not have been an ENUM.
// They should have been two mask bits as noted here.
cpp_quote("#define OPC_READABLE    1")
cpp_quote("#define OPC_WRITEABLE   2")

typedef enum tagOPCEUTYPE { 
    OPC_NOENUM = 0, 
    OPC_ANALOG, 
    OPC_ENUMERATED } OPCEUTYPE;

typedef enum tagOPCSERVERSTATE { 
    OPC_STATUS_RUNNING = 1, 
    OPC_STATUS_FAILED, 
    OPC_STATUS_NOCONFIG, 
    OPC_STATUS_SUSPENDED, 
    OPC_STATUS_TEST } OPCSERVERSTATE;

typedef enum tagOPCENUMSCOPE { OPC_ENUM_PRIVATE_CONNECTIONS = 1, 
    OPC_ENUM_PUBLIC_CONNECTIONS, 
    OPC_ENUM_ALL_CONNECTIONS, 
    OPC_ENUM_PRIVATE, 
    OPC_ENUM_PUBLIC, 
    OPC_ENUM_ALL } OPCENUMSCOPE;

typedef DWORD OPCHANDLE;

typedef struct tagOPCGROUPHEADER {
    DWORD       dwSize;
    DWORD       dwItemCount;
    OPCHANDLE   hClientGroup;
    DWORD       dwTransactionID;
    HRESULT     hrStatus;
} OPCGROUPHEADER;

typedef struct tagOPCITEMHEADER1 {
    OPCHANDLE   hClient;
    DWORD       dwValueOffset;
    WORD        wQuality;
    WORD        wReserved;
    FILETIME    ftTimeStampItem;
} OPCITEMHEADER1;

typedef struct tagOPCITEMHEADER2 {
    OPCHANDLE   hClient;
    DWORD       dwValueOffset;
    WORD        wQuality;
    WORD        wReserved;
} OPCITEMHEADER2;

typedef struct tagOPCGROUPHEADERWRITE {
    DWORD       dwItemCount;
    OPCHANDLE   hClientGroup;
    DWORD       dwTransactionID;
    HRESULT     hrStatus;
} OPCGROUPHEADERWRITE;

typedef struct tagOPCITEMHEADERWRITE {
    OPCHANDLE   hClient;
    HRESULT     dwError;
} OPCITEMHEADERWRITE;

typedef struct tagOPCITEMSTATE{
    OPCHANDLE   hClient;
    FILETIME    ftTimeStamp;
    WORD        wQuality;
    WORD        wReserved;
    VARIANT     vDataValue;
} OPCITEMSTATE;

typedef struct tagOPCSERVERSTATUS {
           FILETIME       ftStartTime;
           FILETIME       ftCurrentTime;
           FILETIME       ftLastUpdateTime;
           OPCSERVERSTATE dwServerState;
           DWORD          dwGroupCount; 
           DWORD          dwBandWidth;
           WORD           wMajorVersion;
           WORD           wMinorVersion;
           WORD           wBuildNumber;
           WORD           wReserved;
  [string] LPWSTR         szVendorInfo;
} OPCSERVERSTATUS;

typedef struct tagOPCITEMDEF {
  [string]              LPWSTR     szAccessPath;
  [string]              LPWSTR     szItemID;
                        BOOL       bActive ;
                        OPCHANDLE  hClient;
                        DWORD      dwBlobSize;
  [size_is(dwBlobSize)] BYTE     * pBlob;
                        VARTYPE    vtRequestedDataType;
                        WORD       wReserved;
} OPCITEMDEF;

typedef struct tagOPCITEMATTRIBUTES {
  [string]              LPWSTR     szAccessPath;
  [string]              LPWSTR     szItemID;
                        BOOL       bActive;
                        OPCHANDLE  hClient;
                        OPCHANDLE  hServer;
                        DWORD      dwAccessRights;
                        DWORD      dwBlobSize;
  [size_is(dwBlobSize)] BYTE     * pBlob;
                        VARTYPE    vtRequestedDataType;
                        VARTYPE    vtCanonicalDataType;
                        OPCEUTYPE  dwEUType;
                        VARIANT    vEUInfo;
} OPCITEMATTRIBUTES;

typedef struct tagOPCITEMRESULT {
                        OPCHANDLE  hServer;
                        VARTYPE    vtCanonicalDataType;
                        WORD       wReserved;
                        DWORD      dwAccessRights;
                        DWORD      dwBlobSize;
  [size_is(dwBlobSize)] BYTE     * pBlob;
} OPCITEMRESULT;


//****************************************************
// OPC Quality flags 
//
// Masks for extracting quality subfields
// (note 'status' mask also includes 'Quality' bits)
//
cpp_quote("#define    OPC_QUALITY_MASK            0xC0")
cpp_quote("#define    OPC_STATUS_MASK             0xFC")
cpp_quote("#define    OPC_LIMIT_MASK              0x03")

// Values for QUALITY_MASK bit field
//
cpp_quote("#define    OPC_QUALITY_BAD             0x00")
cpp_quote("#define    OPC_QUALITY_UNCERTAIN       0x40")
cpp_quote("#define    OPC_QUALITY_GOOD            0xC0")

// STATUS_MASK Values for Quality = BAD
//
cpp_quote("#define    OPC_QUALITY_CONFIG_ERROR    0x04")
cpp_quote("#define    OPC_QUALITY_NOT_CONNECTED   0x08")
cpp_quote("#define    OPC_QUALITY_DEVICE_FAILURE  0x0c")
cpp_quote("#define    OPC_QUALITY_SENSOR_FAILURE  0x10")
cpp_quote("#define    OPC_QUALITY_LAST_KNOWN      0x14")
cpp_quote("#define    OPC_QUALITY_COMM_FAILURE    0x18")
cpp_quote("#define    OPC_QUALITY_OUT_OF_SERVICE  0x1C")

// STATUS_MASK Values for Quality = UNCERTAIN
//
cpp_quote("#define    OPC_QUALITY_LAST_USABLE     0x44")
cpp_quote("#define    OPC_QUALITY_SENSOR_CAL      0x50")
cpp_quote("#define    OPC_QUALITY_EGU_EXCEEDED    0x54")
cpp_quote("#define    OPC_QUALITY_SUB_NORMAL      0x58")

// STATUS_MASK Values for Quality = GOOD
//
cpp_quote("#define    OPC_QUALITY_LOCAL_OVERRIDE  0xD8")


// Values for Limit Bitfield 
//
cpp_quote("#define    OPC_LIMIT_OK                0x00")
cpp_quote("#define    OPC_LIMIT_LOW               0x01")
cpp_quote("#define    OPC_LIMIT_HIGH              0x02")
cpp_quote("#define    OPC_LIMIT_CONST             0x03")

//****************************************************
//Interface Definitions
//
//****************************************************
[
  object,
  uuid(39c13a4d-011e-11d0-9675-0020afd8adb3),
  pointer_default(unique)
]
interface IOPCServer : IUnknown
{
  HRESULT AddGroup(
    [in, string]        LPCWSTR     szName,
    [in]                BOOL        bActive,
    [in]                DWORD       dwRequestedUpdateRate,
    [in]                OPCHANDLE   hClientGroup,
    [unique, in]        LONG      * pTimeBias,
    [unique, in]        FLOAT     * pPercentDeadband,
    [in]                DWORD       dwLCID,
    [out]               OPCHANDLE * phServerGroup,
    [out]               DWORD     * pRevisedUpdateRate,
    [in]                REFIID      riid,
    [out, iid_is(riid)] LPUNKNOWN * ppUnk
    );

  HRESULT GetErrorString( 
    [in]          HRESULT  dwError,
    [in]          LCID     dwLocale,
    [out, string] LPWSTR * ppString
    );

  HRESULT GetGroupByName(
    [in, string]        LPCWSTR szName,
    [in]                REFIID riid,
    [out, iid_is(riid)] LPUNKNOWN * ppUnk
    );

  HRESULT GetStatus( 
    [out] OPCSERVERSTATUS ** ppServerStatus
    );

  HRESULT RemoveGroup(
    [in] OPCHANDLE hServerGroup,
    [in] BOOL      bForce
    );

  HRESULT CreateGroupEnumerator(
    [in] OPCENUMSCOPE dwScope, 
    [in] REFIID       riid, 
    [out, iid_is(riid)] LPUNKNOWN* ppUnk
    );

}

//****************************************************
[
  object,
  uuid(39c13a4e-011e-11d0-9675-0020afd8adb3),
  pointer_default(unique)
]
interface IOPCServerPublicGroups : IUnknown
{
  HRESULT GetPublicGroupByName(
    [in, string]        LPCWSTR     szName,
    [in]                REFIID      riid,
    [out, iid_is(riid)] LPUNKNOWN * ppUnk
    );

  HRESULT RemovePublicGroup(
    [in] OPCHANDLE hServerGroup,
    [in] BOOL      bForce
    );
}


//****************************************************
[
  object,
  uuid(39c13a4f-011e-11d0-9675-0020afd8adb3),
  pointer_default(unique)
]
interface IOPCBrowseServerAddressSpace: IUnknown
{
  HRESULT QueryOrganization(
    [out] OPCNAMESPACETYPE  * pNameSpaceType
    );

  HRESULT ChangeBrowsePosition(
    [in]         OPCBROWSEDIRECTION dwBrowseDirection,  
    [in, string] LPCWSTR            szString
    );

  HRESULT BrowseOPCItemIDs(
    [in]         OPCBROWSETYPE   dwBrowseFilterType,
    [in, string] LPCWSTR         szFilterCriteria,  
    [in]         VARTYPE         vtDataTypeFilter,     
    [in]         DWORD           dwAccessRightsFilter,
    [out]        LPENUMSTRING  * ppIEnumString
    );        

  HRESULT GetItemID(
    [in]          LPWSTR   szItemDataID,
    [out, string] LPWSTR * szItemID
    );

  HRESULT BrowseAccessPaths(
    [in, string] LPCWSTR        szItemID,  
    [out]        LPENUMSTRING * ppIEnumString
    );
}



//****************************************************
[
  object,
  uuid(39c13a50-011e-11d0-9675-0020afd8adb3),
  pointer_default(unique)
]
interface IOPCGroupStateMgt : IUnknown
{
  HRESULT GetState(
    [out]         DWORD     * pUpdateRate, 
    [out]         BOOL      * pActive, 
    [out, string] LPWSTR    * ppName,
    [out]         LONG      * pTimeBias,
    [out]         FLOAT     * pPercentDeadband,
    [out]         DWORD     * pLCID,
    [out]         OPCHANDLE * phClientGroup,
    [out]         OPCHANDLE * phServerGroup
    );

  HRESULT SetState( 
    [unique, in]  DWORD     * pRequestedUpdateRate, 
    [out]         DWORD     * pRevisedUpdateRate, 
    [unique, in]  BOOL      * pActive, 
    [unique, in]  LONG      * pTimeBias,
    [unique, in]  FLOAT     * pPercentDeadband,
    [unique, in]  DWORD     * pLCID,
    [unique, in]  OPCHANDLE * phClientGroup
    );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -