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