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

📄 yfopcsdk.bas

📁 OPC CLIENT开发包
💻 BAS
字号:
Attribute VB_Name = "YFOPCSDK"
Option Explicit


Public Declare Function OPC_GetVersion Lib "YFOPCSDK.dll" () As Long
Public Declare Function OPC_Init Lib "YFOPCSDK.dll" () As Long
Public Declare Function OPC_Uninit Lib "YFOPCSDK.dll" () As Long
Public Declare Function OPC_ActiveCode Lib "YFOPCSDK.dll" (ByVal regName As String, ByRef regCode As String) As Long
Public Declare Function OPC_GetServers Lib "YFOPCSDK.dll" (ByVal Host As String, ByVal Version As Long, ServerNames As Variant, _
    ServerClassIDs As Variant) As Long
Public Declare Function OPC_Connect Lib "YFOPCSDK.dll" (ByVal Host As String, ByVal ServerClass As String, ByVal Version As Long) As Long
Public Declare Function OPC_Disconnect Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long) As Long
Public Declare Function OPC_GetServerStatus Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByRef StartTime As Double, _
    ByRef CurrentTime As Double, ByRef LastUpdateTime As Double, ByRef State As Integer, ByRef BandWidth As Long, _
    ByRef GroupCount As Long, ByRef MajorVersion As Integer, ByRef MinorVersion As Integer, ByRef BuildNumber As Integer, _
    ByVal vendor As String, ByVal size As Long) As Long

Public Declare Function OPC_AddGroup Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal Name As String, ByVal Active As Long, _
    ByVal UpdateRate As Long, ByVal TimeBias As Long, ByVal DeadBand As Single, ByVal LCID As Long) As Long
Public Declare Function OPC_RemoveGroup Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long) As Boolean
Public Declare Function OPC_SetGroupName Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, ByVal Name As String) As Long
Public Declare Function OPC_SetGroupStat Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, _
    ByVal UpdateRate As Long, ByVal Active As Long, ByVal TimeBias As Long, ByVal DeadBand As Single, ByVal LCID As Long) As Long
Public Declare Function OPC_GetGroupStat Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, _
    ByRef UpdateRate As Long, ByRef pActive As Long, ByRef pTimeBias As Long, ByRef pDeadBand As Single, ByRef pLCID As Long) As Long
Public Declare Function OPC_RefreshGroup Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, _
    ByVal DataSoure As Integer) As Long

Public Declare Function OPC_GetNameSpace Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByRef NameSpace As Integer) As Long
Public Declare Function OPC_ChangeBrowsePosition Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal Direct As Integer, _
    ByVal NodeName As String) As Long
Public Declare Function OPC_BrowseItems Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal FilterType As Integer, _
    ByVal FilterString As String, ByVal FilterDataType As Integer, ByVal FilterAccessRight As Integer, ByRef ItemNames As Variant) As Long
Public Declare Function OPC_GetItemFullName Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal Name As String, _
    ByVal pFullName As String, ByVal size As Long) As Long
Public Declare Function OPC_GetItemProperties Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, ByVal Name As String, _
    IDList As Variant, DataTypeList As Variant, DescList As Variant) As Long
Public Declare Function OPC_GetItemPropertyValue Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, ByVal Name As String, _
    ByVal PropertyID As Integer, Value As Variant) As Long

Public Declare Function OPC_AddItem Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, ByVal Name As String) As Long
Public Declare Function OPC_RemoveItem Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, ByVal ItemHandle As Long) As Long
Public Declare Function OPC_ActiveItem Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, ByVal hClientHandle As Long, ByVal Active As Long) As Long
'Public Declare Function OPC_ActiveItem Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, ByVal Active As Long) As Long
Public Declare Function OPC_WriteItem Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, _
    ByVal ItemHandle As Long, ByVal Value As Variant, ByVal DoAsync As Long) As Long
Public Declare Function OPC_ReadItem Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, _
    ByVal ItemHandle As Long, ByRef Value As Variant, ByRef TimeStamp As Double, ByRef Quality As Integer) As Long
Public Declare Function OPC_ValidateItem Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal GroupHandle As Long, _
    ByVal Name As String, ByRef DataType As Integer, ByVal AccessRight As Integer) As Long

'// prototype for the callback function is as follows:
'//      void CALLBACK EXPORT DataChangeProc(HANDLE GroupHandle, HANDLE ItemHandle, VARIANT pVar, FILETIME timestamp, WORD quality)
'//  Param:  HANDLE ServerHandle             --  HANDLE of connected opc server
'//          DATACHANGEPROC lpCallback   --  pointer of callback function  in user application
'//  Return: BOOL                        --  TRUE if succeded, FALSE if failed
Public Declare Function OPC_SetDataChangeProc Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal callback As Long) As Long
'// prototype for the callback function is as follows:
'//      void CALLBACK EXPORT ShutDownProc(HANDLE ServerHandle)
'//  Param:  HANDLE ServerHandle             --  HANDLE of connected opc server
Public Declare Function OPC_SetShutdownProc Lib "YFOPCSDK.dll" (ByVal ServerHandle As Long, ByVal callback As Long) As Long

Public Declare Function EnumLanHostIP Lib "YFOPCSDK.dll" (ByVal lpAddHostIP As Long) As Boolean
Public Declare Function EnumOPCName Lib "YFOPCSDK.dll" (ByVal hostname As String, ByVal Version As Long, ByVal lpAddOPCname As Long) As Boolean

Public Declare Sub OPC_SetProcessTiggerProc Lib "YFOPCSDK.dll" (ByVal callback As Long)

















⌨️ 快捷键说明

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