Home > Software engineering >  For help, vb transmit array instruction, encountered some problems
For help, vb transmit array instruction, encountered some problems

Time:11-26

I found after clicking the button, text1 every time can output "hello", and the next bit machine I sometimes don't respond, the 41 07 instruction for hexadecimal, can make the next bit machine one of the lights, sometimes they can be sent out, make the light up, what is the problem? Is it possible that is in the process of transmission data error?
Private Sub Form_Load ()
MSComm1. Settings="9600, n, 8, 1", "
MSComm1. OutBufferSize=4096
MSComm1. InBufferSize=1024
MSComm1. OutBufferCount=0
MSComm1. InBufferCount=0
Mscomm1. Portopen=4
MSComm1. PortOpen=True
End Sub

Private Sub Command3_Click ()
Dim a1 (1) the As Byte
A1 (0)=& amp; H41
A1 (1)=& amp; H7
MSComm1. The Output=a1
Text1. Text="hello!"
End sub
  • Related