Der Hayes Befehlssatz


Dies ist eine Beschreibung des Hayes Befehlssatzes. Die meisten Modems sind zu diesem Befehlssatz weitgehend kompatibel. Wenn Sie Ihr Modem-Handbuch verloren oder nie eines besessen haben, so könnte diese Referenz Ihnen vielleicht nützlich sein. Ich habe zum Beispiel endlich herausgefunden, wie man die Lautsprecher meines Modems abstellt: ATM0 -- Letztendlich: Stille !

Der Hayes Befehlssatz

Die Modem-Initialisierungs-Sequenz besteht aus einer Reihe von Befehlen. Diese bereiten das Modem für die Kommunikation vor, wobei Eigenschaften wie Wählmodus, Wartezeiten, Erkennung des Besetztzeichens und vieles mehr eingestellt werden. Neuere Modem-Kommunikationsprogramme setzen die Initialisierungs-Sequenz je nachdem welche Menüeinträge Sie auswählen, welche Eigenschaften Sie aktivieren, usw.

Viele Jahre waren Hayes-Modems der Standard. Als die Zahl der Modemhersteller stieg, haben die Meisten sich wenigstens ansatzweise am Hayes-Standard orientiert. Die folgende Liste zählt einen Teil der Hayes-Modembefehle (genannt AT-Befehle) auf. Der Hayes Befehlssatz kann in vier Gruppen unterteilt werden:

Basis Befehlssatz
Ein Großbuchstabe gefolgt von einer Ziffer. Beispiel: "M1".
Erweiterter Befehlssatz
Ein "&" (Kaufmanns-Und) und ein Großbuchstabe gefolgt von einer Ziffer. Dies ist eine Erweiterung des Basis Befehlssatzes. Beispiel: "&M1". Beachten Sie, dass "M1" verschieden ist von "&M1".
Hersteller Befehlssatz
Beginnt gewöhnlich entweder mit einem Backslash ("\") oder mit einem Prozentzeichen ("%"). Diese Kommandos können bei den verschiedenen Modemherstellern stark variieren. Aus diesem Grund sind nur wenige dieser Befehle unten aufgelistet.
Register-Befehle
"Sr=n" wobei "r" die Nummer des Registers ist, das verändert werden soll und "n" ist der neue Wert, der dem Register zugewiesen wird.

Ein "Register" ist Computerjargon für einen bestimmten physikalischen Ort im Speicher. Modems haben nur wenig Speicher eingebaut. Dieser vierte Befehlssatz wird dazu benutzt, um gewünschte Werte in spezielle Register (Speicherstellen) einzubringen. Das Register speichert eine bestimmte "Variable" (alphanumerische Information) ab, die vom Modem und der Kommunikationssoftware benutzt wird. Zum Beispiel weist "S7=60" Ihren Computer an, das Register #7 auf den Wert 80 zu setzen.

Achtung: Obwohl die meisten Befehle durch eine Buchstaben-Ziffer-Kombination (L0,L1, usw.) definiert sind, ist die Benutzung der Null optional. In diesem Fall ist "L0" das gleiche wie einfach "L" - beachten Sie das, wenn Sie die untenstehende Tabelle lesen!

Hier sind einige der wichtigsten Zeichenfolgen, die in der Initialisierungs-Sequenz vorkommen können. Diese Zeichenfolgen sollten normalerweise nicht verändert werden.

AT
Sagt dem Modem, dass ein Modembefehl folgt. Jede Befehlszeile muss damit beginnen.
Z
Setzt das Modem auf den Standardzustand zurück.
, (Komma)
Lässt Ihre Software für eine Sekunde anhalten. Sie können auch mehrere Komma nacheinander verwenden. Zum Beispiel lässt ",,,," Ihre Software für vier Sekunden pausieren. (Die Dauer der Pause kann durch Verändern des Registers S8 eingestellt werden.)
^M
Sendet ein terminierendes Wagenrücklauf-Zeichen (Carriage Return) zum Modem. Dies wird von den meisten Kommunikationsprogrammen in ein "carriage return." übersetzt.


Der Basis Hayes Befehlssatz - Alphabetisch

Befehl - Beschreibung - Kommentar
A0 oder A Eingehenden Anruf annehmen
A/ Letzten Befehl wiederholen. (Kein AT voranstellen. Enter bricht normalerweise ab.)
B0 oder B Übertragungsart Modem folgt dem Standard V32/CCITT
B1 Modem folgt dem Bell-Standard 212A
B2 Ausführlich/Still beim Antworten
D Wählen Darauf folgende Nummer wählen und dann Handshake im Verbindungsmodus.

Wählparameter

(Dies sind die gemeinsamen Parameter; die meisten Modems haben noch weitere .)

P
Impulswahl
T
Frequenzwahl (Tonwahl)
W
Auf zweiten Wählton warten
,
Pause für die Zeit, die in Register S8 eingestellt ist (normalerweise 2 Sekunden)
;
Nach dem Wählen im Befehlsmodus verbleiben. (Zum Anhängen weiterer Wahlbefehle bei zu langen Wählstrings)
!
Amtsholung (Flashtaste bestätigen)
L
Zuletzt gewählte Nummer wählen


E0 oder E Kein Echo Kommandos werden nicht zum Computer als Echo zurückgesendet.
E1 Echo Kommandos werden als Echo zum Computer zurückgesendet. (so dass man sehen kann was man tippt.)
H0 oder H Verbindungsmodus Bestehende Verbindung abbrechen.
H1 Modem an die Leitung schalten.
I0 oder I Informationen abfragen (Dieser Befehl ist stark abhängig vom Model des Modems. I0 gibt normalerweise eine Nummer oder einen Code zurück, während höhere Nummern meistens sehr viel ausführlichere Informationen zurückgeben.)
L0 oder L Lautstärke des Lautsprechers

Modems, die einen eigenen Lautstärkeregler haben, kennen diesen Befehl nicht.

Lautsprecher aus oder niedrige Lautstärke
L1 niedrige Lautstärke
L2 mittlere Lautstärke
L3 laut
M0 oder M Lautsprecher aus (M3 wird auch benutzt. aber bei vielen Marken verschieden.)
M1 Lautsprecher an bis ein Verbindungszeichen erkannt wurde (bis das andere Modem gehört wurde)
M2 Lautsprecher immer an ( Sie hören die Datenübertragung nach einem CONNECT)
N0 oder N Handshake Geschwindigkeit Handshake mit Geschwindigkeit, die in Register S37 steht
N1 Handshake mit höchster Geschwindigkeit, größer als in Register S37
O0 oder O Return Online (O0 see also X1 as dial tone detection may be active)
O1 Return Online after an equalizer retrain sequence
Q0 oder Q Quiet mode Off - Displays result codes, user sees command responses (e.g. OK)
Q1 On - Result codes are suppressed, user does not see responses
Sn? Query the contents of S-register n
Sn=r Store Store the value r in S-register n
V0 oder V Verbal? Numeric result codes
V1 English result codes (e.g. CONNECT, BUSY, NO CARRIER etc.)
X0 oder X Smartmodem Hayes Smartmodem 300 compatible result codes
X1 Usually adds connection speed to basic result codes (e.g. CONNECT 1200)
X2 Usually adds dial tone detection (preventing blind dial and sometimes ATO)
X3 Usually adds busy signal detection
X4 Usually adds both busy signal and dial tone detection
Z0 oder Z Reset Reset 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 )

Command - Description - Comments
&B0 oder &B Retrain Parameters Disable auto retrain function
&B1 Enable auto retrain function
&B2 Enable auto retrain, but disconnect if no line improvement over period dictated by S7
&C0 oder &C Carrier detect signal always on
&C1 Indicates remote carrier (usual preferred default)
&D0 oder &D Data Terminal Ready (DTR) Signal ignored (See your manual on this one!)
&D1 If DTR goes from On to Off the modem goes into command mode (some modems)
&D2 Some modems hang upon DTR On to Off transition. (Usual prefered default)
&D3 Hang up, reset modem and return to command mode upon DTR
&F0 oder &F Factory defaults Generic 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.

&F1 Factory defaults tailored to an IBM-PC compatible user
&F2 Factory defaults for a Mac w/software handshaking
&F3 Factory defaults for a Mac w/hardware handshaking
&G0 oder &G Guard tones Disable guard tones
&K0 oder &K Local flow control Disable local flow control
&K1 Enable RTS/CTS hardware local flow control
&K2 Enable XON/XOFF software local flow control
&K3 Enable RTS/CTS hardware local flow control
&K4 Enable XON/XOFF software local flow control
&L0 oder &L Dial mode Select dial-up mode
&M0 oder &M Error Control mode Select asynchronous non-EC mode (same as &Q0)
&P0 oder &P Pulse dialing ratio U.S./Canada pulse dialing 39% make/ 61% break ratio
&P1 U.K./Hong Kong pulse dialing 33% make/ 67% break ratio
&Q0 oder &Q Error Control mode Asynchronous non-EC more. No data buffering. ASB disabled.
&Q5 Select V.42 EC operation (requires flow control)
&Q6 Asynchronous mode with ASB (requires flow control)
&Q8 Select alternate EC protocol (MNP)
&Q9 Conditional data compression: V.42bis = yes, MNP5 = no.
&S0 oder &S DSR Action Select Always on (default)
&S1 Follows EIA specification (Active following carrier tone, and until carrier is lost.)
&T0 oder &T Self test Model specific self tests on some modems
&U0 oder &U Trellis code modulation Enable V.32 TCM
&U1 Disable V.32 TCM
&V0 oder &V View active (And often stored) configuration profile settings (or ATI4)
&W0 oder &W Store profile In NVRAM (&W0, &W1 etc. for multiple profiles)
Some settings cannot be stored. These often don't show on &V or ATI4
&Y0 oder &Y Select Configuration Loaded at power-up Load profile 0 (default)
&Y1 Load profile 1
&Zn=x Soft reset and Load Stored profile #n Note: All items after the &Z on the command line are ignored


Backslash & Percent Commands:

Command - Description - Comments
\A0 oder \A Character maximum MNP block size 64 character maximum
\A1 128 character maximum
\A2 192 character maximum
\A3 256 character maximum
%C0 oder %C Data Compression Enable/Disable Disabled
%C1 MNP5 Enabled
%C2 V.42bis (BTLZ) Enabled
%C3 MNP5 & V.42bis (BTLZ) Enabled
%D0 oder %D Data compression 512 BLTZ dictionary size
%D1 1024 BLTZ dictionary size
%D2 2048 BLTZ dictionary size
%D3 4096 BLTZ dictionary size
%E0 oder %E Escape method ESCAPE DISABLED
%E1 +++AT method (default)
%E2 <BREAK>AT method
%E3 BOTH methods enabled
%E4 Disable "OK" to +++
%E5 Enable "OK" to +++
\J0 oder \J DTE Auto Rate Adjustment Disabled
J1 DTE rate is adjusted to match carrier rate.
\N0 oder \N Connection type Normal connection (see below for definitions)
\N1 Direction connection
\N2 MNP Auto-reliable connection
\N3 Auto-reliable connection
\N4 V.42bis reliable link with phase detection
\N5 V.42bis auto-reliable link with phase detection
\N6 V.42 reliable link with phase detection
\N7 V.42 auto-reliable link with phase detection

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.


S-Registers:

Register Range Default Function
S0 0-255 rings 1-2 Answer on ring 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 &gt;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 bps
6 = 2400 bps
7 = 1200/75 bps (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. "AT S10=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.)