Hi guys,
I face some problem on using MSComm ....
I want to send a byte of data to the RS232 buffer and the data
received is the Hex of the sent data. After trying for few times,
I get weird Hex numbers....
Is it my program problem or the hardware ??
the following is my program.....
Private Sub end_Click()
MSComm1.PortOpen = False
End
End Sub
Private Sub Form_Load()
MSComm1.PortOpen = True
End Sub
Private Sub receive_Click()
Dim InByte() As Byte
Dim buf$, i%
InByte = MSComm1.Input
For i = LBound(InByte) To UBound(InByte)
buf = buf + Hex(InByte(i))
Next i
txt2.Text = buf
End Sub
Private Sub send_Click()
Dim a As Integer
Dim OutByte(1 To 1) As Byte
'For a = 1 To 100
OutByte(1) = &H1F
MSComm1.Output = OutByte
'Next a
End Sub
I face some problem on using MSComm ....
I want to send a byte of data to the RS232 buffer and the data
received is the Hex of the sent data. After trying for few times,
I get weird Hex numbers....
Is it my program problem or the hardware ??
the following is my program.....
Private Sub end_Click()
MSComm1.PortOpen = False
End
End Sub
Private Sub Form_Load()
MSComm1.PortOpen = True
End Sub
Private Sub receive_Click()
Dim InByte() As Byte
Dim buf$, i%
InByte = MSComm1.Input
For i = LBound(InByte) To UBound(InByte)
buf = buf + Hex(InByte(i))
Next i
txt2.Text = buf
End Sub
Private Sub send_Click()
Dim a As Integer
Dim OutByte(1 To 1) As Byte
'For a = 1 To 100
OutByte(1) = &H1F
MSComm1.Output = OutByte
'Next a
End Sub