进度更新2:在原程序的基础上加了一个文本框,一个按钮,可以在程序运行阶段改端口了。并且实现了对小灯状态的检测
代码:
Private Sub Command1_Click()
MSComm1.Output = "1"
End Sub
Private Sub Command2_Click()
MSComm1.Output = "0"
End Sub
Private Sub Command3_Click()
MSComm1.CommPort = Text1.Text
If MSComm1.PortOpen = False Then
MSComm1.PortOpen = True '打开串口
End If
End Sub
Private Sub MSComm1_OnComm()
Dim num As Integer
num = 0
num = CInt(MSComm1.Input)
Form1.Caption = num
If num = 1 Then
Command1.BackColor = RGB(0, 255, 0)
Command2.BackColor = RGB(255, 255, 255)
Else
Command1.BackColor = RGB(255, 255, 255)
Command2.BackColor = RGB(255, 0, 0)
End If
End Sub
时段 | 个数 |
---|---|
{{f.startingTime}}点 - {{f.endTime}}点 | {{f.fileCount}} |