|
-
Sep 30th, 2004, 09:19 AM
#1
Thread Starter
Addicted Member
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:
Private Sub Form_Load()
Me.Show
myComCon.CommPort = 5
myComCon.Settings = "9600,N,8,1"
myComCon.InputLen = 0
myComCon.RThreshold = 1
myComCon.PortOpen = True
myComCon.Output = "AT" & vbCr
End Sub
Private Sub myComCon_OnComm()
Dim strCurrInput As String
Select Case myComCon.CommEvent
Case comEvReceive
strCurrInput = myComCon.Input
strCurrInput = Replace(Replace(strCurrInput, vbCr, ""), vbLf, "")
txtMain.Text = txtMain.Text & strCurrInput & vbCrLf
ParseInput strCurrInput
End Select
End Sub
Private Sub ParseInput(sInput As String)
If (InStr(sInput, "OK")) Then
myComCon.Output = "ATD5551234"
ElseIf (InStr(sInput, "ABORTED")) Then
Unload Me
End If
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|