Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > modem ready?


Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2001, 08:10 AM
burningodzilla
Guest
 
Posts: n/a
Default modem ready?


how can i know that the modem is ready to dial? assuming that the correct serial port is open, can i just test DSRholding? is that standard?
Reply With Quote
  #2  
Old 10-12-2001, 08:25 AM
Aspen2K's Avatar
Aspen2K Aspen2K is offline
Contributor

Retired Leader
* Expert *
 
Join Date: Jan 2001
Location: Ohio
Posts: 717
Default Re: modem ready?

If you us MSComm1.Output = "ATdt" + Chr$(13) you should get back an OK
__________________
A man is a success if he gets up in the morning and gets to bed at night,
and in between does what he wants to do. - Bob Dylan

Vb code does not go through spell check very well - Me
Reply With Quote
  #3  
Old 10-12-2001, 09:06 AM
burningodzilla
Guest
 
Posts: n/a
Default Re: modem ready?

i send this:

FireCom.Output = "ATDT" + vbCr

view with this:

MsgBox "BUFFER: " + StrConv(FireCom.Input, vbUnicode), , "BUFFER CONTENTS"

and i get this "ATDT", then an out of memory error. my buffer gets a 1024 size data chunk and then chokes even though the buf len is 1024 exactly. then (err to debug window) it responds w/ no dialtone. that is expected....but how can i avoid that out of mem err, and if there was a dialtone, is the response "OK" standard?

thanks a TON
Reply With Quote
  #4  
Old 10-12-2001, 09:20 AM
ChiefRedBull's Avatar
ChiefRedBull ChiefRedBull is offline
ISearchGoogle

Retired Moderator
* Expert *
 
Join Date: May 2001
Location: england
Posts: 6,321
Default Re: modem ready?

The most basic and unprofessional way would be to stick a
<pre><font color=red>On Error Resume Next

</pre></font color=red>at the top of your Function or Sub.

Chief
__________________
Chuck Norris ordered a Big Mac at Burger King, and got one.
Reply With Quote
  #5  
Old 10-12-2001, 09:23 AM
burningodzilla
Guest
 
Posts: n/a
Default Re: modem ready?

yeahhhh....but being of the curious breed [img]images/icons/wink.gif[/img], i want to know how to stop it, why it's happening, etc. it seems like the last time i was working w/ mscomm i had this problem, that was a few months ago though.
Reply With Quote
  #6  
Old 10-12-2001, 09:33 AM
Aspen2K's Avatar
Aspen2K Aspen2K is offline
Contributor

Retired Leader
* Expert *
 
Join Date: Jan 2001
Location: Ohio
Posts: 717
Default Re: modem ready?

Ok try putting this:

FireCom.Output= "ATDT" + Chr$(13) <font color=green>'Put where you have FireCom.Output = "ATDT" + vbCr </font color=green>

And then put this in your OnComm() to see the "OK"

Dim Inp as String

Private Sub FireCom_OnComm()
If FireCom.InBufferCount &gt; 0 Then ds = FireCom.Input
If ds &lt;&gt; "" Then Inp = Inp + ds
Debug.Print ds
End Sub



__________________
A man is a success if he gets up in the morning and gets to bed at night,
and in between does what he wants to do. - Bob Dylan

Vb code does not go through spell check very well - Me
Reply With Quote
  #7  
Old 10-12-2001, 10:00 AM
burningodzilla
Guest
 
Posts: n/a
Default Re: modem ready?

i didn't try that, but the proposed accumulator wouldn't hold anything other than whatever ds is currently = to...since it's dim not static or global...right?

anyway, i tried something that half solved the prob, maybe you'll have some input on this. in the oncomm event i did:

If FireCom.CommEvent &lt;&gt; comEvReceive Then Exit Sub

that got rid of the err...so do ya have any clues as to why it ran out of mem? obviously reading the buf contents when no data was received was the prob....the Q is why?
Reply With Quote
  #8  
Old 10-14-2001, 08:30 AM
boskomihic boskomihic is offline
Centurion
 
Join Date: Sep 2001
Location: Yugoslavia
Posts: 103
Default Re: modem ready?

Simply, restart him with command "ATZ" and wait until you get answer "OK". Then just dial a number that you want (MSComm1.Output = "ATDT XZZZZX" Or MSComm1.Output = "ATX3DT XZZZZZX" -if you don't have dial tone)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->