DACLTSDK.pas
上传用户:fuyouda
上传日期:2015-08-19
资源大小:6876k
文件大小:5k
源码类别:

家庭/个人应用

开发平台:

Visual C++

  1. unit DACLTSDK;
  2. interface
  3. uses Windows, Classes, ActiveX, SysUtils;
  4. const SDK='DACLTSDK.DLL';
  5. type
  6.   OPCBROWSETYPE = TOleEnum;
  7. const
  8.   OPC_BRANCH = 1;
  9.   OPC_LEAF   = 2;
  10.   OPC_FLAT   = 3;
  11. type
  12.   OPCNAMESPACETYPE = TOleEnum;
  13. const
  14.   OPC_NS_HIERARCHIAL = 1;
  15.   OPC_NS_FLAT        = 2;
  16. type
  17.   OPCBROWSEDIRECTION = TOleEnum;
  18. const
  19.   OPC_BROWSE_UP   = 1;
  20.   OPC_BROWSE_DOWN = 2;
  21.   OPC_BROWSE_TO   = 3;
  22. type
  23.   OPCSERVERSTATE = TOleEnum;
  24. const
  25.   OPC_STATUS_RUNNING   = 1;
  26.   OPC_STATUS_FAILED    = 2;
  27.   OPC_STATUS_NOCONFIG  = 3;
  28.   OPC_STATUS_SUSPENDED = 4;
  29.   OPC_STATUS_TEST      = 5;
  30. type
  31.   TDATACHANGEPROC=procedure(ServerHandle,GroupHandle,ItemHandle:DWORD; pVar:Variant; timestamp:TFILETIME; quality:WORD); stdcall;
  32.   TSHUTDOWNPROC=procedure(ServerHandle: DWORD); stdcall;
  33.   OPCSERVERSTATUS = record
  34.     ftStartTime:          TFileTime;
  35.     ftCurrentTime:        TFileTime;
  36.     ftLastUpdateTime:     TFileTime;
  37.     dwServerState:        OPCSERVERSTATE;
  38.     dwGroupCount:         DWORD;
  39.     dwBandWidth:          DWORD;
  40.     wMajorVersion:        Word;
  41.     wMinorVersion:        Word;
  42.     wBuildNumber:         Word;
  43.     wReserved:            Word;
  44.     szVendorInfo:         POleStr;
  45.   end;
  46.   POPCSERVERSTATUS = ^OPCSERVERSTATUS;
  47.   //base info
  48.   function  ASDAC_GetVersion: DWORD;stdcall; external SDK;
  49.   //init or uninit package
  50.   function ASDAC_Init: BOOL; stdcall; external SDK;
  51.   function ASDAC_Uninit: BOOL; stdcall; external SDK;
  52.   function ASDAC_ActiveCode(UserName: LPCSTR; Password: LPCSTR): BOOL; stdcall; external SDK;
  53.   function ASDAC_GetServers(ComputerName: LPCSTR; Version: DWORD; ServerNames, ServerClassIDs: PVariant): Integer; stdcall; external SDK;
  54.   //server manager
  55.   function ASDAC_Connect(ComputerName,ClassID: LPCSTR; Version: DWORD): DWORD; stdcall; external SDK;
  56.   function ASDAC_Disconnect(ServerHandle: DWORD): BOOL; stdcall; external SDK;
  57.   function ASDAC_GetServerStatus(ServerHandle: DWORD; StartTime, CurrentTime, UpdateTime: PFileTIme;
  58.     State: PWORD; BandWidth, GroupCount: PDWORD; MajorVersion, MinorVersion, BuildNum: PWORD;
  59.     vendor: PChar; Size: DWORD): BOOL; stdcall; external SDK;
  60.   function ASDAC_AddGroup(ServerHandle: DWORD; Name:LPCSTR; Active:BOOL; Rate:DWORD; TimeBias: DWORD; DeadBand: Single; dwLCID:DWORD): DWORD; stdcall; external SDK;
  61.   function ASDAC_RemoveGroup(ServerHandle, GroupHandle: DWORD): BOOL;stdcall; external SDK;
  62.   function ASDAC_SetGroupName(ServerHandle, GroupHandle: DWORD; Name: LPCSTR): BOOL;stdcall; external SDK;
  63.   function ASDAC_SetGroupStat(ServerHandle, GroupHandle: DWORD; Rate: DWORD; Active: BOOL; TimeBias: LongInt; DeadBand:Single; dwLCID:DWORD): BOOL; stdcall; external SDK;
  64.   function ASDAC_GetGroupStat(ServerHandle,GroupHandle: DWORD;  pRate: PDWORD; pActive:PBOOL; pTimeBias: PLONGINT; pDeadBand: PSingle; dwLCID:PDWORD):BOOL;stdcall; external SDK;
  65.   function ASDAC_RefreshGroup(ServerHandle,GroupHandle: DWORD; DataSource: WORD): BOOL;stdcall; external SDK;
  66.   //item manager
  67.   function ASDAC_AddItem(ServerHandle,GroupHandle: DWORD; ItemName:LPCSTR): DWORD;stdcall; external SDK;
  68.   function ASDAC_RemoveItem(ServerHandle,GroupHandle, ItemHandle: DWORD): BOOL; stdcall; external SDK;
  69.   function ASDAC_WriteItem(ServerHandle, GroupHandle,ItemHandle: DWORD; Value: VARIANT; DoAsync: BOOL): BOOL;stdcall; external SDK;
  70.   function ASDAC_ReadItem(ServerHandle,GroupHandle,ItemHandle: DWORD; pVar: PVARIANT; pTimeStamp: PFILETIME; pQuality:PDWORD): BOOL; stdcall; external SDK;
  71.   function ASDAC_ActiveItem(ServerHandle,GroupHandle,ItemHandle: DWORD; Active:BOOL): BOOL;stdcall; external SDK;
  72.   function ASDAC_ValidateItem(ServerHandle,GroupHandle: DWORD; Name: LPCSTR; DataType: WORD; pAccessRights: DWORD): BOOL;stdcall; external SDK;
  73.   //address space browser
  74.   function ASDAC_GetNameSpace(ServerHandle: DWORD; pNameSpace: PWORD):BOOL;stdcall; external SDK;
  75.   function ASDAC_ChangeBrowsePosition(ServerHandle: THANDLE; Direction: WORD; NodeName: PChar): BOOL; stdcall; external SDK;
  76.   function ASDAC_BrowseItems(ServerHandle: DWORD; FilterType: WORD; FilterString: LPCSTR; FilterDataType: TVARTYPE; FilterAccessRights:DWORD; ItemNames: PVariant):Integer;stdcall; external SDK;
  77.   function ASDAC_GetItemFullName(ServerHandle:DWORD; ItemName: LPCSTR; pQualifiedName: LPCSTR; Size: Integer): BOOL; stdcall; external SDK;
  78.   function ASDAC_GetItemProperties(ServerHandle:DWORD; ItemName: LPCSTR; IDList, DataTypeList, DescList: PVariant): Integer; stdcall; external SDK;
  79.   function ASDAC_GetItemPropertyValue(ServerHandle: DWORD; ItemName: LPCSTR; ID: DWORD; pValue: PVARIANT): BOOL; stdcall; external SDK;
  80.   // set callback procedure
  81.   function ASDAC_SetDataChangeProc(ServerHandle: DWORD; lpCallback: TDATACHANGEPROC): BOOL; stdcall; external SDK;
  82.   function ASDAC_SetShutdownProc(ServerHandle: DWORD; lpCallback: TSHUTDOWNPROC): BOOL; stdcall; external SDK;
  83. implementation
  84. end.