|
-
Aug 1st, 2008, 01:14 AM
#1
Thread Starter
Lively Member
[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.
-
Aug 1st, 2008, 08:12 AM
#2
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|