?? form1.frm
字號:
VERSION 5.00
Begin VB.Form fmMain
Caption = "OPC Application Demo"
ClientHeight = 6435
ClientLeft = 60
ClientTop = 345
ClientWidth = 8100
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 6435
ScaleWidth = 8100
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "同步"
Height = 495
Left = 2280
TabIndex = 29
Top = 5760
Width = 1155
End
Begin VB.CommandButton command1
Caption = "異步"
Height = 495
Left = 840
TabIndex = 28
Top = 5760
Width = 1095
End
Begin VB.CheckBox DataChgChk
Caption = "使用訂閱數據采取"
Height = 255
Left = 4800
TabIndex = 27
Top = 240
Width = 2175
End
Begin VB.TextBox txbBar
Alignment = 1 'Right Justify
Height = 375
Index = 8
Left = 6960
TabIndex = 26
Text = "0"
Top = 5040
Width = 855
End
Begin VB.TextBox txbBar
Alignment = 1 'Right Justify
Height = 375
Index = 7
Left = 6000
TabIndex = 25
Text = "0"
Top = 5040
Width = 855
End
Begin VB.TextBox txbBar
Alignment = 1 'Right Justify
Height = 375
Index = 6
Left = 5040
TabIndex = 24
Text = "0"
Top = 5040
Width = 855
End
Begin VB.TextBox txbBar
Alignment = 1 'Right Justify
Height = 375
Index = 5
Left = 4080
TabIndex = 23
Text = "0"
Top = 5040
Width = 855
End
Begin VB.TextBox txbBar
Alignment = 1 'Right Justify
Height = 375
Index = 4
Left = 3120
TabIndex = 22
Text = "0"
Top = 5040
Width = 855
End
Begin VB.TextBox txbBar
Alignment = 1 'Right Justify
Height = 375
Index = 3
Left = 2160
TabIndex = 21
Text = "0"
Top = 5040
Width = 855
End
Begin VB.TextBox txbBar
Alignment = 1 'Right Justify
Height = 375
Index = 2
Left = 1200
TabIndex = 14
Text = "0"
Top = 5040
Width = 855
End
Begin VB.PictureBox picBar
Height = 3135
Index = 8
Left = 6960
ScaleHeight = 205
ScaleMode = 3 'Pixel
ScaleWidth = 53
TabIndex = 12
Top = 1320
Width = 855
End
Begin VB.PictureBox picBar
Height = 3135
Index = 7
Left = 6000
ScaleHeight = 205
ScaleMode = 3 'Pixel
ScaleWidth = 53
TabIndex = 11
Top = 1320
Width = 855
End
Begin VB.PictureBox picBar
Height = 3135
Index = 6
Left = 5040
ScaleHeight = 205
ScaleMode = 3 'Pixel
ScaleWidth = 53
TabIndex = 10
Top = 1320
Width = 855
End
Begin VB.PictureBox picBar
Height = 3135
Index = 5
Left = 4080
ScaleHeight = 205
ScaleMode = 3 'Pixel
ScaleWidth = 53
TabIndex = 9
Top = 1320
Width = 855
End
Begin VB.PictureBox picBar
Height = 3135
Index = 4
Left = 3120
ScaleHeight = 205
ScaleMode = 3 'Pixel
ScaleWidth = 53
TabIndex = 8
Top = 1320
Width = 855
End
Begin VB.PictureBox picBar
Height = 3135
Index = 3
Left = 2160
ScaleHeight = 205
ScaleMode = 3 'Pixel
ScaleWidth = 53
TabIndex = 7
Top = 1320
Width = 855
End
Begin VB.PictureBox picBar
Height = 3135
Index = 2
Left = 1200
ScaleHeight = 205
ScaleMode = 3 'Pixel
ScaleWidth = 53
TabIndex = 6
Top = 1320
Width = 855
End
Begin VB.PictureBox picBar
Height = 3135
Index = 1
Left = 240
ScaleHeight = 205
ScaleMode = 3 'Pixel
ScaleWidth = 53
TabIndex = 5
Top = 1320
Width = 855
End
Begin VB.TextBox txbBar
Alignment = 1 'Right Justify
Height = 375
Index = 1
Left = 240
TabIndex = 3
Text = "0"
Top = 5040
Width = 855
End
Begin VB.Timer tmUpdate
Enabled = 0 'False
Left = 0
Top = 5640
End
Begin VB.CommandButton btnAddItem
Caption = "加項"
Height = 615
Left = 2280
TabIndex = 2
Top = 240
Width = 1695
End
Begin VB.CommandButton btnQuit
Caption = "退出"
Height = 495
Left = 6000
TabIndex = 1
Top = 5760
Width = 1815
End
Begin VB.CommandButton btnConnect
Caption = "連接"
Height = 615
Left = 240
TabIndex = 0
Top = 240
Width = 1695
End
Begin VB.Label lbBar
Alignment = 1 'Right Justify
Caption = "####.###"
Height = 375
Index = 8
Left = 6960
TabIndex = 20
Top = 4560
Width = 855
End
Begin VB.Label lbBar
Alignment = 1 'Right Justify
Caption = "####.###"
Height = 375
Index = 7
Left = 6000
TabIndex = 19
Top = 4560
Width = 855
End
Begin VB.Label lbBar
Alignment = 1 'Right Justify
Caption = "####.###"
Height = 375
Index = 6
Left = 5040
TabIndex = 18
Top = 4560
Width = 855
End
Begin VB.Label lbBar
Alignment = 1 'Right Justify
Caption = "####.###"
Height = 375
Index = 5
Left = 4080
TabIndex = 17
Top = 4560
Width = 855
End
Begin VB.Label lbBar
Alignment = 1 'Right Justify
Caption = "####.###"
Height = 375
Index = 4
Left = 3120
TabIndex = 16
Top = 4560
Width = 855
End
Begin VB.Label lbBar
Alignment = 1 'Right Justify
Caption = "####.###"
Height = 375
Index = 3
Left = 2160
TabIndex = 15
Top = 4560
Width = 855
End
Begin VB.Label lbBar
Alignment = 1 'Right Justify
Caption = "####.###"
Height = 375
Index = 2
Left = 1200
TabIndex = 13
Top = 4560
Width = 855
End
Begin VB.Label lbBar
Alignment = 1 'Right Justify
Caption = "####.###"
Height = 375
Index = 1
Left = 240
TabIndex = 4
Top = 4560
Width = 855
End
End
Attribute VB_Name = "fmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Base 1
Option Explicit
' OPC對象的聲明
Dim WithEvents objServer As OPCServer
Attribute objServer.VB_VarHelpID = -1
Dim objGroups As OPCGroups
Dim WithEvents objTestGrp As OPCGroup '事件的對應
Attribute objTestGrp.VB_VarHelpID = -1
Dim objItems As OPCItems
Dim lServerHandles() As Long
Dim lTransID_Rd As Long
Dim lCancelID_Rd As Long
Dim lTransID_Wt As Long
Dim lCancelID_Wt As Long
Dim Values() As Variant
Dim Qualities As Variant
Dim TimeStamps As Variant
Sub Connect(strProgID As String, Optional strNode As String)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -