?? frmopcserverproperties.frm
字號:
VERSION 5.00
Begin VB.Form frmOPCServerProperties
Caption = "OPC Server Properties"
ClientHeight = 4095
ClientLeft = 60
ClientTop = 345
ClientWidth = 5655
ControlBox = 0 'False
LinkTopic = "Form1"
ScaleHeight = 4095
ScaleWidth = 5655
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.TextBox BuildNumber
Height = 285
Left = 1560
Locked = -1 'True
TabIndex = 18
Text = "Text1"
Top = 3120
Width = 3615
End
Begin VB.TextBox MinorVersion
Height = 285
Left = 1560
Locked = -1 'True
TabIndex = 17
Text = "Text1"
Top = 2760
Width = 3615
End
Begin VB.TextBox MajorVersion
Height = 285
Left = 1560
Locked = -1 'True
TabIndex = 16
Text = "Text1"
Top = 2400
Width = 3615
End
Begin VB.TextBox ServerState
Height = 285
Left = 1560
Locked = -1 'True
TabIndex = 15
Text = "Text1"
Top = 2040
Width = 3615
End
Begin VB.TextBox LastUpdate
Height = 285
Left = 1560
Locked = -1 'True
TabIndex = 14
Text = "Text1"
Top = 1680
Width = 3615
End
Begin VB.TextBox CurrentTime
Height = 285
Left = 1560
Locked = -1 'True
TabIndex = 13
Text = "Text1"
Top = 1320
Width = 3615
End
Begin VB.TextBox StartTime
Height = 285
Left = 1560
Locked = -1 'True
TabIndex = 12
Text = "Text1"
Top = 960
Width = 3615
End
Begin VB.TextBox Vendor
Height = 285
Left = 1560
Locked = -1 'True
TabIndex = 11
Text = "Text1"
Top = 600
Width = 3615
End
Begin VB.CommandButton OkButton
Caption = "Ok"
Height = 375
Left = 2040
TabIndex = 10
Top = 3600
Width = 2295
End
Begin VB.TextBox ProgID
Height = 285
Left = 1560
Locked = -1 'True
TabIndex = 1
Text = "Text1"
Top = 240
Width = 3615
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "Build Number:"
Height = 180
Left = 240
TabIndex = 9
Top = 3180
Width = 1170
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "Minor Version:"
Height = 180
Left = 150
TabIndex = 8
Top = 2820
Width = 1260
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "Major Version:"
Height = 180
Left = 150
TabIndex = 7
Top = 2460
Width = 1260
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "Server State:"
Height = 180
Left = 240
TabIndex = 6
Top = 2100
Width = 1170
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "Last Update Time:"
Height = 180
Left = -120
TabIndex = 5
Top = 1740
Width = 1530
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "Current Time:"
Height = 180
Left = 240
TabIndex = 4
Top = 1380
Width = 1170
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "Start Time:"
Height = 180
Left = 420
TabIndex = 3
Top = 1020
Width = 990
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "Vendor:"
Height = 180
Left = 780
TabIndex = 2
Top = 660
Width = 630
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Prog ID:"
Height = 180
Left = 690
TabIndex = 0
Top = 300
Width = 720
End
End
Attribute VB_Name = "frmOPCServerProperties"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Private Sub Form_Load()
Dim VarString As String
Dim VarTime As Date
Dim VarInt As Integer
Dim VarLong As Long
If Not Module1.SelectedOPCServer Is Nothing Then
If (Module1.SelectedOPCServer.GetServerName(VarString) = True) Then
ProgID.Text = VarString
Else
ProgID.Text = "No ID"
End If
If (Module1.SelectedOPCServer.GetVendorInfo(VarString) = True) Then
Vendor.Text = VarString
Else
Vendor.Text = "No Vendor"
End If
If (Module1.SelectedOPCServer.GetStartTime(VarTime) = True) Then
StartTime.Text = VarTime
Else
StartTime.Text = ""
End If
If (Module1.SelectedOPCServer.GetCurrentTime(VarTime) = True) Then
CurrentTime.Text = VarTime
Else
CurrentTime.Text = ""
End If
If (Module1.SelectedOPCServer.GetLastUpdateTime(VarTime) = True) Then
LastUpdate.Text = VarTime
Else
LastUpdate.Text = ""
End If
' The Server State returns the operating condition
' of the OPC Server. There are currently 6 states
' an OPC server can be in.
' OPC_STATUS_RUNNING = 1 (Server running normally)
' OPC_STATUS_FAILED = 2 (Vendor specific failure has
' occured, all intefaces should
' return E_FAIL.)
' OPC_STATUS_NOCONFIG =3 (Server running but no
' configuration info available)
' OPC_STATUS_SUSPENDED=4 (Server is suspended and is not
' reading or writing data, data
' will returned as Out of Service)
' OPC_STATUS_TEST = 5 (Server in test mode, outputs
' disabled)
' OPC_STATUS_DISCONNECTED = 6 (Server has disconnected)
If (Module1.SelectedOPCServer.GetServerState(VarLong) = True) Then
Select Case VarLong
Case 1
ServerState.Text = "Server Running"
Case 2
ServerState.Text = "Server Failed"
Case 3
ServerState.Text = "Server No Configuraition"
Case 4
ServerState.Text = "Server Suspended"
Case 5
ServerState.Text = "Server Test Mode"
Case 6
ServerState.Text = "Server Disconnected"
End Select
Else
ServerState.Text = ""
End If
If (Module1.SelectedOPCServer.GetMajorVersion(VarInt) = True) Then
MajorVersion.Text = VarInt
Else
MajorVersion.Text = ""
End If
If (Module1.SelectedOPCServer.GetMinorVersion(VarInt) = True) Then
MinorVersion.Text = VarInt
Else
MinorVersion.Text = ""
End If
If (Module1.SelectedOPCServer.GetBuildNumber(VarInt) = True) Then
BuildNumber.Text = VarInt
Else
BuildNumber.Text = ""
End If
End If
End Sub
'
Private Sub OkButton_Click()
fMainForm.tvTreeView.Enabled = True
Unload Me
End Sub
Private Sub Form_Deactivate()
frmOPCServerProperties.Show
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -