Jump to content

Phone Dialer (using COM to modem on serial port)


DaleHohm
 Share

Recommended Posts

@Champak:

You'll need to look at documentation for MSCOMM (probably in MSDN) and NETComm (at the HardAndSoftware link in the base note).

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

  • 4 months later...

hi i am new ti autoIt and i tried the netcommocx example and it works great, but for my application i need the modem to stay connected and close the com port so other program can use it and communicates with remote modem. (i use it to connect to a plc)

i am able to do it in hyperterminal with atdt+ phone number then close program and the modem stay connected, but with the example the modem disconnect as soon as the program closes. Is it something possible to do?

Link to comment
Share on other sites

Sorry, don't know. Please reference the MSComm and NetComm documentation.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Please have mercy. I am trying to make a script that detects ringing on the phone line related to the internal modem.

I have looked at MS and NETComm, and Googled my fingers raw, but the problem is I am still learning. I only have one AutoIt script under my belt (posted yesterday as iTunes Launch by mashenden) so I am making progress but still very much on the learning curve. The trouble with reading the explanations is it looks a bit like Greek to me.

Anyways, enough excuses. Here is what I have (much to this post's credit)...

; Set a COM Error handler -- only one can be active at a time (see helpfile)
$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

    $com = ObjCreate ("NETCommOCX.NETComm")

    With $com
        .CommPort = 3
        .PortOpen = True
        .Settings = "9600,N,8,1"
        .InBufferCount = 0
    EndWith

    Dim $done
    While Not $done
        Select
            Case comEvRing   ' Change in the Ring Indicator.
                MsgBox(0, "Notice", "Detected Ringing on: " );& $com.CommPort)
                $done = 1
            Case Else
                Sleep(250)
        EndSelect
    WEnd

    $com.Output = "ATH" & @CR
    $com.PortOpen = False
    $com = 0

Func MyErrFunc()
; Set @ERROR to 1 and return control to the program following the trapped error
    SetError(1)
    MsgBox(0, "Error", "Error communicating with modem on COM" );& $com.CommPort)
    Exit
EndFunc;==>MyErrFunc

What am I doing wrong with respect to either the use of Case or comEvRing?

Edited by mashenden
Link to comment
Share on other sites

Maybe another way to get me where I would like to be in learning the fundamentals is to explain how to integrate the code provided by JoseLB in the post on Mar 2, 2006 @ 2:16 pm into the "freeware NET Comm example" initially provided by DaleHohm.

Or even suggest a good place to relearn the programming basics (pun intended - I used to do a lot of programming but things have changed and I am very rusty but will learn quickly.

I need to understand how Case and Func work, mainly what the things in the () do, and how to establish the main part of the script in a loop while checking the modem using Case or Func or whatever.

Please invest time in me as I will repay by posting my results in a well documented fashion so others can use and learn.

If this should be posted in the General Support forum, let me know. Since the questions relate closely to this script, I figured this was OK.

Matt A

Link to comment
Share on other sites

You'll get more attention with a new post.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

  • 1 year later...

NetComm and MSComm work with COM1, COM2 etc serial ports.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

  • 1 month later...

Dale, how could i send Ctrl-Z keystroke via COM?

I can send "AT+CMGS=123456789 & @CR" (123456789 is the phone number)

but then i need to enter the string for the text and Ctrl-Z at the end to indicate it(@CR is no use)

Any idea?

Thanks

Link to comment
Share on other sites

Dale, how could i send Ctrl-Z keystroke via COM?

I can send "AT+CMGS=123456789 & @CR" (123456789 is the phone number)

but then i need to enter the string for the text and Ctrl-Z at the end to indicate it(@CR is no use)

Any idea?

Thanks

Just add the Ascii code for Ctrl Z

"AT+CMGS=123456789" & Chr(26)

You can find that in any Ascii table, but the control codes are simply Ctl A = 1, Ctrl B = 2 ... Ctrl Z = 26

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...