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

Posted on 2004-08-18
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 60 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

With the purchase of CloudCommand by Comcast customers are left in a bind as subscriptions expire and render the AP's disabled. The following will explain how to flash your Ubiquiti AP's with CloudCommand firmware back to Ubiquiti firmware. HOWTO…
Today sees the launch of a new case study, focusing on BYOD technologies we have been working with for some time now.  But with the advent of 802.11ac wireless technologies and the story behind our landmark developments, we would like to share this …
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now