📄 3.frm
字号:
VERSION 5.00
Begin VB.Form TPH
BackColor = &H8000000A&
Caption = "Form3"
ClientHeight = 2775
ClientLeft = 4065
ClientTop = 4455
ClientWidth = 4050
LinkTopic = "Form3"
ScaleHeight = 2775
ScaleWidth = 4050
Begin VB.CommandButton PLGO
Caption = "下一步"
Height = 375
Left = 1560
TabIndex = 3
Top = 2040
Width = 855
End
Begin VB.CommandButton Command3
Caption = "end"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2640
TabIndex = 2
Top = 2040
Width = 975
End
Begin VB.CommandButton TPSURE
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 1
Top = 2040
Width = 975
End
Begin VB.Label Label1
BackColor = &H8000000E&
BorderStyle = 1 'Fixed Single
Caption = "Label1"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 360
TabIndex = 0
Top = 360
Width = 3255
End
End
Attribute VB_Name = "TPH"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Sub Command3_Click()
End
'TX.MSComm1.PortOpen = False
End Sub
Private Sub Form_Load()
PLGO.Enabled = False
Label1.Caption = " 是否马上进行调平衡?"
TX.MSComm1.PortOpen = True
End Sub
Private Sub PLGO_Click()
TX.MSComm1.PortOpen = False
JBDZ.Visible = True
Unload TPH
End Sub
Private Sub TPSURE_Click()
Dim outData1(1 To 1) As Byte
Dim outData2(1 To 1) As Byte
Dim inData() As Byte
Dim dstart%, T2 As Long
outData1(1) = 150
outData2(1) = 189
TX.MSComm1.Output = outData1
Label1.Caption = " 正在测试鉴别代码..."
Do
DoEvents
Loop Until TX.MSComm1.InBufferCount >= 1
inData = TX.MSComm1.Input
dstart = LBound(inData)
If inData(dstart) = 151 Then
Label1.Caption = "代码鉴别通过."
Label1.Caption = "正在调平衡,请稍侯..."
Else
Label1.Caption = "代码鉴别未通过"
End If
T2 = GetTickCount
Do
DoEvents
Loop Until TX.MSComm1.InBufferCount >= 1 Or GetTickCount - T2 >= 30000
If TX.MSComm1.InBufferCount >= 1 Then
inData = TX.MSComm1.Input
dstart = LBound(inData)
If inData(dstart) = 154 Then
TX.MSComm1.Output = outData2
Label1.Caption = "调平衡已完成"
PLGO.Enabled = True
Else
Label1.Caption = "调平衡已完成!但返回码不对"
End If
Else
Label1.Caption = "调平衡无法完成!"
End If
TPSURE.Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -