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

📄 form1.frm

📁 学习开发opcclient的好例子
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      Width           =   1455
   End
   Begin VB.TextBox Value 
      Height          =   288
      Index           =   9
      Left            =   6240
      Locked          =   -1  'True
      TabIndex        =   16
      Top             =   9120
      Width           =   2415
   End
   Begin VB.TextBox Value 
      Height          =   288
      Index           =   8
      Left            =   6240
      Locked          =   -1  'True
      TabIndex        =   15
      Top             =   8640
      Width           =   2415
   End
   Begin VB.TextBox Value 
      Height          =   288
      Index           =   7
      Left            =   6240
      Locked          =   -1  'True
      TabIndex        =   14
      Top             =   8160
      Width           =   2415
   End
   Begin VB.TextBox Value 
      Height          =   288
      Index           =   6
      Left            =   6240
      Locked          =   -1  'True
      TabIndex        =   13
      Top             =   7680
      Width           =   2415
   End
   Begin VB.TextBox Value 
      Height          =   288
      Index           =   5
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   12
      Top             =   9600
      Width           =   2415
   End
   Begin VB.TextBox Value 
      Height          =   288
      Index           =   4
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   11
      Top             =   9120
      Width           =   2415
   End
   Begin VB.CommandButton Command4 
      Caption         =   "Write value-1"
      Enabled         =   0   'False
      Height          =   375
      Left            =   10800
      TabIndex        =   10
      Top             =   2280
      Width           =   1455
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Sync Read"
      Enabled         =   0   'False
      Height          =   495
      Left            =   8880
      TabIndex        =   9
      Top             =   1440
      Width           =   1455
   End
   Begin VB.TextBox Value 
      Height          =   288
      Index           =   1
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   8
      Top             =   7680
      Width           =   2415
   End
   Begin VB.TextBox Value 
      Height          =   288
      Index           =   2
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   7
      Top             =   8160
      Width           =   2415
   End
   Begin VB.TextBox Value 
      Height          =   288
      Index           =   3
      Left            =   1920
      Locked          =   -1  'True
      TabIndex        =   6
      Top             =   8640
      Width           =   2415
   End
   Begin VB.TextBox ItemID 
      Height          =   288
      Index           =   2
      Left            =   7200
      TabIndex        =   4
      Text            =   "Device1.Group.TAG2"
      Top             =   3120
      Width           =   1815
   End
   Begin VB.TextBox ItemID 
      Height          =   288
      Index           =   1
      Left            =   7200
      TabIndex        =   3
      Text            =   "Device1.Group.TAG1"
      Top             =   2400
      Width           =   1815
   End
   Begin VB.TextBox ItemID 
      Height          =   288
      Index           =   3
      Left            =   7200
      TabIndex        =   2
      Text            =   "Device1.Group.TAG3"
      Top             =   3600
      Width           =   1815
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Disconnect"
      Enabled         =   0   'False
      Height          =   495
      Left            =   9960
      TabIndex        =   1
      Top             =   840
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Connect"
      Height          =   495
      Left            =   8880
      TabIndex        =   0
      Top             =   240
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Caption         =   "STEP"
      Height          =   2415
      Left            =   7680
      TabIndex        =   84
      Top             =   5160
      Width           =   3495
      Begin VB.CommandButton Command23 
         Caption         =   "Get 10 Data From PLC"
         Enabled         =   0   'False
         Height          =   375
         Left            =   1080
         TabIndex        =   90
         Top             =   1800
         Width           =   2295
      End
      Begin VB.CommandButton Command22 
         Caption         =   "Write Command To PLC"
         Enabled         =   0   'False
         Height          =   375
         Left            =   1080
         TabIndex        =   89
         Top             =   1320
         Width           =   2295
      End
      Begin VB.CommandButton Command21 
         Caption         =   "Write Info. To PLC"
         Enabled         =   0   'False
         Height          =   375
         Left            =   1080
         TabIndex        =   88
         Top             =   840
         Width           =   2295
      End
      Begin VB.Label Label12 
         Caption         =   "STEP4"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   255
         Left            =   120
         TabIndex        =   91
         Top             =   1800
         Width           =   855
      End
      Begin VB.Label Label8 
         Caption         =   "STEP3"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   255
         Left            =   120
         TabIndex        =   87
         Top             =   1320
         Width           =   855
      End
      Begin VB.Label Label7 
         Caption         =   "STEP2"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   255
         Left            =   120
         TabIndex        =   86
         Top             =   840
         Width           =   855
      End
      Begin VB.Label Label4 
         Caption         =   "STEP1"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   85
         Top             =   360
         Width           =   735
      End
   End
   Begin VB.Label Label13 
      Caption         =   "FOR TEST"
      Height          =   495
      Left            =   11280
      TabIndex        =   94
      Top             =   8760
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "DATA02"
      Height          =   255
      Index           =   1
      Left            =   840
      TabIndex        =   64
      Top             =   8160
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "Read Data From PLC"
      Height          =   255
      Left            =   1920
      TabIndex        =   73
      Top             =   7320
      Width           =   2295
   End
   Begin VB.Label Label1 
      Caption         =   "DATA10"
      Height          =   255
      Index           =   9
      Left            =   5040
      TabIndex        =   72
      Top             =   9600
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "DATA09"
      Height          =   255
      Index           =   8
      Left            =   5040
      TabIndex        =   71
      Top             =   9120
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "DATA08"
      Height          =   255
      Index           =   7
      Left            =   5040
      TabIndex        =   70
      Top             =   8640
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "DATA07"
      Height          =   255
      Index           =   6
      Left            =   5040
      TabIndex        =   69
      Top             =   8160
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "DATA06"
      Height          =   255
      Index           =   5
      Left            =   5040
      TabIndex        =   68
      Top             =   7680
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "DATA01"
      Height          =   255
      Index           =   0
      Left            =   840
      TabIndex        =   63
      Top             =   7680
      Width           =   855
   End
   Begin VB.Label Label11 
      Caption         =   "IP Address for Remote Server"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2760
      TabIndex        =   29
      Top             =   1440
      Width           =   2535
   End
   Begin VB.Label Label10 
      Caption         =   "Null String for Local Server"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   28
      Top             =   1440
      Width           =   2295
   End
   Begin VB.Label Label9 
      Alignment       =   2  'Center
      BackColor       =   &H8000000D&
      Caption         =   "OPC Client Demo Program"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   2760
      TabIndex        =   23
      Top             =   120
      Width           =   4935
   End
   Begin VB.Label Label6 
      Caption         =   "Write Value"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3120
      TabIndex        =   22
      Top             =   1920
      Width           =   1335
   End
   Begin VB.Label Label5 
      Alignment       =   1  'Right Justify
      Caption         =   "OPC Server Name"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   20
      Top             =   480
      Width           =   1455
   End
   Begin VB.Label Label3 
      Caption         =   "TAG Item Full Name"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   1080
      TabIndex        =   5
      Top             =   1920
      Width           =   1935
   End
   Begin VB.Label Label1 
      Caption         =   "DATA05"
      Height          =   255
      Index           =   4
      Left            =   840
      TabIndex        =   67
      Top             =   9600
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "DATA04"
      Height          =   255
      Index           =   3
      Left            =   840
      TabIndex        =   66
      Top             =   9120
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "DATA03"
      Height          =   255
      Index           =   2
      Left            =   840
      TabIndex        =   65
      Top             =   8640
      Width           =   855
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Option Base 1

'定義 OPC Interface 物件
Dim IconServer As OPCServer ' OPC server object
Dim RemoteServer As OPCServer ' OPC server object
Dim IconGroups As OPCGroups ' collection of groups
Private WithEvents IconGroup As OPCGroup ' individual  group
Attribute IconGroup.VB_VarHelpID = -1
Dim IconItems As OPCItems 'collection of items
Dim OneItem_A   As OPCItem 'Single item
Dim OneItem_B   As OPCItem 'Single item
Dim OneItem_C   As OPCItem 'Single item

⌨️ 快捷键说明

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