code snippet:
Private Function MakeString(v As Variant) As String
Dim t As String
t = ""
For i = 0 To UBound(v)
t = t & Chr(v(i))
Next i
MakeString = t
End Function
Set objComm = CreateObject("MSCOMMLib.MSComm.1")
objComm.CommPort = iPortNo
objComm.Settings = "38400,n,8,1"
objComm.Handshaking = 0
objComm.InputLen = 0
objComm.InBufferSize = 512
objComm.InputMode = 1
objComm.NullDiscard = False
objComm.DTREnable = False
objComm.RTSEnable = False
objComm.EOFEnable = False
objComm.RThreshold = 10 ' useless, events will not be fired
objComm.PortOpen = True
objComm.Output = "?"
lCount = 0
Do
SleepEx 10, False
lCount = lCount + 1
Loop Until (objComm.InBufferCount > 20) Or (lCount > WAIT_COUNT)
msResult = MakeString(objComm.input)
hope this will help
greetings from Germany