What is InBufferCount?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone explain what is InBufferCount? I am trying to
dignose code on some machines that continue at the loop.

Public Function GetWeight() As Double
Dim sInput As String

On Error GoTo ErrorHandler

ActiveCell.Value = "Waiting for Stable..."
frmComm.comExcel.CommPort = 1
frmComm.comExcel.Settings = "9600,N,7,2"
frmComm.comExcel.PortOpen = True
frmComm.comExcel.Output = "1S" & Chr$(13) 'Print on
stable
frmComm.comExcel.Output = "P" & Chr$(13) 'Display data

Do
DoEvents
Loop Until frmComm.comExcel.InBufferCount >= 18

sInput = frmComm.comExcel.Input
frmComm.comExcel.PortOpen = False

GetWeight = Val(Mid$(sInput, 1))

Exit Function

ErrorHandler:
If Err.Number = 8005 Then
Exit Function
Else
MsgBox Err.Description
End If
End Function
 
Back
Top