📄 pc与智能仪器串口通讯.frm
字号:
Caption = "0"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 135
Left = 330
TabIndex = 40
Top = 3400
Width = 135
End
Begin VB.Label Label24
Caption = "125"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 90
TabIndex = 36
Top = 30
Width = 300
End
Begin VB.Label Label23
Caption = "200"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 4920
TabIndex = 35
Top = 3400
Width = 300
End
Begin VB.Label Label22
Caption = "175"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 4340
TabIndex = 34
Top = 3400
Width = 300
End
Begin VB.Label Label21
Caption = "150"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 3770
TabIndex = 33
Top = 3400
Width = 300
End
Begin VB.Label Label20
Caption = "125"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 3160
TabIndex = 32
Top = 3400
Width = 300
End
Begin VB.Label Label19
Caption = "100"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 2600
TabIndex = 31
Top = 3400
Width = 300
End
Begin VB.Label Label18
Caption = "75"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 2040
TabIndex = 30
Top = 3400
Width = 300
End
Begin VB.Label Label17
Caption = "50"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 1480
TabIndex = 29
Top = 3400
Width = 300
End
Begin VB.Label Label16
Caption = "25"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 880
TabIndex = 28
Top = 3400
Width = 300
End
Begin VB.Label Label15
Caption = "-50"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 90
TabIndex = 27
Top = 3270
Width = 300
End
Begin VB.Label Label10
Caption = "-25"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 90
TabIndex = 26
Top = 2820
Width = 300
End
Begin VB.Label Label9
Caption = "0"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 195
TabIndex = 25
Top = 2355
Width = 180
End
Begin VB.Label Label4
Caption = "25"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 160
TabIndex = 24
Top = 1895
Width = 165
End
Begin VB.Label Label3
Caption = "50"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 160
TabIndex = 23
Top = 1435
Width = 165
End
Begin VB.Label Label2
Caption = "75"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 160
TabIndex = 22
Top = 990
Width = 165
End
Begin VB.Label Label1
Caption = "100"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 150
Left = 90
TabIndex = 21
Top = 520
Width = 300
End
End
Attribute VB_Name = "FrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'定义窗体级变量
'在显示、绘图、报警等过程中使用
Dim datatemp(200) As Single ' 用于存储温度采样值
Dim num As Integer ' 用于存储采样值个数
Dim counter As Integer ' 采样个数计数器
Dim mark As Boolean ' 暂停标志
'-----------------------------------------------
' 温度采集
'-----------------------------------------------
Private Sub CmdStart_Click() ' 开始采集
If (Txttimes > 200) Or (Txttimes < 1) Then ' 参数设置判断
MsgBox "参数错误!采集次数应取“0~200”之间的数。", 49, "温度采集系统"
Call setAcquiescence ' 默认设置
Exit Sub
End If
If (Txttime > 60) Or (Txttime < 0.01) Then
MsgBox "参数错误!间隔时间应取“0.01~60”之间的数。", 49, "温度采集系统"
Call setAcquiescence ' 默认设置
Exit Sub
End If
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
Call setCom ' 设置串口
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -