Results 1 to 3 of 3

Thread: Dailup Automation [Resolution = PEBCAK]

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Durham, NC, US
    Posts
    218

    Dailup Automation [Resolution = PEBCAK]

    I am building some automation for our systems monitoring application. We want it to occassionally dial into a remote application and make a quick check. It is a customer-facing dialup service, and it occassionally locks up.

    This is my very preliminary code:
    VB Code:
    1. Private Sub Form_Load()
    2.  
    3.     Me.Show
    4.     myComCon.CommPort = 5
    5.     myComCon.Settings = "9600,N,8,1"
    6.     myComCon.InputLen = 0
    7.     myComCon.RThreshold = 1
    8.     myComCon.PortOpen = True
    9.     myComCon.Output = "AT" & vbCr
    10.    
    11. End Sub
    12.  
    13. Private Sub myComCon_OnComm()
    14.  
    15.     Dim strCurrInput As String
    16.  
    17.     Select Case myComCon.CommEvent
    18.         Case comEvReceive
    19.             strCurrInput = myComCon.Input
    20.             strCurrInput = Replace(Replace(strCurrInput, vbCr, ""), vbLf, "")
    21.             txtMain.Text = txtMain.Text & strCurrInput & vbCrLf
    22.             ParseInput strCurrInput
    23.     End Select
    24.  
    25. End Sub
    26.  
    27. Private Sub ParseInput(sInput As String)
    28.  
    29.     If (InStr(sInput, "OK")) Then
    30.         myComCon.Output = "ATD5551234"
    31.     ElseIf (InStr(sInput, "ABORTED")) Then
    32.         Unload Me
    33.     End If
    34.  
    35. End Sub

    Right now it is on a VB Forms project. It will eventually remain hidden. myComCon is a MSComm component.

    When it starts, it connects to the MODEM and sends an 'AT' to make sure everything is 'OK'. If it is, then it will dial ('ATD').

    My current problem is... it doesn't establish the connection. Sometimes, I can stop the application, restart it, and before I can even issue the first 'AT', I am greeted by the connect string. The 'ATD' from the previous attempt seems to have succeeded.

    Any ideas why this is? Is there something that I am not doing that is being done as part of the stop, re-initialize?
    Last edited by Travis G; Sep 30th, 2004 at 09:45 AM.
    Travis, Kung Foo Journeyman

    Web Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.5 Guide and Reference
    Perl: Documentation, Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    OSS: Mozilla, MySQL (Manual)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width