Hayes Microcomputer Products is one of the leading manufacturers of modems and has developed a language called the AT command set for controlling modems that has become the de facto standard. Any modem that recognizes Hayes modem commands is said to be Hayes-compatible. This is very useful because most communications programs use Hayes modem commands. Virtually all modems manufactured today are Hayes-compatible.
The Hayes Command Set The modem initialization string consists of a series of commands. It prepares the modem for communications, setting such features as dialing mode, waits, detection of the busy signal and many other settings. Newer modem communications programs reset the initializations string for you according to which menu options you select, which features you enable, etc. For many years Hayes modems have been the standard. As the field of modem manufactures has grown, most have adhered at least loosely to the Hayes standard. The following is a partial list of the Hayes command set. (called the AT commands). The Hayes Command Set can be divided into four groups: Basic Command Set A capital character followed by a digit. For example, M1. Extended Command Set An "&" (ampersand) and a capital character followed by a digit. This is an extension of the basic command set. For example, "&M1". Note that "M1" is different from "&M1". Proprietary Command Set Usually started by either a backslash ("\"), or a percent sign ("%"), these commands vary widely among modem manufacturers. For that reason, only a few of these commands are listed below. Register Commands Sr=n where "r" is the number of the register to be changed and "n" is the new value that is being assigned. A "register" is computerese for a specific physical location in memory. Modem have small amounts of memory onboard. This fourth set of commands is used to enter values in a particular register (memory location). The register will be storing a particular "variable" (alpha-numeric information) which is utilized by the modem and communication software. For example, S7=60 instructs your computer to "Set register #7 to the value 60." Note: Although most commands are defined by a letter-number combination (L0, L1, etc.), the use of a zero is optional. In this case, L0 is the same as a plain "L" - keep this in mind when reading the table below! Here are some of the most important characters that may appear in the modem initialization string. These characters normally should not be changed. AT tells the modem that modem commands follow. This must begin each line of commands. Z resets the modem to default state , (comma) makes your software pause for a second. You can use more than one , in a row. For example, ",,,," tells the software to pause four seconds. (The duration of the pause is governed by the setting of register S8. ^M sends the terminating Carriage Return character to the modem. This is a control code that most communication software translate as a "carriage return."
Note: A direct connection is a simple straight-though connection without any error correction or data compression. In this case, the computer-to-modem and modem-to-modem speeds must be identical. A normal connection uses flow control (either software or hardware) to buffer the data being sent or received, so that the modem can transmit data at a different rate than the computer is actually sending or receiving it. For example, a computer may send actual data at 57kbps, but using compression, the modem only actually sends 28.8kbps. This is the mode use by most modems. A reliable connection is a type of normal connection; if, for some reason, data compression or error correction cannot be established or maintained, the connection will hang up. (In essence, such a modem ensures that all connections are reliable, for it will hang up if the connection isn't.) Likewise, an auto-reliable connection is virtually the same, except that the modem will try to renegotiate the connection in order to establish a reliable connection. Again, this is the mode that most modems use.
| Command | Description |
| A0 or A |
|
| A/ |
|
B0 or B | Call Negotiation. Select V.22 connection at 1200 bps. |
| B1 | Call Negotiation. Select Bell 212A connection at 1200 bps. |
| B2 | Call Negotiation. Verbose/Quiet On Answer |
| C1 | Return OK message. |
| Dn | Dial the following number and then handshake in originate mode. Dial modifier. (These are common but most modems will have more.) P Pulse Dial T Touch Tone dial W Wait for second dial tone , Pause for time specified in register S8 (usually 2 seconds) ; Remain in command mode after dialing ! Flash switch-hook *Hand up for a half second as in transferring a call) L Dial last number |
| E0 or E | Turn off command echo. (Will not echo commands to the computer.) |
| E1 | Turn on command echo. (Will echo commands to the computer so one can see what one types) |
| F0 |
|
| F1 | Select V.21 or Bell 103. (RC144) |
| F2 | Reserved. (RC144) |
| F3 | Select V.23 line modulation. (RC144) |
| F4 | Select V.22 or Bell 212A 1200 bps line speed. (RC144) |
| F5 | Select V.22 bis line modulation. (RC144) |
| F6 | Select V.32 bis or V.32 4800 line modulation. (RC144) |
| F7 | Select V.32 bis 7200 line modulation. (RC144) |
| F8 | Select V.32 bis or V.32 9600 line modulation. (RC144) |
| F9 | Select V.32 bis 12000 line modulation. (RC144) |
| F10 | Select V.32 bis 14400 line modulation. (RC144) |
| H0 or H | Hook status. Initiate a hang-up sequence. |
| H1 | Hook status. If on-hook, go off-hook and enter command mode. |
| I0 or I |
|
| I1 | Report pre-computed checksum. |
| I2 | Report OK. |
| I3 | Report firmware revision, model, and interface type. |
| I4 | Report response programmed by an OEM. |
| I5 | Report the country code parameter. |
| I6 | Report modem data pump model and code revision. |
| I7 | Reports the DAA code (W-class models only). |
| L0 or L | Speaker Loudness. Modems with volume control knobs will not have these options. Set to off or low speaker volume. |
| L1 | Speaker Loudness. Modems with volume control knobs will not have these options. Set low speaker volume. |
| L2 | Speaker Loudness. Modems with volume control knobs will not have these options. Set medium speaker volume. |
| L3 | Speaker Loudness. Modems with volume control knobs will not have these options. Set high speaker volume. |
| M0 or M | Turn speaker off. |
| M1 | Turn speaker on during handshaking and turn speaker off while receiving carrier. |
| M2 | Turn speaker on during handshaking and while receiving carrier. |
| M3 | Turn speaker off during dialing and receiving carrier and turn speaker on during answering. |
| N0 or N |
|
| N1 | Haneshake speed. Turn on automode detection. Handshake at highest speed larger than S37 |
| O0 or O | Go on-line. (see also X1 as dial tone detection may be active) |
| O1 | Go on-line and initiate a retrain sequence. (Return Online after an equalizer retrain sequence) |
| P | Force pulse dialing. |
| Q0 or Q | Quiet mode. Allow result codes to DTE. (Off - Displays result codes, user sees command responses; e.g. OK) |
| Q1 | Quiet mode. Inhibit result codes to DTE. (On - Result codes are suppressed, user does not see responses> |
| Sn | Select S-Register as default. |
| Sn? | Return the value of S-Register n. |
| Sn=r | Store. Store the value r in S-register n. |
| =v | Set default S-Register to value v. |
| ? | Return the value of default S-Register. |
| T | Force DTMF dialing. |
| V0 or V | Verbal? Numberic result codes. Report short form (terse) result codes. |
| V1 | Verbal? English result codes (e.g. CONNECT, BUSY, NO CARRIER etc.) Report long form (verbose) result codes. |
| W0 | Report DTE speed in EC mode. |
| W1 | Report line speed, EC protocol and DTE speed. |
| W2 | Report DCE speed in EC mode. |
| X0 or X |
|
| X1 | Smart modem. Usually adds connection speed to basic result codes. Report basic call progress result codes and connections speeds (OK, CONNECT, RING, NO CARRIER (also, for busy, if enabled, and dial tone not detected), NO ANSWER, CONNECT XXXX, and ERROR. |
| X2 | Smart modem. Usually adds dial tone detection (preventing blind dial and sometimes ATO). Report basic call progress result codes and connections speeds, i.e., OK, CONNECT, RING, NO CARRIER (also, for busy, if enabled, and dial tone not detected), NO ANSWER, CONNECT XXXX, and ERROR. |
| X3 | Smart modem. Usually adds busy signal detection. Report basic call progress result codes and connection rate, i.e., OK, CONNECT, RING, NO CARRIER, NO ANSWER, CONNECT XXXX, BUSY, and ERROR. |
| X4 | Smart modem. Usually adds both busy signal and dial tone detection. Report all call progress result codes and connection rate, i.e., OK, CONNECT, RING, NO CARRIER, NO ANSWER, CONNECT XXXX, BUSY, NO DIAL TONE and ERROR. |
| Y0 | Disable long space disconnect before on-hook. |
| Y1 | Enable long space disconnect before on-hook. |
| Z0 or Z | Reset. Reset modem to stored configuration (Z0, Z1 etc. for multiple profiles). (Same as &F (factory default) on modems without NVRAM (non volatile memory). Restore stored profile 0 after warm reset. |
| Z1 | Restore stored profile 1 after warm reset. |
| Command | Description |
| &B0 or &B |
|
| &B1 |
|
| &B2 |
|
| &C0 or &C |
|
| &C1 | Carrier detect. Indicates remote carrier (usual preferred default) Allow RLSD to follow the carrier state. |
| &D0 or &D | Interpret Data Terminal Ready (DTR) ON-to-OFF transition per &Qn: &Q0, &Q5, &Q6 The modem ignores DTR. &Q1, &Q4 The modem hangs up. &Q2, &Q3 The modem hangs up. |
| &D1 | Interpret Data Terminal Ready (DTR) ON-to-OFF transition per &Qn: &Q0, &Q1, &Q4, &Q5, &Q6 Asynchronous escape. &Q2, &Q3 The modem hangs up. |
| &D2 | Interpret Data Terminal Ready (DTR) ON-to-OFF transition per &Qn: &Q0 through &Q6 The modem hangs up. |
| &D3 | Interpret Data Terminal Ready (DTR) ON-to-OFF transition per &Qn:. &Q0, &Q1, &Q4, &Q5, &Q6 The modem performs soft reset. &Q2, &Q3 The modem hangs up. |
| &F0 or &F | Restore factory configuration 0. |
| &F1 | Restore factory configuration 1. |
| &G0 or &G | Disable guard tone. |
| &G1 | Disable guard tone. |
| &G2 | Enable 1800 Hz guard tone. |
| &J0 | Set S-Register response only for compatibility. |
| &J1 | Set S-Register response only for compatibility. |
| &K0 or &K |
|
| &K3 | Enable RTS/CTS DTE/DCE flow control. |
| &K4 | Enable XON/XOFF DTE/DCE flow control. |
| &K5 | Enable transparent XON/XOFF flow control. |
| &K6 | Enable both RTS/CTS and XON/XOFF flow control. |
| &L0 or &L | Select dial up line operation. * Serial interface operation only. |
| &M0 or &M | Select direct asynchronous mode. (error control mode) |
| &M1 | Select sync connect with async off-line command mode. * |
| &M2 | Select sync connect with async off-line command mode and enable DTR dialing of directory zero. * |
| &M3 | Select sync connect with async off-line command mode and enable DTR to act as Talk/Data switch. * |
| &P0 or &P | Set 10 pps pulse dial with 39%/61% make/break. |
| &P1 | Set 10 pps pulse dial with 33%/67% make/break. |
| &P2 | Set 20 pps pulse dial with 39%/61% make/break. |
| &P3 | Set 20 pps pulse dial with 33%/67% make/break. |
| &Q0 or &Q | Select direct asynchronous mode. |
| &Q1 | Select sync connect with async off-line command mode. * |
| &Q2 | Select sync connect with async off-line command mode and enable DTR dialing of directory zero. * |
| &Q3 | Select sync connect with async off-line command mode and enable DTR to act as Talk/Data switch. * |
| &Q4 | Select Hayes AutoSync mode. |
| &Q5 | Modem negotiates an error corrected link. |
| &Q6 | Select asynchronous operation in normal mode. |
| &R0 or &R |
|
| &R1 | CTS is always active. |
| &S0 or &S |
|
| &S1 | DSR acts per V.25.(Follows EIA specification. Active following carrier tone, and until carrier is lost.) |
| &T0 or &T | Self test. Terminate any test in progress. |
| &T1 |
|
| &T2 | Returns ERROR result code. |
| &T3 | Initiate local digital loopback. |
| &T4 |
|
| &T5 | Disallow remote digital loopback request. |
| &T6 | Request an RDL without self-test. |
| &T7 |
|
| &T8 | Initiate local analog loop with self-test. |
| &U0 or &U | Trellis code modulation. Enable V.32 TCM |
| &U1 | Trellis code modulation. Disable V.32 TCM. |
| &V0 or &V | Display current configurations. |
| &V1 | Diagnostics: RBS Counter shows number of least significan bits robbed per three bytes. Digital pad detection determines if a digital pad was encountered and if so, what was the digital loss. |
| &W0 or &W |
|
| &W1 | Store the active profile in NVRAM profile 1. |
| &X0 | Select internal timing for the transmit clock. |
| &X1 | Select external timing for the transmit clock. |
| &X2 |
|
| &Y0 | Recall stored profile 0 upon power up. |
| &Y1 | Recall stored profile 1 upon power up. |
| &Zn=x | Store dial string x (to 34) to location n (0 to 3). |
| Command | Description |
| %C0 or %C |
|
| %C1 |
|
| %C2 |
|
| %C3 |
|
| %D0 or %D |
|
| %D1 |
|
| %D2 |
|
| %D3 |
|
| %E0 or %E |
|
| %E1 | Escape method. Enable line quality monitor and auto retrain. |
| %E2 | Escape method. Enable line quality monitor and fallback/fall forward. |
| %E3 | Escape method. BOTH methods enabled. |
| %E4 | Escape method. Disable "OK" to +++ |
| %E5 | Escape method. Enable "OK" to +++ |
| %G0 | Request a rate renegotiation. |
| %G1 | Do not request a rate renegotiation. |
| %G1 | Monitor line quality and automatically request a rate renegotiation if line conditions are bad (default). |
| %L | Return received line signal level. |
| %Q | Report the line signal quality. |
| %Un |
|
| Command | Description |
| \J0 of \J |
|
| \J1 |
|
| \Kn |
|
When modem receives a break from the DTE: |
|
| \K0,2,4 |
|
| \K1 | Clear buffers and send break to remote modem. |
| \K3 | Send break to remote modem immediately. |
| \K5 | Send break to remote modem in sequence with transmitted data. |
When modem receives \B in on-line command state: |
|
| \K0,1 |
|
| \K2,3 | Send break to remote modem immediately. |
| \K4,5 | Send break to remote modem in sequence with transmitted data. |
|
When modem receives break from the remote modem: |
|
| \K0,1 |
|
| \K2,3 | Send a break immediately to DTE. |
| \K4,5 | Send a break with received data to the DTE. |
| \N0 or \N |
|
| \N1 | Connection type. Select direct mode. |
| \N2 | Connection type. Select reliable link mode. |
| \N3 | Connection type. Select auto reliable mode. |
| \N4 | Connection type. V.42 bis reliable link with phase detection. Force LAPM mode. |
| \N5 |
|
| \N6 |
|
| \N7 |
|
| \V0 | Connect messages are controlled by the command settings X, W, and S95. |
| \V1 | Connect messages are displayed in the single line format. |
| Command | Description |
| +FCLASS=n |
|
| +FAE=n | Data/fax auto answer |
| +FRH=n | Receive data with HDLC framing. |
| +FRM=n | Receive data. |
| +FRS=n | Receive silence. |
| +FTH=n | Transmit data with HDLC framing. |
| +FTM=n | Transmit data. |
| +FTS=n | Stop transmission and wait. |
| Register | Range | Default | Function |
| S0 | 0-255 rings | 1-2 | Answer on rink number Don't answer if 0 |
| S1 | 0-255 rings | 0 | If S0>0 this register counts incoming rings |
| S2 | 0-127 ASCII | 43+ | Escape to command mode character |
| S2 | >127 | no ESC | |
| S3 | 0-127 ASCII | 13 CR | Carriage return character |
| S4 | 0-127 ASCII | 10 LF | Line feed character |
| S5 | 0-32, 127 ASCII | 8 BS | Backspace character |
| S6 | 2-255 seconds | 2 | Dial tone wait time (blind dialing, see Xn) |
| S7 | 1-255 seconds | 30-60 | Wait time for remote carrier |
| S8 | 0-255 seconds | 2 | Comma pause time used in dialing |
| S9 | 1-255 1/10 sec. | 6 | Carrier detect time required for recognition |
| S10 | 1-255 1/10 sec. | 7-14 | Time between loss of carrier and hangup |
| S11 | 50-255 millisec. | 70-95 | Duration and spacing of tones when tone dialing |
| S12 | 0-255 1/50 sec. | 50 | Guard time for pause around +++ command sequence |
| S36 |
Fallback options when error correction link fails: 0 - Disconnect 1 - Establish Direct connection 3 - Establish Normal connection 4 - Establish a MNP connection if possible, else Disconnect 5 - Establish a MNP connection if possible, else Direct connection 7 - Establish a MNP connection if possible, else Normal connection |
7 | Negotiation Failure Treatment |
| S37 |
1 = 300 bps 5 = 1200 pbs 6 = 2400 pbs 7 = 1200/75 pbs (v.23 mode) 8 = 4800 bps 9 = 9600 bps 10 = 12000 bps 11 - 14400 bps 12 = 7200 bps |
0 | Negotiation Speed (Initial handshake) |
Many modems have dozens, even hundreds, of S registers, but only the first dozen or so are fairly standard. They are changed with a command like ATSn=N, and examined with ATSn? (e.g. "ATS10=70 S1?" would tell the modem not to hang up for seven seconds should it not hear the answering modem, and return the number of times the phone last rang.).