Jump to content

SAM1386

Members
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

SAM1386's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thanks for the reply ...It worked for me as exactly I wanted..... Thanks a lot Regards, SAM
  2. I think the output is "COM5" but $port is taking only integer value 5. Is there any way to separate that "COM" and "5" part from COM5 so That I can give that 5 to $ port. Regards, SAM
  3. @Quesney :- Thanks for the reply. #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3>    Global $key = RegRead("HKLM\HARDWARE\DEVICEMAP\SERIALCOMM","\Device\ssudmdm0000")     Local $iError = 0     If @error Then        ; The server is probably offline/port is not opened on the server.        $iError = @error         MsgBox(BitOR($MB_SYSTEMMODAL, $MB_ICONHAND), "", "Client:" & @CRLF & "Could not connect, Error code: " & $iError)         Else         MsgBox($MB_ SYSTEMMODAL, "MODEM:", $key)         EndIf The above mentioned code is giving me the output as "COM5" like $key = COM5 and I want to get that port number 5 like in my case '5' to a variable named $port. So that I can pass that $port number to below function which will reset my UE by AT command "AT+CFUN=1,1" _CommSendStandard($port,$portError,"AT+CFUN=1,1") The thing here is when I write it as :- _CommSendStandard(5,$portError,"AT+CFUN=1,1") ; it works fine. but when I write it like below it donot work fine in run time. _CommSendStandard($port,$portError,"AT+CFUN=1,1") I want $port variable to take the $key value 5 in run time and set the $port value as 5 instead of setting it manually. I think I am unable to make understand my problem :-( Please help. Regards, SAM
  4. @Quesney :- Thanks for the reply. #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3>    Global $key = RegRead("HKLM\HARDWARE\DEVICEMAP\SERIALCOMM","\Device\ssudmdm0000")     Local $iError = 0     If @error Then        ; The server is probably offline/port is not opened on the server.        $iError = @error         MsgBox(BitOR($MB_SYSTEMMODAL, $MB_ICONHAND), "", "Client:" & @CRLF & "Could not connect, Error code: " & $iError)         Else         MsgBox($MB_ SYSTEMMODAL, "MODEM:", $key)         EndIf The above mentioned code is giving me the output as "COM5" like $key = COM5 and I want to get that port number 5 like in my case '5' to a variable named $port. So that I can pass that $port number to below function which will reset my UE by AT command "AT+CFUN=1,1" _CommSendStandard($port,$portError,"AT+CFUN=1,1") The thing here is when I write it as :- _CommSendStandard(5,$portError,"AT+CFUN=1,1") ; it works fine. but when I write it like below it donot work fine in run time. _CommSendStandard($port,$portError,"AT+CFUN=1,1") I want $port variable to take the $key value 5 in run time and set the $port value as 5 instead of setting it manually. I think I am unable to make understand my problem :-( Please help. Regards, SAM
  5. why there is no response from anyone...Someone please reply and help Regards, SAM
  6. Someone please reply and help me out of it. Regards, SAM
  7. Hello, I can easily find my modem comport number using the code below:- #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3>    Global $key = RegRead("HKLM\HARDWARE\DEVICEMAP\SERIALCOMM","\Device\ssudmdm0000")     Local $iError = 0     If @error Then        ; The server is probably offline/port is not opened on the server.        $iError = @error         MsgBox(BitOR($MB_SYSTEMMODAL, $MB_ICONHAND), "", "Client:" & @CRLF & "Could not connect, Error code: " & $iError)         Else         MsgBox($MB_ SYSTEMMODAL, "MODEM:", $key)         EndIf but the thing is I am planning to design a small tool by which it can read the modem COM port and set the COM number and send AT command to modem port using UDF CommMG.au3 created by Martin. I added some below code to martins file :- ;====================================================================================================================== ;CommSendStandard,a new function for sending information to a serial port. ;====================================================================================================================== Func _CommSendStandard($port,$error,$command)    _CommSetPort($port,$error,9600,8,0,1,2)  if $error <> '' Then      MsgBox(262144,'Port Error = ',$error)  EndIf  _CommSendString($command & @CR) EndFunc   ;==>_CommGetLineStates ;=============================================================================================== After adding I wrote the below code for sending AT command to modem port but its not working. Please check the below code and let me know for the issue. ;===================================================================================== #include "C:\Program Files (x86)\AutoIt3\SciTE\CommMG.au3" #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3>    Global $key = RegRead("HKLM\HARDWARE\DEVICEMAP\SERIALCOMM","\Device\ssudmdm0000")     Local $iError = 0     If @error Then        ; The server is probably offline/port is not opened on the server.        $iError = @error         MsgBox(BitOR($MB_SYSTEMMODAL, $MB_ICONHAND), "", "Client:" & @CRLF & "Could not connect, Error code: " & $iError)         Else         MsgBox($MB_SYSTEMMODAL, "MODEM:", $key)         EndIf Local $port=$key Local $porterror _CommSendStandard($port,$portError,"AT+CFUN=1,1") ;================================================================================================ but If I set the port number by my own in the code (for eg :- port number 8 or any value instead of $key) it works fine and the modem gets reset.I want to know if there is any way to get the port number to a variable $port and discarding so that my above code works fine...In that case user donot have to take care of entering the port manually everytime and the script will automatically read the port number and set itself. Please help Regards, SAM
×
×
  • Create New...