[求助]MSComm接受到的二进制转换成十六进制显示的时候总少一个零
MSComm接受到的二进制转换成十六进制显示的时候总少一个零
代码如下:
Private Sub Command1_Click()
MSComm1.PortOpen = True
MSComm1.Output = "a123456b"
Buf = ""
End Sub
Private Sub MSComm1_OnComm()
Select Case MSComm1.CommEvent
Case comEvReceive
InByte = MSComm1.Input
For i = LBound(InByte) To UBound(InByte)
Buf = Buf + Hex(InByte(i))
Next i
Text2.Text = Buf
MSComm1.PortOpen = False
Case comEvSend
MSComm1.Output = "a123465b"
Text1.Text = "传输缓冲区有 Sthreshold 个字符"
End Select
End Sub