大家帮小弟我看一上这个程序~多谢啦
大家帮我看一下这个程序~~谢谢啦!
高手帮我看一下啊~!!
Option Explicit
'Private Type wdir '主机写命令结构
' wd(0) As Byte
' wd(1) = &H10
' wd(2) As Byte
' wd(3) As Byte
' wd(4) = &H0
' wd(5) = &H2
' wd(6) = &H4
' wd(7) As Byte
' wd(8) As Byte
' wd(9) As Byte
' wd(10) As Byte
' wdcheck As Integer
' End Type
'Private Type wspon '仪表写响应结构
' wds(0) As Byte
' wds(1) As Byte
' wds(2) As Byte
' wds(3) As Byte
' wds(4) As Byte
' wds(5) As Byte
' wdscheck As Integer
' End Type
Private Sub Combo1_Change()
Combo1.List
End Sub
'输入压力温度标定中OptionButton的值(需修改)
Private Sub initOpt()
Dim oOpt As OptionButton
Dim i As Long
For i = 1 To 9
Load optPos1(i)
Set oOpt = optPos1(i)
oOpt.Move optPos1(i - 1).Left, optPos1(i - 1).Top + optPos1(i - 1).Height + 10 * Screen.TwipsPerPixelX
oOpt.Tag = (i + 1) / 10
oOpt.Caption = "第" & i + 1 & "点 (" & Format(oOpt.Tag, "0.00#") & ")"
oOpt.Visible = True
Next i
End Sub
Private Sub Command_BUTTON_OPENCOM_Click()
If MSComm.PortOpen Then MSComm.PortOpen = False
On Error GoTo ErrorHandler
MSComm.CommPort = Combo_com.ListIndex + 1
MSComm.PortOpen = True
On Error GoTo ErrorHandler
Exit Sub
ErrorHandler:
MsgBox "打开串口时出错", vbOKOnly + vbExclamation, "错误"
End Sub
Private Sub Command_Button_PR_Click()
Label_RP1.Caption = "AD采集值"
Label_RP2.Caption = "标定点"
Label_RP3.Caption = ""
End Sub
Private Sub Command_Button_TR_Click()
Label_RP1.Caption = "温度"
Label_RP2.Caption = "零点"
Label_RP3.Caption = "满程"
End Sub
Private Sub cmd_Test_Click()
Dim count As Integer
Dim itm As ListItem
For count = 1 To 10
Set itm = ListView1.ListItems.Add()
itm.Text = "测试"
高手帮我看一下啊~!!
Option Explicit
'Private Type wdir '主机写命令结构
' wd(0) As Byte
' wd(1) = &H10
' wd(2) As Byte
' wd(3) As Byte
' wd(4) = &H0
' wd(5) = &H2
' wd(6) = &H4
' wd(7) As Byte
' wd(8) As Byte
' wd(9) As Byte
' wd(10) As Byte
' wdcheck As Integer
' End Type
'Private Type wspon '仪表写响应结构
' wds(0) As Byte
' wds(1) As Byte
' wds(2) As Byte
' wds(3) As Byte
' wds(4) As Byte
' wds(5) As Byte
' wdscheck As Integer
' End Type
Private Sub Combo1_Change()
Combo1.List
End Sub
'输入压力温度标定中OptionButton的值(需修改)
Private Sub initOpt()
Dim oOpt As OptionButton
Dim i As Long
For i = 1 To 9
Load optPos1(i)
Set oOpt = optPos1(i)
oOpt.Move optPos1(i - 1).Left, optPos1(i - 1).Top + optPos1(i - 1).Height + 10 * Screen.TwipsPerPixelX
oOpt.Tag = (i + 1) / 10
oOpt.Caption = "第" & i + 1 & "点 (" & Format(oOpt.Tag, "0.00#") & ")"
oOpt.Visible = True
Next i
End Sub
Private Sub Command_BUTTON_OPENCOM_Click()
If MSComm.PortOpen Then MSComm.PortOpen = False
On Error GoTo ErrorHandler
MSComm.CommPort = Combo_com.ListIndex + 1
MSComm.PortOpen = True
On Error GoTo ErrorHandler
Exit Sub
ErrorHandler:
MsgBox "打开串口时出错", vbOKOnly + vbExclamation, "错误"
End Sub
Private Sub Command_Button_PR_Click()
Label_RP1.Caption = "AD采集值"
Label_RP2.Caption = "标定点"
Label_RP3.Caption = ""
End Sub
Private Sub Command_Button_TR_Click()
Label_RP1.Caption = "温度"
Label_RP2.Caption = "零点"
Label_RP3.Caption = "满程"
End Sub
Private Sub cmd_Test_Click()
Dim count As Integer
Dim itm As ListItem
For count = 1 To 10
Set itm = ListView1.ListItems.Add()
itm.Text = "测试"