Hi!
I'm trying to input data from a simple device via COM1, and using VB sample dialer.vbp have been able to make a start. I am reading data, but not correctly. (Windows Hyper terminal gives an 8 digit code - but so far I get other symbols which are different each time I read.)
I have checked:
Baud rate = 9600
Data bits = 8
Stop bit = 1
Parity = N
Handshaking = Xon/Xoff
InBufferCount = 0
InputLen = 0
InputMode = Text
I've coded as follows:
MSComm1.CommPort = 1
MSComm1.Settings = "9600,N,8,1"
On Error Resume Next
MSComm1.PortOpen = True
If Err Then
MsgBox "COM1: not available. Change the CommPort property to another port."
Exit Sub
End If
' Flush the input buffer.
MSComm1.InBufferCount = 0
MSComm1.InputLen = 0
MSComm1.InputMode = comInputModeText
Do
' If there is data in the buffer, then read it.
If MSComm1.InBufferCount Then
If MSComm1.CommEvent > 0 Then
MsgBox(MSComm_CommEvent)
End If
FromScanner$ = MSComm1.Input
'Display input string
MsgBox (FromScanner$)
End If
Loop
I have checked for Errors (OnComm) - but don't seem to be getting any.
Any suggestions - have I missed anything obvious?
Thanks for your help
I'm trying to input data from a simple device via COM1, and using VB sample dialer.vbp have been able to make a start. I am reading data, but not correctly. (Windows Hyper terminal gives an 8 digit code - but so far I get other symbols which are different each time I read.)
I have checked:
Baud rate = 9600
Data bits = 8
Stop bit = 1
Parity = N
Handshaking = Xon/Xoff
InBufferCount = 0
InputLen = 0
InputMode = Text
I've coded as follows:
MSComm1.CommPort = 1
MSComm1.Settings = "9600,N,8,1"
On Error Resume Next
MSComm1.PortOpen = True
If Err Then
MsgBox "COM1: not available. Change the CommPort property to another port."
Exit Sub
End If
' Flush the input buffer.
MSComm1.InBufferCount = 0
MSComm1.InputLen = 0
MSComm1.InputMode = comInputModeText
Do
' If there is data in the buffer, then read it.
If MSComm1.InBufferCount Then
If MSComm1.CommEvent > 0 Then
MsgBox(MSComm_CommEvent)
End If
FromScanner$ = MSComm1.Input
'Display input string
MsgBox (FromScanner$)
End If
Loop
I have checked for Errors (OnComm) - but don't seem to be getting any.
Any suggestions - have I missed anything obvious?
Thanks for your help