n9mfk9 Posted August 18, 2006 Share Posted August 18, 2006 ok how wood i can it form ok to fr1; thank beau Link to comment Share on other sites More sharing options...
DaleHohm Posted August 18, 2006 Author Share Posted August 18, 2006 I'm sorry, that doesn't make sense to me. What is your native language? 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 More sharing options...
n9mfk9 Posted August 18, 2006 Share Posted August 18, 2006 I'm sorry, that doesn't make sense to me.What is your native language?Daleno I have a rs232 device on com4 if I use a modem program I can send it the command fr; and it send back the status as fs0; fr1; fr2; so what I went to do is send the command and see the what comes back so I known the next command. I need to send thanks Beau Link to comment Share on other sites More sharing options...
ivan Posted August 18, 2006 Share Posted August 18, 2006 You're at it again Dale! Trying to extend the capabilities of AutoIt where no other programming language has gone before... It's a real shame I don't have data cables for serial ports, in fact, I seem to have no devices for those ports. When I saw the title for this topic I didn't read the 'serial' part and kept hoping usb ports were supported. Well, can't try it, but it definitely is a good idea. IVAN Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
DaleHohm Posted August 18, 2006 Author Share Posted August 18, 2006 @n9mfk9 If $com.InBufferCount is >0, then there is data in the output buffer $com.Input will return the data from the buffer to your program So, send your command and read $com.Input to the modem response and take appropriate action based on the result @ivan Thanks for the kind words, but they are hyperbole... this example was adapted from a VB sample I found and MSComm has been around for quite a long time... This sort of thing is old hat and only new to AutoIt because it uses the COM support. There are other more brute force methods as well that read and write directly to the serial interface. 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 More sharing options...
schnibble Posted September 13, 2006 Share Posted September 13, 2006 is it posibble to send Chr(0)? $MsComm.Output = Chr(0) ---> does not work $MsComm.Output = Chr(0)^ ERROR $MsComm.Output = Chr(1) ---> does work thanks schnibble Link to comment Share on other sites More sharing options...
DaleHohm Posted September 13, 2006 Author Share Posted September 13, 2006 Sorry, don't know. Suggest you might want to create a test in VBScript and then look in MSDN for docs and for support. If it works in VBScript and not in AutoIt, then it will warrant more research. 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 More sharing options...
RanzITman Posted November 16, 2006 Share Posted November 16, 2006 (edited) Great!In AutoIt you'll need to use ObjEvent to set up a COM event handler. Take a look at the helpfile... it is pretty straight forward and similar to the VBS handler.DaleCan you give a brief example of this? I am trying to write a simple script that looks for a change in the Carrier Detect Event (comEvCD) and notifies me each time it chages state. I reviewed the help file on ObjEvent but I can't relate it to your NetComm object.All I am trying to do is read the Carrier Detect state and send time and date info to a file when the state changes. I have this script working in Reflections Basic Script but can't match it in AutoIT.Any help would be greatly appreciated.RanzITman Edited November 16, 2006 by RanzITman Link to comment Share on other sites More sharing options...
DaleHohm Posted November 16, 2006 Author Share Posted November 16, 2006 Suggest you post what you have tried so far and see if anyone can help. 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 More sharing options...
Thatsgreat2345 Posted November 17, 2006 Share Posted November 17, 2006 stupid question here dale your computer must be connected straight to your modem and not going through a router? Link to comment Share on other sites More sharing options...
DaleHohm Posted November 17, 2006 Author Share Posted November 17, 2006 stupid question here dale your computer must be connected straight to your modem and not going through a router?the component controls a serial (COM) port. ObjCreate can connect to a remote system however, so it depends on how your modem is connected. 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 More sharing options...
RanzITman Posted December 10, 2006 Share Posted December 10, 2006 Suggest you post what you have tried so far and see if anyone can help.DaleI wrote this simple script that records probe activity on a CMM. It works fine with MSCOMM but the machine I am loading it on does not have that control. Does NETCOMM have all the routines of MSCOMM? Can this script be easily converted?Thanks;RanzITman#include <Date.au3>Opt("TrayAutoPause",0) ;0=no pause, 1=PauseOpt("TrayMenuMode",1) ;0=append, 1=no default menu, 2=no automatic check, 4=menuitemID not return$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $cfg = FileOpen ("CMMMon.cfg",0) If $cfg = -1 Then MsgBox(0, "Error", "Unable to open Config file.") Exit EndIf $cport = FileReadLine($cfg) $csets = FileReadLine($cfg) $path = FileReadLine($cfg) FileClose($cfg) $file = FileOpen($path, 1) FileWriteLine($file, @CRLF & '"----","----","------","-----------","-----------"') FileWriteLine($file,'"Date","Time","Status","Mins Parked","Mins Active"') FileWrite($file,'"' & _NowCalcDate() & '","' & _NowTime(5) & '","PrgStart",') FileClose($file) $Parked = True $chngd = TimerInit() $dif = Round(TimerDiff($chngd),3) $hour = 0 $mins = 0 $secs = 0$com = ObjCreate ("MSCommLib.MSComm") ObjEvent($com,"CommEvent") With $com .CommPort = $cport .PortOpen = True .Settings = $csets .InBufferCount = 0 .Handshaking = 2 .Sthreshold = 1 .Rthreshold = 0 EndWith While 1 If $com.cdHolding = True and $parked = True Then $dif = Round(((TimerDiff($chngd) / 1000)/60),3) $file = FileOpen($path, 1) FileWriteLine($file,',,' & $dif) FileWrite($file,'"' & _NowCalcDate() & '","' & _NowTime(5) & '","Parked"') FileClose($file) $Parked = False $chngd = TimerInit() Elseif $com.cdHolding = False and $Parked = False Then $dif = Round(((TimerDiff($chngd) / 1000)/60),3) $file = FileOpen($path, 1) FileWriteLine($file,',' & $dif) FileWrite($file,'"' & _NowCalcDate() & '","' & _NowTime(5) & '","Active"') FileClose($file) $Parked = True $chngd = TimerInit() EndIf Sleep(1000) 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 COM port" );& $com.CommPort) ExitEndFunc;==>MyErrFunc Link to comment Share on other sites More sharing options...
DaleHohm Posted December 11, 2006 Author Share Posted December 11, 2006 (edited) Most likely. See the Netcomm api docs. Dale Edited September 20, 2007 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 Link to comment Share on other sites More sharing options...
larson Posted March 2, 2007 Share Posted March 2, 2007 Hi there, I tried the example NETComm code. When I read the port using inputData, I got the "Error communicating with modem on COM" message. I have installed the NETCommOCX and update (is it just overwrite the old NETComm.ocx with the new one?) Does anyone see this problem before? Thanks, larson Link to comment Share on other sites More sharing options...
N4rk0 Posted September 20, 2007 Share Posted September 20, 2007 There is a way to know if there is already a call on the line , so if there is a call the script can wait for it to end? And after the number has been sent there is a way to know if the called phone is ringing? There are built in solutions or i must see 'by hand' what data are sent to the modem when there are not calls on the line and when the other phone is ringing? Link to comment Share on other sites More sharing options...
DaleHohm Posted September 20, 2007 Author Share Posted September 20, 2007 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 More sharing options...
RanzITman Posted September 24, 2007 Share Posted September 24, 2007 Hey Dale; Is there any special syntax needed in NETCOMM to change the default buffer sizes? I can read the values easily with: MsgBox(0,"Show Me","Settings are at " & $com.InBufferSize) MsgBox(0,"Show Me","Settings are at " & $com.OutBufferSize) They both return 1024. But... When I try to set the values using: $com.InBufferSize = 4096 $com.OutBufferSize = 32000 I get an immediate error trapped and the program exits. I have tried these lines before and after opening the port. The routine works fine with the lines commented out. The Machine I am connecting to requires those buffer settings. Any Ideas? Thanks; RanzITman Link to comment Share on other sites More sharing options...
RanzITman Posted September 25, 2007 Share Posted September 25, 2007 Figured it out.. It looks like order is critical.Set portSet inbufferSet outbufferSet baud,parity etc...open port.No errors...Hey Dale;Is there any special syntax needed in NETCOMM to change the default buffer sizes? I can read the values easily with:MsgBox(0,"Show Me","Settings are at " & $com.InBufferSize)MsgBox(0,"Show Me","Settings are at " & $com.OutBufferSize)They both return 1024.But... When I try to set the values using:$com.InBufferSize = 4096$com.OutBufferSize = 32000I get an immediate error trapped and the program exits. I have tried these lines before and after opening the port. The routine works fine with the lines commented out.The Machine I am connecting to requires those buffer settings.Any Ideas?Thanks;RanzITman Link to comment Share on other sites More sharing options...
DaleHohm Posted September 25, 2007 Author Share Posted September 25, 2007 Cool. Glad I could help 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 More sharing options...
Champak Posted November 21, 2007 Share Posted November 21, 2007 I'm getting "Error communicating with modem on COM" on three different computers. All of which have the modem on COM 3. Any help? What am I doing wrong? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now