循环延时问题
请求老师帮忙:需要延时循环给串口发送16进制字符串,先发送1A A9 8C 22 D5 1B 6A 55 3F 2D 0D 2A 延时800MS再发送1F 29 88 3D 6A 22 2B 1C 3E 延时800MS后再发送1A A9 8C 22 D5 1B 6A 55 3F 2D 0D 2A一直循环。
Private Sub Timer1_Timer()
If MSComm1.PortOpen = False Then MSComm1.PortOpen = True
If MSComm1.PortOpen = False Then
MsgBox "选取的COM端口无效或被占用,请关闭软件重选!"
End If
Dim Data(11) As Byte
Data(0) = &H1A
Data(1) = &HA9
Data(2) = &H8C
Data(3) = &H22
Data(4) = &D5
Data(5) = &H1B
Data(6) = &H6A
Data(7) = &H55
Data(8) = &H3F
Data(9) = &H2D
Data(10) = &H0D
Data(11) = &H2A
MSComm1.Output = Data
End Sub
interval 设置小于1000就无效了,这2段字符循环发送要怎么实现?谢谢老师!