Results 1 to 2 of 2

Thread: [RESOLVED] problem sending at command

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Location
    Botswana
    Posts
    107

    Resolved [RESOLVED] problem sending at command

    hey eveyone. im trying to query a usb modem (which i believe is treated like a serial connection). bellow is my code but its not returning any strings. can anyone take a look at it?

    Public Function getmyModemModel()
    Dim RN As String
    Dim Port As SerialPort = _
    New SerialPort("Com6", 9600, IO.Ports.Parity.None, 8)
    Port.Open()
    Port.Write(("AT+GMM" & vbCrLf))
    System.Threading.Thread.Sleep(4000)

    Dim returnStr As String = ""

    Dim Incoming As String = Port.ReadLine.ToString

    returnStr = Incoming

    MsgBox(Incoming)

    Port.Close()

    Return RN

    End Function

    i get no errors. the msgbox just pops empty.

  2. #2
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: problem sending at command

    turn dtr on then open SerialPort1.DtrEnable = True

    use vbCr - a lot of modems don't like Lf

    Dim Incoming As String = Port.ReadExisting() 'and they don't always reply with crlf
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

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