PatrickIRL
Programmer
- Jun 25, 2003
- 383
Hi all, I've been using the mscomm1 control in an application to interface with a scales. However there seems to be an anomoly.
In my code, in the OnComm event, I'm parsing the string in a function as follows:
The OnComm event is as follows:
The ParseInput function should return the string in the proper format.
However sometimes the data in mscomm1.Input is missing, sometimes I get only 10 to 20 characters, I'm expecting over 3000. Any ideas what would cause this??? It's intermittent but unless I can get it working the whole project is kindof held up.
Thanks in advance, Patrick
In my code, in the OnComm event, I'm parsing the string in a function as follows:
Code:
Private Sub cmdRead_Click()
If MSComm1.PortOpen = True Then
MSComm1.PortOpen = False
End If
'''''''''''''''''''''''''''''''''
With MSComm1
If .PortOpen = False Then
.CommPort = 1
.Settings = "9600,n,8,1"
.RThreshold = 1
.PortOpen = True
End If
End With
End Sub
The OnComm event is as follows:
Code:
Dim sBuffer
Dim sData As String
'''''''''''''''''''''''''''''''''
sBuffer = sBuffer & MSComm1.Input
'''''''''''''''''''''''''''''''''
sData = ParseInput(sBuffer)
'''''''''''''''''''''''''''''''''
The ParseInput function should return the string in the proper format.
However sometimes the data in mscomm1.Input is missing, sometimes I get only 10 to 20 characters, I'm expecting over 3000. Any ideas what would cause this??? It's intermittent but unless I can get it working the whole project is kindof held up.
Thanks in advance, Patrick