亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲男人的天堂在线观看| 在线不卡欧美精品一区二区三区| 久久精品久久99精品久久| 亚洲国产欧美在线| 亚洲午夜激情av| 午夜精品在线看| 三级欧美韩日大片在线看| 五月婷婷综合在线| 蜜桃av一区二区三区| 精品亚洲国内自在自线福利| 国产一区二区三区在线看麻豆 | 欧美日本在线观看| 欧美剧情片在线观看| 欧美刺激脚交jootjob| 久久久久久免费网| 国产精品久久久久久久裸模| 亚洲女爱视频在线| 青草国产精品久久久久久| 韩国一区二区三区| 99精品久久只有精品| 欧美日韩一区高清| 精品国一区二区三区| 亚洲欧洲三级电影| 丝袜国产日韩另类美女| 国内精品免费**视频| 色婷婷久久综合| 日韩欧美一区在线观看| 国产精品久久久久久久久搜平片| 亚洲精品伦理在线| 久久99九九99精品| 91麻豆免费看| 欧美一区二区三区在| 国产精品三级在线观看| 午夜精品aaa| av男人天堂一区| 91精品国产全国免费观看| 国产精品视频免费| 青青草97国产精品免费观看 | 欧洲精品一区二区三区在线观看| 制服丝袜亚洲播放| 综合分类小说区另类春色亚洲小说欧美| 亚洲小少妇裸体bbw| 国产精品久久久久三级| 久久久久高清精品| 成人一级黄色片| 青青草成人在线观看| 亚洲国产高清aⅴ视频| 成人av影视在线观看| 欧美一区二区精品| 中文字幕一区二区视频| 久久99精品一区二区三区| 在线免费不卡电影| 国产精品久久久久一区二区三区 | 成人一级视频在线观看| 日韩欧美aaaaaa| 日日夜夜精品视频免费| 91在线视频网址| 国产精品久久网站| 国产成人亚洲精品青草天美| 欧美一区日韩一区| 日韩电影在线免费观看| 欧美私模裸体表演在线观看| 亚洲欧美一区二区三区孕妇| 成人性视频网站| 国产校园另类小说区| 韩日av一区二区| 久久综合色鬼综合色| 麻豆精品视频在线观看视频| 欧美一区二区大片| 午夜成人在线视频| 欧美性感一类影片在线播放| 亚洲一区中文日韩| 欧美写真视频网站| 亚洲18女电影在线观看| 欧美日韩精品一区二区在线播放| 亚洲综合在线五月| 欧美疯狂做受xxxx富婆| 天天色图综合网| 日韩欧美国产一区二区三区| 免费在线看成人av| 精品盗摄一区二区三区| 精品在线观看视频| 国产日韩精品一区二区三区在线| 国产精品1区2区3区在线观看| 久久影院视频免费| 成人免费视频播放| 一区二区成人在线视频| 在线电影一区二区三区| 久久黄色级2电影| 亚洲欧美日韩精品久久久久| eeuss国产一区二区三区| 亚洲日本va午夜在线影院| 欧美四级电影网| 久久99国产精品久久| 国产精品情趣视频| 欧美图区在线视频| 国产一区二区在线视频| 亚洲婷婷综合色高清在线| 欧美精品一卡两卡| 国产精品一区在线| 亚洲精品成人悠悠色影视| 在线不卡免费欧美| 成人免费黄色大片| 亚洲成av人片一区二区| 久久久青草青青国产亚洲免观| 99国产精品久久久久| 日韩国产欧美在线视频| 国产欧美日韩一区二区三区在线观看| 色综合久久久久网| 久久99久久久久久久久久久| 国产精品久久福利| 日韩精品一区二区在线观看| 一本色道**综合亚洲精品蜜桃冫| 日韩不卡免费视频| 伊人性伊人情综合网| 精品久久久久99| 欧美亚男人的天堂| 粉嫩av亚洲一区二区图片| 亚洲成人激情自拍| 国产精品久久久久毛片软件| 日韩精品一区二区三区在线| 91色综合久久久久婷婷| 韩国欧美国产一区| 午夜视频久久久久久| 亚洲欧美偷拍卡通变态| 国产日韩欧美一区二区三区综合| 717成人午夜免费福利电影| 成人免费视频播放| 国产乱妇无码大片在线观看| 午夜视频一区二区三区| 一区二区三区欧美在线观看| 一区二区三区电影在线播| 久久精品视频网| 日韩一区二区三区视频在线| 在线观看日韩av先锋影音电影院| 成人免费黄色在线| 国产精品白丝jk黑袜喷水| 久久激五月天综合精品| 日韩电影在线观看一区| 天天综合色天天综合色h| 亚洲影视在线播放| 亚洲视频一二三区| 中文字幕一区二区三区不卡在线| 久久精品一区二区三区不卡牛牛| 欧美tk丨vk视频| 日韩欧美一区二区在线视频| 91精品啪在线观看国产60岁| 欧美另类z0zxhd电影| 欧美精品123区| 日韩欧美资源站| 欧美成人r级一区二区三区| 7777精品久久久大香线蕉 | 欧美成人官网二区| 精品日韩一区二区三区| 欧美一级黄色录像| 精品国产污网站| 久久亚洲一级片| 国产偷v国产偷v亚洲高清| 欧美国产一区二区| 亚洲欧美自拍偷拍| 一区二区三区日韩欧美| 亚洲第一成年网| 久久精品久久99精品久久| 国产成人免费网站| 波多野结衣中文字幕一区二区三区 | 久久综合九色综合97_久久久| 久久一区二区三区国产精品| 久久精品综合网| 亚洲乱码国产乱码精品精的特点 | 欧美日韩视频一区二区| 91精品国产欧美一区二区| 精品国产乱码久久久久久1区2区 | 国产成人一级电影| 99国产精品久| 51精品国自产在线| www久久精品| 亚洲久草在线视频| 美腿丝袜在线亚洲一区| 国产凹凸在线观看一区二区| 91成人免费在线视频| 日韩欧美亚洲国产另类| 欧美激情中文字幕| 首页国产欧美日韩丝袜| 国产美女精品在线| 欧美在线免费观看视频| 26uuu另类欧美亚洲曰本| 亚洲三级视频在线观看| 三级不卡在线观看| 不卡欧美aaaaa| 欧美一区二区观看视频| 亚洲色图欧美激情| 国产一区二区三区高清播放| 91蜜桃传媒精品久久久一区二区| 日韩三级精品电影久久久 | 精品国产在天天线2019| 亚洲精品美腿丝袜| 国产精品1024| 日韩欧美国产麻豆| 一区二区三区美女| 国产成人av一区二区三区在线观看|