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

📄 frmadditem.frm

📁 opc 通讯 册测试通讯OPC使用 客户端/服务端
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "comctl32.ocx"
Begin VB.Form frmAddItem 
   Caption         =   "增加数据项"
   ClientHeight    =   6690
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8520
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   6690
   ScaleWidth      =   8520
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.Frame Browsing 
      Caption         =   "数据项浏览"
      Height          =   4635
      Left            =   0
      TabIndex        =   9
      Top             =   1950
      Width           =   8415
      Begin VB.ComboBox AccessFilter 
         Height          =   300
         ItemData        =   "frmAddItem.frx":0000
         Left            =   7050
         List            =   "frmAddItem.frx":0010
         TabIndex        =   17
         Text            =   "Any"
         ToolTipText     =   "Select an access type to filter the list of items displayed"
         Top             =   510
         Width           =   1215
      End
      Begin ComctlLib.ListView lvItemView 
         Height          =   3615
         Left            =   3960
         TabIndex        =   13
         ToolTipText     =   "Select an item from this list by double clicking on the item"
         Top             =   870
         Width           =   4335
         _ExtentX        =   7646
         _ExtentY        =   6376
         View            =   3
         Sorted          =   -1  'True
         LabelWrap       =   -1  'True
         HideSelection   =   -1  'True
         HideColumnHeaders=   -1  'True
         _Version        =   327682
         ForeColor       =   -2147483640
         BackColor       =   -2147483643
         BorderStyle     =   1
         Appearance      =   1
         NumItems        =   0
      End
      Begin VB.ComboBox DataTypeFilter 
         Height          =   300
         ItemData        =   "frmAddItem.frx":003C
         Left            =   5490
         List            =   "frmAddItem.frx":006F
         TabIndex        =   12
         Text            =   "Native"
         ToolTipText     =   "Select a datatype to filter the list of items displayed"
         Top             =   510
         Width           =   1305
      End
      Begin VB.TextBox ItemNameFilter 
         Height          =   285
         Left            =   3960
         TabIndex        =   11
         Text            =   "*"
         ToolTipText     =   "Enter a filter expression to reduce the number of item displayed Ex. Temp* , N* ,  *"
         Top             =   510
         Width           =   1335
      End
      Begin ComctlLib.TreeView tvBranchView 
         Height          =   4275
         Left            =   120
         TabIndex        =   10
         ToolTipText     =   "Expand the branches of the browser tree to access individual item names"
         Top             =   240
         Width           =   3735
         _ExtentX        =   6588
         _ExtentY        =   7541
         _Version        =   327682
         HideSelection   =   0   'False
         LabelEdit       =   1
         LineStyle       =   1
         Style           =   7
         Appearance      =   1
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "访问过滤"
         Height          =   180
         Left            =   7290
         TabIndex        =   16
         Top             =   240
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "类型过滤"
         Height          =   180
         Left            =   5790
         TabIndex        =   15
         Top             =   240
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "名称过滤"
         Height          =   180
         Left            =   4267
         TabIndex        =   14
         Top             =   240
         Width           =   720
      End
   End
   Begin VB.CommandButton Abort 
      Caption         =   "完成"
      Height          =   375
      Left            =   6990
      TabIndex        =   4
      ToolTipText     =   "Click here when you have finished adding tags"
      Top             =   720
      Width           =   1455
   End
   Begin VB.CommandButton AddItem 
      Caption         =   "增加数据项"
      Height          =   375
      Left            =   6960
      TabIndex        =   3
      ToolTipText     =   "Click here to add a tag to the current group"
      Top             =   210
      Width           =   1455
   End
   Begin VB.CommandButton Validate 
      Caption         =   "验证"
      Height          =   375
      Left            =   2970
      TabIndex        =   2
      ToolTipText     =   "Once you have entered an ItemID and Datatype click here to test the entry"
      Top             =   810
      Width           =   1575
   End
   Begin VB.ComboBox DataType 
      Height          =   300
      ItemData        =   "frmAddItem.frx":00D4
      Left            =   1140
      List            =   "frmAddItem.frx":0107
      TabIndex        =   1
      Text            =   "Native"
      ToolTipText     =   "Select the datatype that will be applied to this item"
      Top             =   870
      Width           =   1575
   End
   Begin VB.TextBox ItemID 
      Height          =   285
      Left            =   1140
      TabIndex        =   0
      ToolTipText     =   "Enter a valid Item ID String for the server you are using, this default item is for KEPServerEX"
      Top             =   390
      Width           =   5505
   End
   Begin VB.Frame Frame1 
      Caption         =   "数据项定义"
      Height          =   1725
      Left            =   0
      TabIndex        =   5
      Top             =   120
      Width           =   6855
      Begin VB.CheckBox ActiveState 
         Alignment       =   1  'Right Justify
         Caption         =   "Active State:"
         Height          =   375
         Left            =   150
         TabIndex        =   18
         ToolTipText     =   "Set the initial Active state of the item to be added"
         Top             =   1200
         Value           =   1  'Checked
         Width           =   1215
      End
      Begin VB.TextBox Report 
         Height          =   285
         Left            =   2670
         Locked          =   -1  'True
         TabIndex        =   8
         ToolTipText     =   "This box will report the results of the Validate Item button"
         Top             =   1230
         Width           =   4065
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "报告:"
         Height          =   180
         Left            =   2070
         TabIndex        =   19
         Top             =   1290
         Width           =   540
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "Item ID:"
         Height          =   180
         Left            =   150
         TabIndex        =   7
         Top             =   300
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "Data Type:"
         Height          =   180
         Left            =   150
         TabIndex        =   6
         Top             =   750
         Width           =   900
      End
   End
End
Attribute VB_Name = "frmAddItem"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Dim OPCBrowserClassObj As OPCBrowserClass
Dim DummyNodeNum As Integer
Dim ServerKey As String

Private Sub Form_Load()

    Dim ServerName As String
    Module1.SelectedOPCServer.GetServerBrowseObject OPCBrowserClassObj
    Module1.SelectedOPCServer.GetServerName ServerName
    ServerKey = Module1.SelectedOPCServer.GetOPCServerKey
    DummyNodeNum = 1
    lvItemView.ColumnHeaders.Add , , "ItemID", lvItemView.Width
    lvItemView.View = lvwReport ' Place list view text report mode
    If Not OPCBrowserClassObj Is Nothing Then
        Dim nodX As Node    ' Declare Node variable.
        Set nodX = tvBranchView.Nodes.Add(, , ServerKey, ServerName)
        nodX.EnsureVisible
        
        Dim Organization As Long
        OPCBrowserClassObj.GetBrowserOrganization Organization
        If Organization = 2 Then
            OPCBrowserClassObj.ShowLeafs False
            Dim I As Integer
            For I = 1 To OPCBrowserClassObj.GetItemCount
                Dim ItemName As String
                OPCBrowserClassObj.GetItemName ItemName, I
                lvItemView.ListItems.Add I, I, ItemName
            Next I
        Else
            tvBranchView.Nodes.Add ServerKey, tvwChild, "KEPwareDummyNode" + Str(DummyNodeNum), ""
        End If
    End If

    DummyNodeNum = DummyNodeNum + 1
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set OPCBrowserClassObj = Nothing
End Sub
'
Private Sub AddItem_Click()
    

⌨️ 快捷键说明

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