Results 1 to 5 of 5

Thread: How do I know an AT Commands Executed

  1. #1

    Thread Starter
    Hyperactive Member rplcmint's Avatar
    Join Date
    Jan 2001
    Location
    Stockton, CA
    Posts
    333

    How do I know an AT Commands Executed

    Hello,

    I'm having a problem issueing a simple AT command to a modem.

    I'm using a MsComm control to open the modem port, so it will look like this:

    With MsComm1
    .portopen = true

    .output "ATZ" 'Which should reset the modem quickly.

    .portopen = false 'Drop the connection
    end with

    When I go check for the connection on Hyperlink..the modem did not receive my command.

    Am I suppose to wait for an event to tell me that my command was successful? How do I do that.


    I was also thinking that I am issueing the command wrong (probably should write it like this

    MsComm1.output "ATZ" & vbCrLf


    I need help cause this project is important.

    I appreciate your input.

    Last edited by rplcmint; Nov 1st, 2001 at 07:22 PM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Check MSDN and see what you can find (http://msdn.microsoft.com/ )

  3. #3

    Thread Starter
    Hyperactive Member rplcmint's Avatar
    Join Date
    Jan 2001
    Location
    Stockton, CA
    Posts
    333
    I got it right....!!!!

    I wrote:

    .
    .

    MsComm1.Output = "ATZ" & vbCrLf 'Send a command to the port.

    dim sTemp, b as string
    sTemp = ""
    Do until Instr(sTemp, "OK") > 0 or Instr(sTemp, "ERROR") > 0
    b = MsComm1.Input
    sTemp = sTemp & b 'Create a string to parse through.
    Loop

    .
    .

    The modem responds best when you pass the AT command along with a Carriage return line feed command.
    Then you want to stay inside a loop while capturing the Input buffer and parsing through it for response..(I looked for an OK or ERROR. You can look for other responses). You can then write the rest of your code depending on the response (if error..do this, if Ok..do this, etc.)

    This was a lot easier than I thought!

    Thanks for the help.
    Last edited by rplcmint; Nov 2nd, 2001 at 01:23 PM.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Glad you got it worked out, and I'll file this away for future reference.

  5. #5
    Lively Member
    Join Date
    Oct 2000
    Location
    Singapore
    Posts
    98
    May i ask if a vb program can reset a modem when the modem is already being used by another program.

    If not, is there a way to bypass it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width