亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? opcserverclass.cls

?? 很好的Kepware的VB的OPC Client例子.
?? CLS
?? 第 1 頁 / 共 3 頁
字號:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "OPCServerClass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' The OPCServerClass object is the basic building block object
' for your OPC application.  All interaction with an OPC server
' begins first by connecting to the OPC server.  The OPCServerClass
' object wraps the Automation interface OPCServer object.
' This diagram shows the relationships between the various components
' of the Automation interface wrapper.
'
' >  OPCServer                                      <
' >          |                                      <
' >          +-OPC Groups (Collection)              <
'                      |
'                      +-OPC Group
'                                |
'                                +-OPC Items (Collection)
'                                           |
'                                           +-OPC Items
'
' The OPCServerClass object handles functions found in the first two
' branches of this diagram, the OPCServer object and OPCGroups collection.
' I have not implemented all of the methods and properties found in these
' objects.  Adding access to any methods or properties not currently in
' this module is easy.
'
' The OPCServerClass object handles encapsulating the ServerShutDown
' event.  This allows each instance of an the OPCServerClass object
' you create to get its own ServerShutDown event.

Option Explicit
Option Base 1
' The OPCServer objects must be declared here due to the use of WithEvents
' The OPCServer object is the basic object of the the Automation
' Interface.
Dim WithEvents OPCServerObj As OPCServer
Attribute OPCServerObj.VB_VarHelpID = -1

' The server name is the Prog ID of the connected OPC Server. This
' string is passed to the ConnectOPCServer function of this module
' from the VB application.
Dim OPCServerName As String

' This is a string key used to reference this OPCServerClass object.  The
' OPCServerKey can be used by the VB application anyway the user
' sees fit.  In some cases this is used as a key in controls such as
' a treeview of a listview.
Dim OPCServerKey As String

' The ServerGroups object contains the OPCGroups collection of the
' Automation Interface.  This is used to add new groups to the OPC
' server.  This is shown in the function AddOPCGroup.  This collection
' is kept by the actual Automation Interface wrapper.  The OPCServerClass
' object also keeps its own collection of OPCGroupClass objects.
Dim ServerGroups As OPCGroups

' The OPCServerGroups collection keeps list of OPC groups just like the
' ServerGroups object above.  This collection however is a list of
' OPCGroupClass objects.  The OPCGroupClass object wrap the methods and
' properties of the Automation Interface's OPCGroup and OPCItems collection.
Dim OPCServerGroups As New Collection

' The OPCServerIndex is the numeric version of the OPCServerClass key.
Dim OPCServerIndex As Integer

' The OPCServerClass object has the ability to generate an event when
' an OPC server is shutting down.   When an OPC server supports the
' OPC 2.0 data access specification, it has the option of issuing a
' ServerShutDown event to any of it's attached clients.  In the case
' of a VB application the OPCServer oject will signal the
' ServerShutDown event.  This event is handled here in the OPCServerClass
' object.  If this event fires, the ServerShuttingDown event of the
' OPCServerClass object will be fired.  A VB application has the option of
' hooking this event to be informed when the OPC connection is going to be
' lost.
Public Event ServerShuttingDown(ByVal ServerKey As String)


' The GetOPCServerList function is used to get a list of OPC servers
' available on either the local machine or a remote machine by
' supplying an optional node name.  The GetOPCServerList function
' can be used without an existing OPC connection as you would expect
' otherwise we would have chicken and egg problem.
'
Sub GetOPCServerList(ByRef ServerList As Variant, Optional ByVal NodeName As Variant)
    Dim i As Integer
    'Set error handling for OPC Function
    On Error GoTo ShowOPCGetServersError
    
    ServerList = OPCServerObj.GetOPCServers(NodeName)
     
    GoTo SkipOPCGetServersError
    
ShowOPCGetServersError:
    Call DisplayOPC_COM_ErrorValue("Get OPC Server List", Err.Number)
SkipOPCGetServersError:
End Sub


' This sub handles connecting with the selected OPC Server
' The OPCServer Object provides a method called 'Connect' that
' allows you to 'connect' with an OPC server.  The 'Connect'
' method can take two arguments, a server name and a Node name.
' In this example we don't use the Node name since it is
' optional.  When the 'Connect' method is called you should see
' the OPC Server application start if it is not aleady running.
' This function requires that the ServerKey be passed in as string
' forcing the VB application to manage the server keys.  Once a
' OPCServerClass object has been created and connected, the OPCGroupClass
' and OPCItemClass object create their own keys.
'
Function ConnectOPCServer(ServerName As String, ServerKey As String, ServerIndex As Integer, Optional ByVal NodeName As Variant)
    'Set error handling for OPC Function
    On Error GoTo ShowOPCConnectError
    '
    'Create a new OPC Server object
    'Load the selected server name to start the interface
    Dim StoreName As String
    Dim StoreKey As String
    
    StoreName = ServerName
    OPCServerName = StoreName
    OPCServerIndex = ServerIndex
    
    ' The ServerKey is stored as part of the OPCServerClass object to
    ' make access the collections and treeview easier.
    StoreKey = ServerKey
    OPCServerKey = StoreKey
    
    'Attempt to connect with the server (Local only in this example)
    OPCServerObj.Connect OPCServerName, NodeName

    ' Establish the base group collection object to add new groups
    ' this object will be used below in the group interface functions
    ' At thismpoint there are no groups we simply have the interface
    ' that will allow groups to be added.
    Set ServerGroups = OPCServerObj.OPCGroups
    
    ' Establish the initial default conditions for new groups added to this
    ' server.
    SetDefaultGroupIsActive (True)
    SetDefaultGroupUpdateRate (100)
    SetDefaultGroupDeadBand (0)
    
    
    ConnectOPCServer = True
    GoTo SkipOPCConnectError
    
ShowOPCConnectError:
    Call DisplayOPC_COM_ErrorValue("Connect", Err.Number)
    ConnectOPCServer = False
SkipOPCConnectError:
End Function


' This sub handles disconnecting from the OPC Server.  The OPCServer
' Object provides the method 'Disconnect'.  Calling this on an
' active OPCServer object will release the OPC Server interface with
' your application.  When this occurs you should see the OPC server
' application shut down if it started automatically on the OPC
' connect. This function should not be called until the group(s) and items
' have been removed from this OPCServerClass object.
'
Function DisconnectOPCServer()
    'Set error handling for OPC Function
    On Error GoTo ShowOPCDisconnectError

    'Disconnect from the server, This should only occur after the
    'items and group have been removed.  The server will release
    ' the groups and items for this connection even if you don't
    ' but it is good practice to release the groups and items
    ' progmatically since you don't want to count on the OPC
    ' server to clean up after your application.
    OPCServerObj.Disconnect
    DisconnectOPCServer = True
    
    GoTo SkipDisconnectError
ShowOPCDisconnectError:
    Call DisplayOPC_COM_ErrorValue("Disconnect", Err.Number)
    DisconnectOPCServer = False
SkipDisconnectError:
End Function

' This function handles returning the OPCServerKey string. The
' OPCServerKey is local to the OPCSererClass object and does not
' interact with the underlying Automation Interface.
'
Function GetOPCServerKey()
    GetOPCServerKey = OPCServerKey
End Function

' This functions returns a reference to the OPCServerGroups
' collection maintained by the OPCServerClass object. The
' OPCServerGroups is local to the OPCSererClass object and is not
' retrieved from the underlying Automation Interface.
'
Function GetOPCServerGroupCollection()
    Set GetOPCServerGroupCollection = OPCServerGroups
End Function


' This function returns Serverindex as a numeric value.  The
' OPCServerIndex is local to the OPCSererClass object and does not
' interact with the underlying Automation Interface.
'
Function GetOPCServerIndex()
    GetOPCServerIndex = OPCServerIndex
End Function


' This function returns the name of the OPC Server, this is the ProgId
' of the OPC server.
'
Function GetServerName(ByRef ServerName As String)
    ' Attempt to get the server ServerName.
    ServerName = OPCServerName
    GetServerName = True
End Function


' The next set of functions provide wrappers to the OPCServer object
' methods that allow you to get the various properties of the OPCServer
' object.
'


' Get the server StartTime property
' The server start time returns the time the server has started on
' the host machine.  The server start time is unique to the
' server. All connected clients will receive the same time.
'
Function GetStartTime(ByRef StartTime As Date)
    'Set error handling for OPC Function
    On Error GoTo ShowOPCStartTimeError
    
    ' Attempt to get the server start time.
    StartTime = OPCServerObj.StartTime
    GetStartTime = True
    GoTo SkipOPCStartTimeError
    
ShowOPCStartTimeError:
    Call DisplayOPC_COM_ErrorValue("StartTime", Err.Number)
    GetStartTime = False
    
SkipOPCStartTimeError:
End Function


' Get the server CurrentTime property
' The value is the current time at the server.  It is acquired
' by the OPC automation interface using the GetStatus interface.
'
Function GetCurrentTime(ByRef CurrentTime As Date)
    'Set error handling for OPC Function
    On Error GoTo ShowOPCCurrentTimeError
    
    ' Attempt to get the server current time.
    CurrentTime = OPCServerObj.CurrentTime
    GetCurrentTime = True
    GoTo SkipOPCCurrentTimeError
    
ShowOPCCurrentTimeError:
    Call DisplayOPC_COM_ErrorValue("CurrentTime", Err.Number)
    GetCurrentTime = False
    
SkipOPCCurrentTimeError:
End Function


' Get the LastUpdateTime property
' The LastUpdateTime return the time the last update occured
' for the server this value is for all clients connected to
' the server therfore the time returned may not be the last
' time your client received an update.
'
Function GetLastUpdateTime(ByRef LastUpdateTime As Date)
    'Set error handling for OPC Function
    On Error GoTo ShowOPCLastUpdateTimeError
    
    ' Attempt to get the server Last Update time.
    LastUpdateTime = OPCServerObj.LastUpdateTime
    GetLastUpdateTime = True
    GoTo SkipOPCLastUpdateTimeError

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产综合成人久久大片91| 国产无一区二区| 顶级嫩模精品视频在线看| 午夜精品福利在线| 亚洲成人中文在线| 五月激情综合网| 亚洲一区精品在线| 亚洲一卡二卡三卡四卡五卡| 一区二区三区.www| 亚洲一二三四在线| 91成人网在线| 成人黄色av电影| 成人久久18免费网站麻豆| 粉嫩高潮美女一区二区三区| 成人免费看的视频| 色综合天天综合给合国产| 一本色道亚洲精品aⅴ| 欧美在线一区二区三区| 欧美日韩一区高清| 日韩你懂的在线播放| 精品久久国产97色综合| 久久久精品日韩欧美| 国产精品乱码久久久久久| 亚洲欧美激情在线| 精品国产电影一区二区| 久久综合色8888| 国产精品久久国产精麻豆99网站| ...av二区三区久久精品| 一级特黄大欧美久久久| 日韩国产欧美视频| 国产精品乡下勾搭老头1| 99久久伊人网影院| 欧美日韩国产一级| 精品福利一二区| 国产精品卡一卡二卡三| 亚洲一区二区三区在线播放| 日韩av中文在线观看| 国产精品综合视频| 色婷婷久久久亚洲一区二区三区| 欧美夫妻性生活| 国产欧美一区二区三区网站| 一区二区三区四区蜜桃| 麻豆精品在线看| 成人av电影在线| 欧美精品一级二级| 欧美国产日韩在线观看| 亚洲一区在线看| 国产一区二区女| 欧美性猛交xxxx乱大交退制版| 91精品国产综合久久久久| 亚洲国产高清在线观看视频| 亚洲成人精品一区| 国产成人日日夜夜| 欧美福利视频导航| 亚洲人成网站在线| 九九九精品视频| 色网站国产精品| 久久久久久电影| 亚洲成人中文在线| 国产69精品久久99不卡| 欧美日本一区二区三区| 国产精品三级视频| 久久精品久久精品| 91国偷自产一区二区三区观看 | 成人理论电影网| 欧美高清性hdvideosex| 国产精品嫩草99a| 久久精品国产一区二区三区免费看| 99精品视频一区二区三区| 欧美一区二区日韩一区二区| 亚洲蜜臀av乱码久久精品| 国产精一品亚洲二区在线视频| 欧洲人成人精品| 国产精品久久综合| 国内精品伊人久久久久影院对白| 欧美综合欧美视频| 中文字幕制服丝袜成人av| 国模大尺度一区二区三区| 欧美日韩aaa| 国产精品热久久久久夜色精品三区 | 欧美日韩精品二区第二页| 国产精品久久久久影视| 国产在线精品一区二区三区不卡| 欧美狂野另类xxxxoooo| 亚洲一区在线视频| 91免费看片在线观看| 欧美激情一区二区| 国产精品2024| 2021中文字幕一区亚洲| 免费精品视频在线| 在线不卡a资源高清| 一个色综合av| 在线视频国内自拍亚洲视频| 国产精品久久久久久久久久免费看| 久久国产成人午夜av影院| 91精品国产综合久久婷婷香蕉| 一区二区三区在线观看国产| 色综合网色综合| 亚洲视频在线一区| 91丨国产丨九色丨pron| 国产精品美女视频| av中文字幕亚洲| 天天综合天天做天天综合| 日韩精品五月天| 91精品婷婷国产综合久久竹菊| 亚洲一区在线观看免费| 91国产免费看| 亚洲小少妇裸体bbw| 91福利资源站| 午夜久久久影院| 91麻豆精品国产自产在线观看一区| 偷拍一区二区三区四区| 3d动漫精品啪啪1区2区免费| 日韩激情视频网站| 日韩一卡二卡三卡国产欧美| 麻豆国产精品视频| 2020国产成人综合网| 高清免费成人av| 国产精品对白交换视频| 91成人在线观看喷潮| 天堂va蜜桃一区二区三区漫画版| 欧美一区二区三区在线观看 | 美女视频一区二区三区| 欧美大度的电影原声| 日韩av不卡在线观看| 欧美mv日韩mv亚洲| 精品中文字幕一区二区| 国产成人av电影| 日韩精品专区在线影院重磅| 色素色在线综合| 国产成人综合亚洲网站| 国产一区二区在线看| 另类小说视频一区二区| 免费欧美在线视频| 免费人成黄页网站在线一区二区| 麻豆国产欧美日韩综合精品二区| 舔着乳尖日韩一区| 香蕉成人伊视频在线观看| 国产丝袜在线精品| 国产专区欧美精品| 蜜臀av性久久久久蜜臀av麻豆| 《视频一区视频二区| 中文字幕在线观看一区| 欧美激情在线免费观看| 国产精品福利一区二区| 亚洲h在线观看| 国产精品一区久久久久| 欧美日韩第一区日日骚| 日韩午夜激情电影| 亚洲线精品一区二区三区| 日韩精品一区二区三区四区| 成人午夜av在线| 日韩电影在线一区二区三区| 欧美激情一区二区三区蜜桃视频| 欧美性猛片aaaaaaa做受| 国产一区二区三区在线观看免费视频 | 91精品国产综合久久久蜜臀粉嫩| 国产精品一卡二卡在线观看| 亚洲精品午夜久久久| 日韩亚洲欧美在线| 一本大道久久a久久精二百| 久久99久久精品| 夜夜揉揉日日人人青青一国产精品| 精品国产1区2区3区| 欧美日韩一区国产| av网站免费线看精品| 久久精品理论片| 亚洲福利视频导航| 国产精品免费久久久久| 精品1区2区在线观看| 在线观看国产91| 成人午夜电影久久影院| 久久成人久久爱| 一二三四区精品视频| 91丨九色porny丨蝌蚪| 国产精品香蕉一区二区三区| 日韩中文欧美在线| 亚洲精品第1页| 国产精品麻豆视频| 2023国产精华国产精品| 日韩一区二区三区电影在线观看| 色婷婷激情一区二区三区| 国产iv一区二区三区| 老司机精品视频一区二区三区| 亚洲一级二级三级在线免费观看| 国产欧美一区二区精品秋霞影院| 日韩欧美一区中文| 欧美日韩不卡在线| 在线亚洲欧美专区二区| 99久久er热在这里只有精品66| 国产福利一区二区三区在线视频| 蜜臀国产一区二区三区在线播放 | 亚洲国产成人tv| 《视频一区视频二区| 国产精品久久久久久妇女6080| 久久午夜免费电影| 欧美精品一区二区三区在线| 欧美一区二区精品在线| 欧美精选一区二区| 欧美丝袜丝交足nylons|