The Hayes Modem Command SetHere is a description of the Hayes Command Set. Most modems follow this
command set to large extent. If you lost your modem manual or never had one in
the first place, this reference might come in handy. I for instance finally found
out how to turn my modems speaker off: ATM0 -- Finally:
Silence!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 SetA capital character followed by a digit. For example,
M1.Extended Command SetAn & (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 SetUsually 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 CommandsSr=n
where r is the number of the register to be changed,
and n is the new value that is
assigned.A register is computerese for a specific physical location
in memory. Modems 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.Although most commands are defined by a letter-number combination
(L0, L1 &etc;), the user of a zero is
optional. In this example, 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.ATTells the modem that modem commands follow. This must begin
each line of commands.ZResets the modem to it's default state, (a 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.^MSends the terminating Carriage Return character to the modem.
This is a control code that most communication software translates as
Carriage ReturnThe Basic Hayes Command SetIn alphabetical order:
Basic Hayes Command SetCommandDescriptionCommentsA0 or AAnswer incoming callA/Repeat last commandDon't preface with AT. Enter usually
aborts.B0 or BCall negotiationV32 Mode/CCITT Answer Seq.B1Call negotiationBell 212A Answer Seq.B2Call negotiationVerbose/Quiet On AnswerDDialDial the following number and then handshake in originate
mode.PPulse DialTTouch Tone DialWWait for the second dial tone,Pause for the time specified in register
S8 (usually 2 seconds;Remain in command mode after dialing.!Flash switch-hook (Hang up for a half second, as in
transferring a call.LDial last numberE0 or ENo EchoWill not echo commands to the computerE1EchoWill echo commands to the computer (so one can see what one
types)H0Hook StatusOn hook - Hang upH1Hook statusOff hook - phone picked upI0 or IInquiry, Information, or InterrogationThis command is very model specific. I0
usually returns a number or code, while higher numbers often provide much
more useful information.L0 or LSpeaker Loudness. Modems with volume control knobs will not have
these options.Off or low volumeL1Low VolumeL2Medium VolumeL3Loud or High VolumeM0 or MSpeaker offM3 is also common, but different on many
brandsM1Speaker on until remote carrier detected (&ie; until the other
modem is heard)M2Speaker is always on (data sounds are heard after CONNECT)N0 or NHandshake SpeedHandshake only at speed in S37N1Handshake at highest speed larger than S37O0 or OReturn OnlineSee also X1 as dial tone
detection may be active.O1Return Online after an equalizer retrain sequenceQ0 or Q1Quiet ModeOff - Displays result codes, user sees command responses (⪚
OK)Q1Quiet ModeOn - Result codes are suppressed, user does not see
responses.Sn?Query the contents of S-register
nSn=rStoreStore the value of r in S-register
nV0 or VVerboseNumeric result codesV1English result codes (⪚
CONNECT,
BUSY, NO
CARRIER &etc;)X0 or XSmartmodemHayes Smartmodem 300 compatible result codesX1Usually adds connection speed to basic result codes (⪚
CONNECT 1200X2Usually adds dial tone detection (preventing blind dial, and
sometimes preventing AT0)X3Usually adds busy signal detectionX4Usually adds both busy signal and dial tone detectionZ0 or ZResetReset modem to stored configuration. Use Z0,
Z1 &etc; for multiple profiles. This is the same as
&F for factory default on modems without
NVRAM (non voltaile memory)
The Extended Hayes Command SetAmpersand Commands
The Extended Hayes Command SetCommandDescriptionComments&B0 or &BRetrain ParametersDisable auto retrain function&B1Retrain ParametersEnable auto retrain function&B2Retrain ParametersEnable auto retrain, but disconnect if no line improvement over
the period dictated by S7&C0 or &C1Carrier detectSignal always on&C1Carrier detectIndicates remote carrier (usual preferred default)&D0 or &DData Terminal Ready (DTRSignal ignored (This is modem specific, you must see your manual
for information on this one!)&D1Data Terminal Ready (DTRIf DTR goes from On to Off the modem goes into
command mode (Some modems only)&D2Data Terminal Ready (DTRSome modems hang up on DTR On to Off transition
(This is the usual preferred default)&D3Data Terminal Ready (DTRHang up, reset the modem, and return to command mode upon
DTR&F0 or &FFactory defaultsGeneric Hayes-compatible defaults. This is
usually a good thing to use in your init string, since the
&F1-&F3 settings can vary
among modems, and they may actually be the cause of connection
problems. (Since you never know exactly what Brand X's
&F2 really changes.On the other hand,
it pays to try out the other options below; many people's problems can be
solved by replacing a complicated init string with a simple
&F2 or the like. However, if you're building an
init string, it's best to start with a simple &F,
and not use the customized form of
defaults.&F1Factory DefaultsFactory Defaults tailored to an IBM PC
compatible user&F2Factory DefaultsFactory defaults for a Mac w/software handshaking&F3Factory DefaultsFactory defaults for a Mac w/hardware handshaking&G0 or &GGuard tonesDisable guard tones&K0 or &KLocal flow controlDisable local flow control&K1Local flow controlEnable RTS/CTS hardware local flow control&K2Local flow controlEnable XON/XOFF software local flow control&K3Local flow controlEnable RTS/CTS hardware local flow control&K4Local flow controlEnable XON/XOFF software local flow control&L0 or &LDial modeSelect dial-up mode&M0 or &MError control modeSelect asynchronous non-EC mode (the same as
&Q0)&P0 or &PPulse dialing ratioU.S./Canada pulse dialing 39% make / 61% break ratio&P1Pulse dialing ratioU.K./Hong Kong pulse dialing 33% make / 67% break ratio&Q0 or &QError control modeAsynchronous non-EC more. No data
buffering. ASB disabled.&Q5Error control modeSelect V.42 EC operation (requires flow
control)&Q6Error control modeAsynchronous mode with ASB (requires flow
control)&Q8Error control modeSelect alternate EC protocol
(MNP)&Q9Error control modeConditional data compression: V.42bis = yes, MNP5 = no.&S0 or &SDSR action selectAlways on (default)&S1DSR action selectFollows EIA specification (Active following
carrier tone, and until carrier is lost.)&T0 or &TSelf testModel specific self test on some modems&U0 or &UTrellis code modulationEnable V.32 TCM&U1Trellis code modulationDisable V.32 TCM&V0 or &V1View active(and often stored) configuration profile settings (or
ATI4&W0 or &WStore profileIn NVRAM (&W0,
&W1 etc. for multiple profiles) Some settings
cannot be stored. These often don't show on &V or
ATI4&Y0 or &YSelect configuration loaded at power-upLoad profile 0 (default)&Y1Select configuration loaded at power-upLoad profile 1&Zn=xSoft reset and load stored profile number
nNote that all items after the &Z on the
command line are ignored
Backslash and Percent Commands
Backslash and Percent CommandsCommandDescriptionComments\A0 or \ACharacter maximum MNP block size64 character maximum\A1Character maximum MNP block size128 character maximum\A2Character maximum MNP block size192 character maximum\A3Character maximum MNP block size256 character maximum%C0 or
%CData Compression Enable/DisableDisabled%C1Data Compression Enable/DisableMNP5 enabled%C2Data Compression Enable/DisableV.42bis (BTLZ) Enabled%C3Data Compression Enable/DisableMNP5 & V.42bis (BTLZ) Enabled%D0 or
%DData compression512 BLTZ dictionary size%D1Data compression1024 BLTZ dictionary size%D2Data compression2048 BLTZ dictionary size%D3Data compression4096 BLTZ dictionary size%E0 or
%E1Escape methodESCAPE DISABLED%E1Escape method+++AT method (default)%E2Escape methodBreakAT
method%E3Escape methodBOTH methods enabled%E4Escape methodDisable OK to
+++%E5Escape methodEnable OK to
+++\J0 or \JDTE Auto Rate AdjustmentDisabled\J1DTE Auto Rate AdjustmentDTE rate is adjusted to match carrier rate.\N0 or \NConnection typeNormal connection (see below for definitions)\N1Connection typeDirection connection\N2Connection typeMNP Auto-reliable connection\N3Connection typeAuto-reliable connection\N4Connection typeV.42bis reliable link with phase detection\N5Connection typeV.42bis auto-reliable link with phase detection\N6Connection typeV.42 reliable link with phase detection\N7Connection typeV.42 auto-reliable link with phase detection
A direct connection is a simple straight-through connection without any
error connection 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.S-Registers
S RegistersRegisterRangeDefaultFunctionS00-255 rings1-2Answer on ring number. Don't answer if 0S10-255 rings0if S0 is greater than
0 this register counts the incoming
rings.S20-127 ASCII43 +Escape to command mode characterS2>127no ESCS30-127 ASCII13 CRCarriage return characterS40-127 ASCII10 LFLine feed characterS50-32, 127 ASCII8 BSBackspace characterS62-255 seconds2Dial tone wait time (blind dialing, see XnS71-255 seconds30-60Wait time for remote carrierS80-255 seconds2Comma pause time used in dialingS91-255 1/10ths second6Carrier detect time required for recognitionS101-255 1/10ths second7-14Time between loss of carrier and hangupS1150-255 milliseconds70-95Duration and spacing of tones when tone dialingS120-255 1/50th seconds50Guard time for pause around +++ command
sequenceS36Fallback options when error correction link
fails:0 - Disconnect1 - Establish Direct Connection3 - Establish Normal Connection4 - Establish an MNP connection if
possible, else disconnect5 - Establish an MNP connection if
possible, else Direct Connection.7 - Establish an MNP connection if
possible, else Normal connection7Negotiation Failure TreatmentS371 = 300 bps5 = 1200 bps6 = 2400 bps7 = 1200/75 bps (v.23
mode)8 = 4800 bps9 = 9600 bps10 = 12000 bps11 = 14400 bps12 = 7200 bps0Negotiation 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? (⪚
ATS10S1? 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.)