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

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.
jijojacAsked:
Who is Participating?
 
msjammuCommented:
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.

http://www.modem.com/general/extendat.html
More Information on this page
------------------------------------------------------------------------------------------------------
VB Example
this may help
http://www.activexperts.com/activsms/

See this in VC
http://www.experts-exchange.com/Programming/Wireless_Programming/GSM/Q_20921720.html
---------------------------------------
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
'WaitPrompt
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


Regards,
msjammu
0
 
jijojacAuthor Commented:
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
0
 
msjammuCommented:
I haven't got a chance to test it with Internal PC Modem but It should work with any GSM modem

Regards,
0
 
jijojacAuthor Commented:
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
0
 
msjammuCommented:
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

Regards,
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.