Sign in to follow this  
Followers 0
atwolf359

comm port monitor

13 posts in this topic

I'm looking for way to detect a modem ring on a comm port


I've been on the net so long, I remember when I could only e-mail myself!

Share this post


Link to post
Share on other sites



I'm looking for way to detect a modem ring on a comm port

I don't know how to detect the ring, but the way I think software normally deals with modems is to set the modem to auto answer mode, and then just detect some incomming data.


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.

Share this post


Link to post
Share on other sites

@All

Modems are controll by AT commands.

This will get you all started :

Modem AT Commands

regards,

ptrex

I think y'all are missing the point. RI (Ring Indicator) is a specific pin on an RS-232 (COM) port. Pin 22 on a DB25 connector, or pin 9 on a DB9. The equipment tied to the port and signaling on that pin might not be a modem at all.

DaleHohm wrote a UDF: Phone Dialer (using COM to modem on serial port)

I haven't looked but perhaps peeking at Dale's code will show you how to read individual signal states using a COM object to access the COM port.

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I think y'all are missing the point. RI (Ring Indicator) is a specific pin on an RS-232 (COM) port. Pin 22 on a DB25 connector, or pin 9 on a DB9. The equipment tied to the port and signaling on that pin might not be a modem at all.

That's a little harsh.

I said that I don't know how to detect RI and I mentioned AutoAnswer which I don't think is missing the point. In fact saying I don't know how to detect RI imeans I don't know how to detect it using AutoIt and API calls.

@ atwolf359: If there is no connection to RI then you really have to use AutoAnswer. If you have the RI connection, which I would expect with the correct lead to a modem, then my COMMS udf could be extended fairly easily to give the status of the ring indicator. PM me if that would be useful, but look at the UDF first to see if would would do what you want otherwise.


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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I haven't looked closely at martin's UDF so my comments should not be taken to imply anything about its abilities.

With the COM methods however, you can use an event-driven model to detect port state, activity and data (i.e. it does not require a polling loop) so it can be quite efficient. When you use the DLL from Hard and Software, there is no special license required.

Dale

Edit: Typo

Edited by DaleHohm

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

Share this post


Link to post
Share on other sites

I haven't looked closely at martin's UDF so my comments should not be taken to imply anything about it's abilities.

With the COM methods however, you can use an event-driven model to detect port state, activity and data (i.e. it does not require a polling loop) so it can be quite efficient. When you use the DLL from Hard and Software, there is no special license required.

Dale

Equally I know almost nothing about the COM method. If you can use an event to detect RI then that would be more efficient than what I was thinking of doing, and at the moment I don't intend to generate messages in my dll so it would require something like adlibenable with a function to keep checking the status.

Can you give a link to the dll from Hard and Soft Dale?


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.

Share this post


Link to post
Share on other sites

It is at www.hardandsoftware.net - the COM dialer post has more detail here: http://www.autoitscript.com/forum/index.ph...c=19769&hl=

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

Share this post


Link to post
Share on other sites

Two issues here.

1: You have to read the data coming from the COM port. There are a number of threads on these forums already devoted to this subject.

2: After you have mastered that, you need to monitor what is coming from the COM port. A standard AT command driven modem will transmit ASCII characters "RING" out of the COM port when it detects a ring signal if configured correctly. You should not have to monitor the RS232 RI pin to do that.

________________

It's all software...

Share this post


Link to post
Share on other sites

A standard AT command driven modem will transmit ASCII characters "RING" out of the COM port when it detects a ring signal if configured correctly. You should not have to monitor the RS232 RI pin to do that.

I didn't know that a modem sent "RING", but then I don't have a modem. I assume this happens when the modem is not set to auto answer. Does it send RING for every ring that would normally be heard, or is it just one RING for every attempted connection?

To see this you don't need to 'master' reading data on the COM port btw; that was the whole point of Dale's thread on Com, and which he referred to, and mine. You can use hyperterminal to manually control a modem and receive or transmit files.


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.

Share this post


Link to post
Share on other sites

Thanks everyone,

You gave me some direction.

I found "port.dll" ok ,

but the "commgAll.zip" would not open.

Is there another link to this file


I've been on the net so long, I remember when I could only e-mail myself!

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Thanks everyone,

You gave me some direction.

I found "port.dll" ok ,

but the "commgAll.zip" would not open.

Is there another link to this file

The file commgAll.zip should be 219K. Try downloading it again or try this (link removed)

If you still have a problem then PM me.

Edited by martin

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.

Share this post


Link to post
Share on other sites

The file commgAll.zip should be 219K. Try downloading it again or try this this link.

If you still have a problem then PM me.

the new link worked, thanks.

I'll post my results.


I've been on the net so long, I remember when I could only e-mail myself!

Share this post


Link to post
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
Sign in to follow this  
Followers 0