MSComm Question 
Author Message
 MSComm Question

Is there a way when dialing a phone number with the MSComm control, to
tell if a busy signal was recieved?

Thanks for your time!
Aaron G. Sword



Mon, 21 May 2001 03:00:00 GMT  
 MSComm Question
Hi Aaron,

Is there a way when dialing a phone number with the MSComm control, to
tell if a busy signal was recieved?
<<

Yes.  I have more extensive information on this (and lots more!) in my book.
See below for information.

MSComm1.Output = "ATX4" & vbCr
WaitForOK
MSComm1.Output = "ATDT3035551234" & vbCr
'NOTE: DO NOT INCLUDE A SEMICOLON IN THE DIALSTRING
ReturnValue = WaitForModemResponse
'parse returnvalue here

Private Function WaitForModemResponse () As Integer
Dim Timeout As Long
Dim Buffer As String
    Timeout = 30  'or whatever timeout you want to define
    Timeout = Timer + Timeout
    Do until Timer > Timeout
        Buffer = Buffer & MSComm1.Input
        If InStr(Buffer, "CONNECT" & vbCrLf) Then
                WaitForModemResponse = 1
                Exit Function
        Elseif InStr(Buffer, "BUSY" & vbCrLf) Then
                WaitForModemResponse = 2
                Exit Function
        Elseif InStr(Buffer, "NO CARRIER" & vbCrLf) Then
                WaitForModemResponse = 3
        'etc.
        End If
        DoEvents
    Loop
End Function

--
Richard Grier
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO  80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition (355 pages).
For information look on my homepage at
http://ourworld.compuserve.com/homepages/richard_grier.
Use the Books link to order.  For faster service contact the publisher at
http://www.mabry.com.



Tue, 22 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MSComm question

2. MSCOMM Question

3. MSComm Question

4. MSComm question

5. Yet another MSComm Question.

6. MSComm Question

7. MSComm question

8. MSComm question

9. VB5/MScomm questions

10. MSCOMM Question

11. VB3 MSComm Question (RTS)

12. MSComm Question

 

 
Powered by phpBB® Forum Software