The Hayes Command Set

The modem initialization string consists of a series of commands which are called Hayes (“AT”) commands. For many years Hayes compatible modems have been a standard. Virtual Modem Pro by Eltima Software has adhered the Hayes commands as well, however due to its Virtual Serial Ports technology some of the “AT” commands became obsolete. Those commands that aren’t supported by Virtual Modem Pro will always return “ERROR” in response. In case your application needs specific Hayes commands emulation, please, contact our support team to get in touch with our developers: support@eltima.com

The following is a partial list of the Hayes command set (called the “AT” commands). It can be divided into several groups:

  • Basic Command Set – A capital character followed by a digit. For example, ATDT#.
  • Extended Command Set An “&” (ampersand) and a capital character followed by a digit. This is an extension of the basic command set. For example, “&AT&V”.
  • Proprietary Command Set – These are the commands that are unique and supported just by Virtual Modem PRO.
  • Register Commands – ATSr=n where “r” is the number of the register to be changed and “n” is the new value that is being assigned.

A “register” refers to a specific physical location in memory. Modems have small amounts of memory onboard (ROM). 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 can be 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!


The Basic Hayes Command Set – Alphabetical

CommandDescriptionComments
A0 or AAnswer incoming callThe A command instructs the modem to go off hook and respond to an incoming call, then handshake with the remote modem
B0 or BSelect Communication StandardV.22 when line speed is at 1200 bps.
B1Domestic industry standard 212A when line speed is at 1200 bps.
DDial CommandDial the following number and then handshake in originate mode. Dial Modifiers(These are common but most modems will have more.)

P
Pulse dial *
T
Touch Tone dial *
S=n
Dials telephone number stored in location n, where n is 0, 1,or 2. You must have previously saved the value with the AT&Z command
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 (Hang up for a half second as in transferring a call)
E0 or ECommand State Character Echo SelectionWill not echo commands to the computer
E1Will echo commands to the computer (so one can see what one types)
F0 or FOn-line State Character Echo Selection *On-line character echo enabled (where not supported, ERROR result code is returned)
F1On-line character echo disabled
H0 or HHook Command OptionsOn hook – hang up
H1Off hook – phone picked up
I0 or IInternal Memory TestsConnection speed
I1Checksum (usually 3 digits)
I2Always returns “OK”
I3Additional information
I4Product name
I5 – I7Reserved
L0 or LSpeaker Volume Level Selection *Off or low volume
L1Low volume
L2Medium volume
L3Loud or high volume
M0 or MSpeaker On/Off Selection*Speaker always off
M1Speaker on until remote carrier detected (until the other modem is heard)
M2Speaker always on; stays on after carrier is detected.
N0 or NNegotiation of Handshake Options *Handshake only at speed in S37
N1Handshake at highest speed larger than S37
Q0 or QResult Code Display OptionsOff – Displays result codes, user sees command responses (e.g. OK)
Q1On – Result codes are suppressed, user does not see responses
Sn?Addresses An S-registerQuery the contents of S-register n
Sn=rRead An S-registerStore the value r in S-register n
V0 or VResult Code Format OptionsNumeric result codes
V1Verbose result codes (e.g. CONNECT, BUSY, NO CARRIER etc.)
W0 or WNegotiation Progress Message Selection *CONNECT result code reports DTE speed, and if S95=0, then disable all extended result codes.
W1CONNECT result code reports DTE speed, and if S95=0, then enable the CARRIER and PROTOCOL extended result codes.
W2CONNECT result code reports DCE speed, and if S95=0, then disable all extended result codes.
X0 or XCall Progress OptionsHayes Smartmodem 300 compatible result codes
X0Busy and dial tone detection are disabled. Only result codes 0-4 are enabled. Only the CONNECT result code is permitted, but with no indication of the telephone line speed. This setting overrides any other result code selections made with the W command and S95
X1Busy and dial tone detection are disabled. Result codes 0-5 are enabled and line speed reporting with CONNECT XXXX messages. W command options and S95 are enabled
X2Busy detection is disabled. Dial tone detection is enabled. Result codes 0-6 are enabled and line speed reporting with CONNECT XXXX messages. W command options and S95 are enabled
X3Busy detection is enabled. Dial tone detection is disabled. Result codes 0-5 and 7 are enabled and line speed reporting with CONNECT XXXX messages. W command options and S95 are enabled
X4Busy and dial tone detection are enabled. Result codes 0-7 are enabled and line speed reporting with CONNECT XXXX messages. W command options and S95 enabled
Z0 or ZSoft Reset CommandReset modem to stored configuration (Z0, Z1 etc. for multiple profiles)
(Same as &F (factory default) on modems with out NVRAM (non volatile memory)

The Extended Hayes Command Set (Ampersand Commands )

CommandDescriptionComments
&D1Data Terminal Ready (DTR)If DTR goes from On to Off the modem goes into command mode (some modems)
&D3Hang up, reset modem and return to command mode upon DTR
&F0 or &FFactory defaultsReset modem to generic Hayes-compatible defaults.
&K0 or &KLocal flow controlDisable local flow control
&K1Enable RTS/CTS hardware local flow control
&K2Enable XON/XOFF software local flow control
&K3Enable RTS/CTS hardware local flow control
&K4Enable XON/XOFF software local flow control
&L0 or &LLine Type Selection (Dial-up/Leased)Select dial-up mode
&L1Select Leased line (Private Circuit) operation
&Q0 or &QError Control mode *Asynchronous non-EC more. No data buffering. ASB disabled.
&Q5Select V.42 EC operation (requires flow control)
&Q6Asynchronous mode with ASB (requires flow control)
&Q8Select alternate EC protocol (MNP)
&Q9Conditional data compression: V.42bis = yes, MNP5 = no.
&R0 or &RRTS/CTS OptionsACTS tracks RTS while the modem is in on-line state and observes the RTS-to-CTS delay determined by S26
&R1CTS is ON while the modem is in the On-Line State, and RTS is ignored
&T0 or &TTest OptionsModel specific self tests on some modems
&VView Configuration ProfilesThe &V command is used to display the active and stored profiles (commands and S-register settings) along with any stored telephone numbers
&W0 or &WWrite Active Profile to MemoryStore the Active Profile into Stored Profile 0
&W1I Store the Active Profile into Stored Profile 1
&Y0 or &YSelect Configuration Loaded at power-upLoad profile 0 (default)
&Y1Load profile 1
&Zn=xStore Telephone NumberStore up to four (0-3) dialing strings in the modem’s nonvolatile memory for later dialing

Proprietary Virtual Modem Commands:

CommandDescriptionComments
&PSet the default client portThis command sets the default client TCP port which will be used to connect to remote server. Example:
&P5500 — assign the default client port to 5500
&HSet the hostname to connect toThis command sets the hostname (IP address or FQDN) and optionally TCP port to connect to. Examples:
&H192.168.0.1 — set the default hostname to 192.168.0.1
&H192.168.0.1:5410
set the default hostname to 192.168.0.1 and TCP port to 5410
&H’server.com’ — set the default domain name to server.com

S-Registers:

RegisterRangeDefaultFunction
S00-255 rings1-2Answer on ring number. Don’t answer if 0
S10-255 rings0If S0>0 this register counts incoming rings
S20-127 ASCII43 +Escape to command mode character
S2>127no ESC
S30-127 ASCII13 CRCarriage return character
S40-127 ASCII10 LFLine feed character
S50-32,127 ASCII8 BSBackspace character
S62-255 seconds2Dial tone wait time (blind dialing, see Xn)
S71-255 seconds30-60Wait time for remote carrier
S80-255 seconds2Comma pause time used in dialing
S91-255 1/10 sec.6Carrier detect time required for recognition
S101-255 1/10 sec.7-14Time between loss of carrier and hangup
S1150-255 millisec.70-95Duration and spacing of tones when tone dialing
S120-255 1/50 sec.50Guard time for pause around +++ command sequence
S400-255 rings.40Wait time for remote answer

* – these commands are simple stubs that are implemented for compatibility however don’t modify modem’s settings.