Modem Operations

The modem is equipped with its own microprocessor and can interpret commands from the computer to which it is attached. In particular, the modem software is compatible (with additions), as far as is possible with the AT commands developed and used by Hayes Microcomputer Products Inc. of America. Commands, such as D, which is used to initiate automatic dialling, are passed to the modem through a standard RS232 interface in the same manner as data. The modem is able to distinguish between data and commands by the use of an escape sequence which switches it to command mode. After receiving a valid escape sequence (and also on power-up), the modem accepts the appropriate commands from the computer. Once a command is accepted and executed, the modem goes into its on-line state or waits for further commands.

Operating states.

Whenever you switch on the modem, it goes into command mode and is ready to accept commands.

Commands can be sent to the modem at rates of 300, 600, 1200, 2400, 4800, 7200, 9600, 14400, 19200, 28800, 38400, 57600 or 115200 bps (varies according to model).

When the modem is not in command mode it is said to be on-line and generally connected to a remote system. When a connection is established the modem automatically switches to on-line mode to allow the transfer of data directly between the two modems.

Switching to Command Mode.

The modem switches from on-line to on-line command mode when it receives the correct escape sequence from the computer. This sequence consists of three occurrences of a special character called the escape character which is by default the plus symbol (+, ASCII 43). If three pluses (+++) are sent to the modem from the computer one after the other, they are recognised as the escape sequence, and command mode is entered with the modem returning the OK message. As a precaution to prevent accidental escapes, there is a defined guard time before and after the escape sequence during which no other characters must be entered. For example, if the guard time is 1 second (as it is by default), and the modem receives the following sequence from the terminal:

{nothing for 1 second} +++ {nothing for 1 second}

it switches to command mode, displaying the OK message. If any other characters are received before or after the escape sequence and within the guard time, the sequence is ignored.

Returning to command mode does not cause the modem to drop the line. An existing connection remains established until the carrier signal is lost, the inactivity time-out is exceeded or a specific command is used to force it to drop the line. The most common use of this sequence is to enable the call to be terminated by issuing the H command.

The purpose of the guard time in the escape sequence is to prevent accidental use of the escape characters during normal data transfers. For example, a text file being sent to the remote system may contain the sequence +++ but it is highly unlikely that there is a 1 second gap in transmission before and after this sequence within the file.

The modem returns automatically to command mode if a dial command (or other command which normally causes the modem to go on-line) fails for some reason. Similarly, whenever an established connection is terminated due to loss of the carrier, deliberately or accidentally, the modem returns to command mode.

Data format.

The modem recognises the following data formats sent from the computer.

Data bits: 7 or 8 bits
Parity: Odd, Even, Space, Mark or None
Stop bits: 1 or 2 bits

It is necessary to set the correct data format at your computer before attempting to connect to a remote service. This information should be available from the service providers. Common settings are 8 None 1 and 7 Even 1.

Data bits
These are the number of bits (binary digits) used to construct an ASCII character. This may be 7 or 8 bits dependent on the application software you are running.

Parity
A parity bit is an extra bit added to a character as a simple form of error check. Parity can be ODD or EVEN or NONE (where no parity bit is transmitted). The number of "1" bits in a character is calculated and the parity bit may be a "1" or a "0" to generate ODD or EVEN parity.

Start/Stop bits
Bits added to the beginning and end of a character are called start and stop bits. These enable the receiving equipment to recognise the character.

Entering AT commands.

Virtually all command lines start with the AT character pair and must be terminated with <Enter> or <Return>. In addition to informing the modem that commands will follow, typing AT allows the modem to determine the operating speed and data format that the computer is currently using. This information is stored internally by the modem for use during further operations until the next AT command is received. The ability to configure itself by referring to commands from the computer means that no special set up procedures are required before the modem is used.

Any ASCII-based communications software that has a local mode may be used to access any or all of the modem data functions. Once a command is recognised and executed the modem goes to its on-line state or waits for further commands.

The actual commands comprise one or two characters often followed by an optional parameter (e.g. ATE1, AT&C2). The whole command line is executed by pressing <Return>.

Several commands can be strung together in a single command line. For example:

ATS0=2 <Return>

ATD 9 W 01274 123456 <Return>

is equivalent to:

ATS0=2 D 9 W 01274 123456 <Return>.

The AT is not repeated for the second command when both commands are entered on the same line.

The <Del> or <Backspace> key on the keyboard deletes characters in the command line. However, the AT cannot be deleted even if it appears to have been removed from the screen.

If you wish to abandon a command completely, delete the line back to AT and press <Return>. The OK message appears without any further action being taken.

Errors in command lines.

If an error is detected in a command line, all commands prior to the point of error are executed. The remaining commands are ignored and the ERROR message is returned.

A/ Repeat last command.

A/ is the only local mode command that does not begin with AT. It is used to repeat the most recent command line and is widely used for last number re-dials. The A/ command does not require termination with <Return>. If the modem is reset using the ATZ command, the A/ command does not operate. ATZ clears the command buffer and attempting to use A/ only returns the OK message.

Note: A/ must be typed as a pair. Deleting back to the A and entering / does not initiate the repeat command.

Result codes.

The OK message and others generated by the modem are used to indicate the successful execution of a command. These messages are called result codes and may be issued in one of two forms: enhanced English-like messages (such as NO DIALTONE); or simple numeric codes (such as 6) that are more easily interpreted by communications software. The particular subset of the codes used depends upon the setting of the X command. By default, the result codes are displayed as English-like messages. To select the numeric form, use the V0 command.


Previous Section | Contents | Search Tools | Glossary | Comments | Next Section

Hosted by www.city-visitor.com

Introduction Contents Search Tools Glossary Comments Baud Rate Control