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

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

?? opcserverclass.cls

?? vb開發的一個opcclient源代碼
?? CLS
?? 第 1 頁 / 共 3 頁
字號:
    Rate = ServerGroups.DefaultGroupUpdateRate
    GetDefaultGroupUpdateRate = True
    GoTo SkipOPCGetDefaultUpdateRateError
    
ShowOPCGetDefaultUpdateRateError:
    Call DisplayOPC_COM_ErrorValue("GetDefaultGroupUpdateRate", Err.Number)
    GetDefaultGroupUpdateRate = False
    
SkipOPCGetDefaultUpdateRateError:
End Function


' The name say it all, gets the default DeadBand from the
' ServerGroups collection object.
'
Function GetDefaultGroupDeadBand(ByRef DeadBand As Single)
    'Set error handling for OPC Function
    On Error GoTo ShowOPCGetDefaultGroupDeadBandError
    
    DeadBand = ServerGroups.DefaultGroupDeadband
    GetDefaultGroupDeadBand = True
    GoTo SkipOPCGetDefaultGroupDeadBandError
    
ShowOPCGetDefaultGroupDeadBandError:
    Call DisplayOPC_COM_ErrorValue("GetDefaultGroupDeadBand", Err.Number)
    GetDefaultGroupDeadBand = False
    
SkipOPCGetDefaultGroupDeadBandError:
End Function


' This sub handles adding the group to the OPC server and
' establishing the group interface.  When adding a group you
' can preset some of the group parameters using the properties
' '.DefaultGroupIsActive' and '.DefaultGroupDeadband'.  Set these
' before adding the group. Once the group has been successfully
' added you can change these same settings along with the group
' update rate on the fly using the properties on the resulting
' OPCGroupClass object.
' The GroupName parameter is the name your would like to use for
' the new group to be added.  This paramter can be left blank.
' When you leave the group name blank you are telling the OPC server
' that is should generate a group name for us.  See the SetDefault
' functions above for details on the UpdateRate, DeadBand, and active
' state of the group.
'
' The GroupKey is string that will be returned to the VB application.
' This string can be used as a key for this group in a collection.
'
Function AddOPCGroup(GroupName As String, UpdateRate As Long, DeadBand As Single, ActiveState As Boolean, ByRef GroupKey As String)
    'Set error handling for OPC Function
    On Error GoTo ShowOPCGroupAddError
    
    ' Create an new instance of the OPCGroupClass
    Dim ConnectedGroup As New OPCGroupClass
    Dim NewGroup As OPCGroup
    Dim GroupNum As Integer
              
    ' Establish the initial default conditions for new groups added to this
    ' server.
    SetDefaultGroupIsActive (ActiveState)
    SetDefaultGroupUpdateRate (UpdateRate)
    SetDefaultGroupDeadBand (DeadBand)

    ' Normally you can name an OPC group yourself but
    ' you also have the option of allowing the OPC Server
    ' to provide you with a unique group name automatically.
    ' To do this simply leave the GroupName empty.
    ' This blank group name is then passed to the OPC
    ' server which will recognize this as a automatic
    ' group name.  The server will return the name it
    ' generates as part of the Automation Interface's
    ' OPCGroup object.
    
    Set NewGroup = ServerGroups.Add(GroupName)
    
    
    ' If the GroupName was passed in as blank then get the group
    ' name that the OPC Server has automatically generated.
    If GroupName = "" Then
        GroupName = NewGroup.Name
    End If
    
    ' The FindNextGroupNumber handles getting a unique group number
    ' if you continue to add groups to your OPCServerClass object
    ' this function simply returns the next group number.  If you
    ' delete a group that was previously added this function will
    ' attempt to find the deleted group numbers and use them first.
    ' This prevents the group index numbers from just continuing to
    ' increment.
    GroupNum = FindNextGroupNumber
    
    ' Once the next group number is found a unique group key is
    ' developed.  This key can be used in your application to manage
    ' access to this group.  One example might be to use the GroupKey
    ' returned here as a key within a TreeView of ListView control.
    ' As you can see here the group key is comprise of the group
    ' index specifically for this group and on the server index.
    ' By combining these two index numbers in one key we can be
    ' resonably sure that the group key will be unique across
    ' multiple OPC server groups.
    GroupKey = "Group" + Str(GroupNum) + Str(OPCServerIndex)
    
    ' On the outside chance the OPC server didn't generated a group name
    ' we can create one from the Groupkey.
    If GroupName = "" Then
        GroupName = GroupKey
    End If
   
    ' This sets the basic properties of the OPCGroupClass object
    ConnectedGroup.SetOPCGroup NewGroup, GroupName, GroupKey, GroupNum
    
    ' Although the OPCGroups (ServerGroups) object is already a
    ' collection we need to have our own OPCGGroupClass object wrapper
    ' to contain the properties and events for each group we intend
    ' to add to the server.  This means that we must keep the
    ' ServerGroups collection and the OPCServerGroups collection
    ' in sync.
    With OPCServerGroups
        .Add ConnectedGroup, GroupKey
    End With
        
    AddOPCGroup = True
    GoTo SkipAddGroupError

ShowOPCGroupAddError:
    Call DisplayOPC_COM_ErrorValue("Add Group", Err.Number)
    AddOPCGroup = False
    
SkipAddGroupError:
End Function


' This function attempts to keep the Group index number
' from continuosly growing by finding a group number that
' may have been deleted and returning those first before
' going to the next group index number. The end result of
' this function it that the group number will never grow
' beyond actual number of groups.
'
Private Function FindNextGroupNumber()
    ' In this function an error state means that a vacant
    ' group number has been found.
    On Error GoTo FoundNextGroupNumber
    
    Dim i As Integer
    Dim GroupNum As Integer
    
    GroupNum = 1
    
    With OPCServerGroups
        ' This loop tries to access each item in the OPCServerGroups
        ' collection by it's Key.  If an item can not be pulled from the
        ' collection that means the group had been deleted and it's
        ' group number is available.
        For i = 1 To .Count
            GroupNum = i
            .Item ("Group" + Str(i) + Str(OPCServerIndex))
        Next i
        
        ' If we get here all of the group numbers in the collection
        ' exist and a next available group number should be returned.
        If .Count <> 0 Then
            FindNextGroupNumber = i
        Else
            FindNextGroupNumber = 1 ' No count return the first 1
        End If
    End With
    
    GoTo NewGroup
    
FoundNextGroupNumber:
    ' If we get here a group number could not be found in the
    ' OPCServerGroups collection which means that it has been deleted
    ' and is available for a new group addition.
    FindNextGroupNumber = GroupNum
    
NewGroup:
End Function


' This sub handles removing a group from the OPC server.  The group
' is removed from the ServerGroups object which is the collection
' managed by the Automation Interface.  Then the group is removed from
' the OPCServerGroups collection which is managed by the OPCServerClass
'
Function RemoveOPCGroup(GroupKey As String)
    'Set error handling for OPC Function
    On Error GoTo ShowOPCGroupRemoveError
      
    Dim OPCGroupCls As OPCGroupClass
    Set OPCGroupCls = OPCServerGroups.Item(GroupKey)
    Dim GroupName As String
    GroupName = OPCGroupCls.GetGroupName
      
    ' First the group is removed from the actual group collection managed by
    ' the automation interface if it is successful then remove the tiem from the
    ' OPCServerGroups collection
    ServerGroups.Remove GroupName
    
    ' Now we remove it from the OPCServerGroups collection
    ' to allow any final processing on the group to be done
    OPCServerGroups.Remove GroupKey
        
    RemoveOPCGroup = True
    GoTo SkipRemoveGroupError

ShowOPCGroupRemoveError:
    Call DisplayOPC_COM_ErrorValue("Remove Group", Err.Number)
    RemoveOPCGroup = False
    
SkipRemoveGroupError:
End Function


' 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 the ServerShuttingDown event to be informed when the OPC
' connection is going to be lost.
'
Private Sub OPCServerObj_ServerShutDown(ByVal Reason As String)
    ' If we receive a server shut down message we need to release everthing and remove the server
    ' connection.
    RaiseEvent ServerShuttingDown(OPCServerKey)
End Sub


' Create the new OPCServer object when the OPCServerClass object is
' instantiated.
'
Private Sub Class_Initialize()
    Set OPCServerObj = New OPCServer
End Sub


' When the OPCServerClass object is deleted this function will cleanup
' the OPC connection by releasing the groups and items.  While this function
' will clean up the groups and items that may have been attached to this
' OPCServerClass object you will still need to call DisconnectOPCServer
' in your VB application on this object to properly release the OPC Server
' from the Automation Interface.
'
Private Sub Class_Terminate()
    
    ' Normally you should remove all groups and their items from the server
    ' before you remove the server object.  However the OPCGroups collection
    ' object supports a RemoveAll method that will remove all items from
    ' the groups and all groups from the server.
    If Not ServerGroups Is Nothing Then
        If ServerGroups.Count <> 0 Then
            ServerGroups.RemoveAll
        End If
    End If
    
    ' We still need to remove the OPCServerGroups collection that contains
    ' the OPCGroupClasss objects
    If OPCServerGroups.Count <> 0 Then
        Dim i As Integer
        Dim a As Integer
        a = OPCServerGroups.Count
        For i = 1 To OPCServerGroups.Count
            With OPCServerGroups
            .Remove (a)
            a = a - 1
            End With
        Next i
    End If
    
    ' Release the OPCServerGroups collection
    Set OPCServerGroups = Nothing
    
End Sub


' Handles displaying any OPC/COM/VB errors that are caught by the exception handler
Sub DisplayOPC_COM_ErrorValue(OPC_Function As String, ErrorCode As Long)
    Dim Response
    Dim ErrorDisplay As String
    ErrorDisplay = "The OPC function '" + OPC_Function + "' has returned an error of " + Str(ErrorCode) + " or Hex 0x" + Hex(ErrorCode)
    Response = MsgBox(ErrorDisplay, vbOKOnly, "OPC Function Error")
End Sub

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品日产精品乱码不卡| 最新中文字幕一区二区三区| 在线免费视频一区二区| 成人黄色大片在线观看| 国产精品一级黄| 成人高清av在线| 99精品视频中文字幕| 91美女蜜桃在线| 欧美日韩国产精品自在自线| 欧美疯狂做受xxxx富婆| 日韩无一区二区| 日韩美女一区二区三区四区| 日韩精品在线网站| 久久久精品tv| 最新国产精品久久精品| 亚洲精品国产精华液| 亚洲成人1区2区| 国产一区二区中文字幕| 成人91在线观看| 日本精品视频一区二区三区| 欧美日韩一级大片网址| 欧美xfplay| 亚洲美女区一区| 秋霞影院一区二区| 成人av免费在线观看| 欧美在线不卡视频| 久久综合九色综合欧美亚洲| 国产精品久久久久久久久动漫 | 久久99国产精品久久99| 国产夫妻精品视频| 欧美三日本三级三级在线播放| 日韩视频免费直播| 最近日韩中文字幕| 美腿丝袜亚洲色图| 色婷婷av一区二区三区软件| 欧美一区二区三区免费在线看| 国产喷白浆一区二区三区| 亚洲一二三四久久| 岛国精品在线观看| 欧美日韩精品福利| 亚洲欧美一区二区视频| 美女视频黄频大全不卡视频在线播放| 成人福利视频网站| 日韩欧美一级在线播放| 亚洲精品免费播放| 国产1区2区3区精品美女| 欧美日韩亚洲国产综合| 亚洲国产成人午夜在线一区| 首页欧美精品中文字幕| 日本黄色一区二区| 国产精品美女视频| 国产一区二区三区日韩| 欧美精品粉嫩高潮一区二区| 亚洲精品视频一区| youjizz久久| 久久久久九九视频| 狠狠色丁香久久婷婷综合丁香| 91国偷自产一区二区开放时间 | 综合久久久久综合| 国产另类ts人妖一区二区| 欧美一区二区三区播放老司机| 亚洲欧洲综合另类在线| 菠萝蜜视频在线观看一区| 久久精品一区二区三区av| 免费观看在线综合色| 欧美精品在线观看播放| 亚洲一区二区精品视频| 在线观看视频欧美| 亚洲一区在线观看免费| 99国产精品视频免费观看| 国产偷国产偷亚洲高清人白洁| 欧美96一区二区免费视频| 欧美美女bb生活片| 水野朝阳av一区二区三区| 欧美日韩aaa| 日本不卡视频一二三区| 日韩三级伦理片妻子的秘密按摩| 五月天丁香久久| 欧美美女激情18p| 欧美a级一区二区| 精品成人一区二区三区四区| 国产一二三精品| 国产精品乱码一区二三区小蝌蚪| 成人黄色免费短视频| 亚洲另类一区二区| 欧美猛男男办公室激情| 日本一区中文字幕| 久久免费视频色| 99热在这里有精品免费| 亚洲一区二区三区美女| 日韩丝袜情趣美女图片| 国产乱码一区二区三区| 中文字幕在线一区二区三区| 欧美做爰猛烈大尺度电影无法无天| 一区二区久久久久久| 日韩欧美国产一区在线观看| 国产高清在线观看免费不卡| 亚洲日穴在线视频| 欧美一区二区三区免费观看视频| 国产精品自拍在线| 洋洋成人永久网站入口| 精品美女一区二区| 色综合网色综合| 激情综合网天天干| 亚洲女同女同女同女同女同69| 欧美精品v日韩精品v韩国精品v| 老司机免费视频一区二区三区| 国产精品日日摸夜夜摸av| 欧美午夜电影一区| 国产一区二区不卡老阿姨| 亚洲一区二区三区中文字幕| 欧美成人国产一区二区| a亚洲天堂av| 国产一区二区三区最好精华液| 综合亚洲深深色噜噜狠狠网站| 欧美一区二区三区视频在线| 成人sese在线| 久久精品国产**网站演员| 一区二区在线电影| 久久看人人爽人人| 欧美一区二区三区男人的天堂| 91在线云播放| 国产美女在线精品| 青草国产精品久久久久久| 日韩毛片精品高清免费| 久久久久国产精品麻豆ai换脸| 欧美午夜片在线观看| av成人老司机| 丁香另类激情小说| 国产精品一区一区三区| 秋霞影院一区二区| 亚洲国产wwwccc36天堂| 亚洲视频一区二区在线| 中日韩av电影| 中文在线资源观看网站视频免费不卡 | 蜜乳av一区二区| 亚洲综合区在线| 亚洲天堂av老司机| 国产精品美女久久久久久久网站| 欧美va亚洲va香蕉在线| 欧美精品一二三区| 欧美午夜寂寞影院| 欧美日免费三级在线| 日本高清不卡aⅴ免费网站| 99久久久久久| 99久久综合狠狠综合久久| 丰满白嫩尤物一区二区| 国产在线播放一区| 九色|91porny| 国模娜娜一区二区三区| 国内久久精品视频| 国产精品综合视频| 国产成人av影院| 成人性视频免费网站| 粉嫩av亚洲一区二区图片| 国产精品一区二区免费不卡| 国产精品99久久久久久久vr| 韩国女主播成人在线| 国产大陆亚洲精品国产| 国产激情一区二区三区四区| 国产iv一区二区三区| 波多野结衣在线一区| 91尤物视频在线观看| 色www精品视频在线观看| 欧洲av在线精品| 欧美日韩美女一区二区| 日韩一区二区在线观看| 精品国产1区二区| 国产精品久久一卡二卡| 亚洲激情av在线| 天天av天天翘天天综合网| 蜜桃精品视频在线| 国产成人综合在线| 91国偷自产一区二区三区成为亚洲经典 | 久久99精品久久久| 高潮精品一区videoshd| 91免费国产视频网站| 欧美精品久久久久久久多人混战| 欧美一区二区视频在线观看2022 | 国产一区二区导航在线播放| 不卡av在线网| 欧美剧情片在线观看| 国产午夜精品一区二区三区嫩草 | 国产精品欧美经典| 亚洲v日本v欧美v久久精品| 奇米精品一区二区三区四区| 国产jizzjizz一区二区| 欧美日本在线播放| 欧美国产一区二区在线观看| 亚洲午夜视频在线观看| 国产精品一卡二| 欧美精品在线一区二区| 国产精品美女视频| 毛片一区二区三区| aaa国产一区| xnxx国产精品| 午夜精品在线看| voyeur盗摄精品| 精品国产一二三| 亚洲小说春色综合另类电影|