Controlling your Modem with AT Commands
Issuing AT Commands
Getting Started with the Terminal Mode
With your modem installed, your computer powered ON, and your computer's communications software loaded in its terminal mode, you can enter commands to the modem.
Sample Hyper Terminal Mode display
If available in your communication's software, select the "terminal mode" (sometimes referred to as, "terminal emulation mode", "dumb terminal mode", "local mode", or "direct connect mode"). This mode allows you to send commands directly to the modem. Some software packages start immediately in the terminal mode as soon as you load the program.
Using AT Commands
When issued to the fax modem, AT commands direct the fax modem to dial, answer, hang up, and to perform many other communication tasks. Some of the most commonly used commands are:
AT (Attention). This is the command line prefix. (All the commands listed , except A/ and +++, must be preceded by the command AT). A Answer an incoming call D Dial the following phone number E Turn echo OFF H Hang up O Return to on-line state Z Reset the modem to the values stored in the N.V. Ram +++ Return to the Command State A/ Repeat last command (Do not precede this command with AT or follow it with <Enter>)
The Command Line
A Command line allows you to issue a number of commands at one time rather than issuing and waiting for the modem to react to each command separately. Here are a few rules you must follow when issuing a command line to the modem.
ATDT8005551234 < Enter > or
atdt (800) 876-5555 < Enter >
If you want to repeat the last command line you entered, type the following command:
A/ (upper or lowercase A, followed by a slash)
When a command is issued, the screen will usually respond with a message. This message is called a "Result Code". It tells you the result of the command you've executed; whether the command has been executed, whether you have connected to another modem, whether the modem received a busy signal, and so forth.
Result codes can be displayed by either a number representing a result code or by verbal responses for a more descriptive code. Your modem has been defaulted to show the verbal response codes. However, you can alter the result code responses in the following ways:
The Terminal mode allows you to instruct the modem to dial a remote modem by issuing the D command followed by the phone number. You can also include dial string modifiers in your command line to give the modem additional instructions. The following dial modifiers are available on most modems:
To command the modem to dial a remote modem from an ordinary tone dialing telephone line, enter the dialing command followed by the phone number. For example, type the following command:
ATDT 876-5555 < Enter >
If the call is answered, you should see the message, "CONNECT", followed by the connection speed. If the other phone line is busy, you will see "NO CARRIER" or "Busy" displayed (this is dependent upon the current X setting). If the other modem does not answer, you will see the message,"NO CARRIER".
After a connection has been established, with one of the "CONNECT" messages displayed, the modem is ready to immediately begin transmitting and receiving data. This may vary from typing messages to each other, sending or receiving files, logging on to an information service, or any other data communication task you wish to perform.
Manual Dialing Commands
If both your modem and the remote modem that you are connecting with have phones connected through the phone jacks on the modem, this mode will allow you to toggle between a voice connection and a data connection. This feature is invaluable if your trying to make adjustments to optimize your communications with the remote modem. After discussing what changes you want to make you can then release the line to the modem and switch back again if you need to discuss the further modifications.
Switching Between Voice and Data
To switch from a voice connection to a data connection, both you and the other party must have a computer with a modem. Communication software must be loaded and in the terminal mode (this may be referred as, "Dumb Terminal", "Terminal Emulation Mode", "Local Mode", "Direct Connect Mode", "On-line Manual" or something similar). Check your software communication manual if you can't locate this mode.
Switching From Voice to Data
You can make the initial call either by dialing your telephone manually or by letting the modem dial for you. When you have completed your voice conversation and want to switch to a data connection, type the following command:
Both parties should now hang up their telephone handsets. If you don't hang up, data errors may occur. You will now hear the modems handshake and see the result code CONNECT along with the connection speed.
Switching From Data to Voice
To switch from a data connection to a voice connection, both parties would pick up their handsets, and either use the hang-up command of the software you are using or issue the Escape sequence command (+++) followed by the ATH command as soon as the modem responds OK to the Escape command. You should now hear the other party in your telephone handset.
Using the Modem to Establish a Voice Call
To use the modem as an auto-dialer you can either use software designed for this purpose or use regular communication software with a few modifications.
Add a record to the communication software you are using. In the phone number field, enter the voice telephone number followed by a semi- colon (;) and an H. The semicolon instructs the modem to return to the command mode after dialing the number. The H command then instructs the modem to hang-up releasing the line to your telephone.
Before selecting the record to dial, pick up the telephone handset (connected to the Phone Jack of the modem). You should hear the dial tone in the handset. Select the record to dial. You should now no longer hear the dial tone in the handset. After the modem dials the number, the modem will be returned to the command mode and then hung up. You should be able to hear the phone ringing in your handset.
If you are using a communications program, use the "hang up" or "disconnect" command in the program to disconnect the call.
A method used with computers in the “dumb terminal mode” is to return to the Command State by typing an escape sequence. Typing three plus signs is the standard escape sequence,
When you dial from a business phone, you typically must instruct the modem to dial a number for an outside line, to wait for a dial tone, and then to dial the telephone number of the remote modem. A typical command line might look like this:
By default, the comma causes a two-second pause. However, you can create a longer or shorter pause by changing the value for register S8.
You can also create a longer pause by including several commas in a row in the command line. If there is no dial tone by the time the pause ends, the modem will go ahead and dial the number anyway, but the connection will not succeed.
A better way to dial would be to insert a W in the command line to instruct the modem to wait until it hears the dial tone (for a specific maximum amount of time). The command line would look like this:
Occasionally you may want the modem to dial a number and then to return to Command State to send additional commands before establishing a data connection. You will find this feature useful when dialing an electronic service such as telephone banking. You can dial the number of the bank, then after the call is answered, you can enter your access code.
To cause the modem to return to Command State after dialing, include a ; (semicolon) at the end of the command line.
For example, to dial a bank for electronic banking, you might type the following command:
Transferring a Call with a Hookflash
The ! can be used in a dialing command to create a “hookflash”. During the hookflash, the modem hangs up for 1/2 second and then reconnects.
The following command line could be used to transfer a call to extension 333:
Waiting for Silence
Some services may answer your modems call with a prerecorded message of their own. In this case you would have to instruct the modem to wait until the message was over before proceeding with the data connection. You can do this with the @ dial modifier.
To instruct the modem to dial a number, listen for ringing, and then wait for up to fifty seconds for a 5 second silence (you can change the wait time with register S7) before proceeding you could use the following command line:
Dialing a Stored Phone Number
Your modem can dial one of up to four previously stored telephone numbers (identified as 0-3) of up to 33 digits each. This feature is useful for connecting to a frequently called remote modem without your having to dial the digits individually.
You can store the phone number in the nonvolatile RAM with the &Zn=x command. The n refers to which of the four (0-3) memory locations you want, and the x is the phone number. To store the phone number 876-5555 as the 3rd stored number, type the following command:
To dial a previously stored phone number you would use the s=n dial string modifier, (n refers to which of the four stored phone numbers you wish to have dialed). To dial stored phone number 3, you would type the following command:
Do not confuse the s = n dial string modifier with the S command used to read or change the value of S-Registers.
Answering a Call
When the modem is in the data mode, Auto-Answer will answer an incoming call provided the computer is on and your software is properly loaded.
When the modem answers the call, it sends a high-pitched carrier tone to the modem on the other end, which begins the handshaking process.
After handshaking, you will see one of the CONNECT result code messages on your screen, and the data connection will begin.
Selecting the Number of Rings
Register S0 allows you to select the number of rings after which the modem will Auto-Answer. For example, to instruct the modem to answer after four rings, type the following command:
If you want to disable the Auto-Answer feature (perhaps you will be away from your phone for a while), you can do so by setting register S0 to 0.) If you are using communications software, and it is programmed to Auto-Answer, it will do so regardless of the modems settings.
You can use your modem, your computer and communications software to transmit (upload) and receive (download) files. These processes are handled through your communications software. See your communications software manual for more information.
Issuing Commands During the Data Connection
The modem has two operational states: Command State and Data State. When you first turn your terminal ON, or load your computer's communications software, and start giving commands to the modem, the modem is in Command State. However, once you make a connection with another modem and start passing information over the telephone lines, you are in the Data State and can no longer issue AT modem commands.
If your connection with the other computer is broken for any reason, you will automatically return to Command State so that you can issue new commands. However, you may want to return to Command State temporarily without losing your data connection (e.g. to change a communications parameter). The modem provides a special Escape Code that lets you do this.
Using the Escape Code
To return to Command State during a data connection, wait for one second of inactivity, and then quickly type three pluses (+++).
After one second of inactivity, you will see OK on the screen. You have returned to the Command State and can issue commands, but you have not lost your data connection.
Resuming the Data Connection
When you are in the Command State and want to resume the data connection, type the following command:
Setting Communications Parameters
Whenever you communicate via modem you use certain settings that establish agreements between the two modems. These settings are called communication parameters and cover such items as baud rate, parity, character length, and the number of stop bits.
When you are using a computer, communication parameters are set and changed by your communication software. In order to establish a data connection, your communication parameters must match those of the remote modem.
You may find that you can communicate perfectly without changing your software settings. This can be because your terminal or computer software program uses common default settings which may be the same as those of the remote modem. However, if you experience difficulty, you may have to change your communication parameters. The most common setting are either are 7 data bits, Even parity, and 1 stop bit (7E1) or 8 data bits, No parity, and 1 stop bit (8N1).
The Factory Profile
The factory profile is permanently stored in your modem. It cannot be changed like the stored profiles can. The factory settings may not be what the software expects, but this is a good starting point for all Initialization strings. This will ensure that the modem is set correctly without sending every command that the modem supports.
You can always return to these factory settings by issuing the following command:
The active profile contains the settings currently in effect. When you turn your modem on, or reset it, the modem reads its nonvolatile ram, if nonvolatile ram is supported in your model, and makes the active profile the same as one off the stored profiles. Normally, this will be stored profile #0, but exactly which stored profile is used is determined by the &Yn command. If nonvolatile ram is not supported by your model the active profile will be the same as the Factory Profile.
When you choose to store an active profile into the modems nonvolatile memory, the chosen stored profile is made the same as the current active profile.
The Stored Profile(s)
Two stored profiles are stored in the modems nonvolatile memory. When you turn your computer and modem off, or reset the modem, you do not change or lose either stored profile. When you turn your modem on, or reset it with the Zn command, the modem reads its nonvolatile memory, and makes the active profile the same as one of the stored profiles.
The stored profile used when you turn on the modem is determined by the &Yn command. &Y or &Y0 (the factory default setting) cause stored profile #0 to be used when the modem is turned on. &Y1 causes stored profile #1 to be used when the modem is turned on.
If you want to change one of the stored profiles to match the current active profile, you would use one of the following commands:
You may wonder "What's in my two stored
profiles?" or "Just what is my active profile?". The &V command provides
you with a "view" of your profiles. You must be in the "Terminal Mode"
to be able to send the &V command to your modem. The &V command
causes your modem to display a list of AT commands and S-Register settings
currently in effect (Active Profile) and both stored profiles. Some models
may also have a &V1 and &V2 command that will display other useful