Hi,
do until
mscomm1.input = "end"
loop.
<<
Should look more like this:
Dim Buffer As String
Dim Succeed As Boolean
Do 'until Timeout = True, perhaps
Buffer = Buffer & MSComm1.Input
If InStr(Buffer, "end") Then
Succeed = True
Exit Do
Else
DoEvents
End If
Loop
If Succeed = True Then 'etc
You need to add DoEvents inside this loop. You also may want to add a
method for waiting until some time has expired and return an error if a
response is not received before that time has expired.
I have lots more information, and working example code in my book. See
below.
--
Richard Grier (Microsoft Visual Basic MVP)
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO 80228
303-986-2179 (voice)
303-986-3143 (fax)
Leave voice mail or fax that I can receive as email at 303-593-9315
Author of Visual Basic Programmer's Guide to Serial Communications, 3nd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order. For faster service contact the publisher at
http://www.mabry.com/vbpgser .