What is AT commands.How can we use it in VB.

Posted on 2004-08-18
Medium Priority
Last Modified: 2013-12-27
What is AT commands.How can we use it in VB.Can anybody send list of it and a brief coding in VB to know its implementation.
Question by:jijojac
  • 3
  • 2

Accepted Solution

msjammu earned 240 total points
ID: 11952878
The AT prefix (also known as the Attention Code), signals the modem that one or more commands are to follow. These commands are industry standard language used to communicate with the modem. Your modem is always either in the command mode, or the on-line mode. The modem starts up in command mode when it is first switched on. Commands are only accepted by the modem when it is in command mode. Commands input when the modem is on-line, are treated as data, not as commands. Commands may be entered from the terminal mode of most communications software packages.

Settings made via AT commands are automatically reused by the modem until another command is received to change them, or the modem is turned off.

More Information on this page
VB Example
this may help

See this in VC
See one program's Code

Public Function sendText(message As String, dest As String, SMSC As String) As Boolean

'Reset modema
MSComm1.CommPort = 1
MSComm1.PortOpen = True

MSComm1.Output = "ATZ" & vbCr
MsgBox ""
StatusBar1.SimpleText = "GSM modem reset successful"

'SMSC number
MSComm1.Output = "AT+CSCA=" & Chr(34) & "+" & SMSC & Chr(34) & vbCr

MsgBox ""
StatusBar1.SimpleText = "SMSC number entered"

' Send the message format (text or PDU) command to the modem.
MSComm1.Output = "AT+CMGF=1" & vbCr
MsgBox ""
StatusBar1.SimpleText = "Text mode selected"
' Send the unknown command to the modem.
'MSComm1.Output = "AT+CSCS=" & Chr$(34) & "PCCP1252" & Chr$(34) & vbCr
MsgBox ""

' Send the text mode parameters command to the modem.
MSComm1.Output = "AT+CSMP=17,167,0,0" & Chr$(13)
MsgBox ""
'StatusBar1.SimpleText = "Parameters entered"
' Send the message reference command to the modem.
MSComm1.Output = "AT+CMGS=" & Chr(34) & "+" & dest & Chr(34) & Chr$(13) ' Ensure that
StatusBar1.SimpleText = "Destination number entered"
'Send message
MSComm1.Output = message & Chr(26)
MsgBox ""
StatusBar1.SimpleText = "Message body entered"
sendText = True
StatusBar1.SimpleText = "Text message sent to number : " & "Manpreet"
End Function

Private Sub Command1_Click()
sendText "Hello", "919872442300", ""
MSComm1.PortOpen = False

End Sub

Private Sub Form_Load()

End Sub


Author Comment

ID: 11962731
Thanks msjammu

I tried the code. Can we use this commands with internal PC modems. When i tried it was not working or i didn't get any response from the modem

Expert Comment

ID: 11962763
I haven't got a chance to test it with Internal PC Modem but It should work with any GSM modem


Author Comment

ID: 11963907
I got some other codes which can dial to a mobile from Internal Modem. U are correct i think we can use AT commands for sending messages only in GSM modems. But if u know anything about if it is possible from PC modem please tell me. Thanks    

If MSComm1.PortOpen = True Then
      MSComm1.PortOpen = False
   End If
   MSComm1.CommPort = 3
   MSComm1.InputLen = 0
   MSComm1.Settings = "9600,N,8,1"
   MSComm1.PortOpen = True
   MSComm1.Output = "ATV1Q0" & vbCr
   MSComm1.InBufferCount = 0
   ' Mobile No.
   MSComm1.Output = "ATDT 91941234567;" & vbCr
   MsgBox "Dialing.."
   MSComm1.Output = "ATH" + vbCr
   MSComm1.PortOpen = False

Expert Comment

ID: 11970323
jijojac :

>>>I think we can use AT commands for sending messages only in GSM modems.

At Command can be used with any modem; PC Modem Also


Featured Post

Who's Defending Your Organization from Threats?

Protecting against advanced threats requires an IT dream team – a well-oiled machine of people and solutions working together to defend your organization. Download our resource kit today to learn more about the tools you need to build you IT Dream Team!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hopefully this article will help someone who's had the same issues I had. I have a Dell Wireless 1390 WLAN Mini-Card and Windows 7, and for the past couple of days I was beyond frustrated because my wireless laptop was not able to access the Inte…
Working settings for French ISP Orange "Prêt à Surfer" SIM cards for data connections only. Can't be found anywhere else !
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Suggested Courses

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question