ArticleslgStudy

science

Command mode and data mode

Command mode and data mode is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Command mode and data mode rather than just read about it. In short: Command mode and data mode are two modes in which a computer modem may operate. These modes are defined in the Hayes command set, which is the de facto standard for all modems.

Key takeaways

  • Command mode and data mode belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Command mode and data mode to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Command mode and data mode from memory before moving on to harder problems.

Reference excerpt

Command mode and data mode are two modes in which a computer modem may operate. These modes are defined in the Hayes command set, which is the de facto standard for all modems. These modes exist because there is only one channel of communication between the modem and the computer, which must carry both the computer's commands to the modem, as well as the data that the modem is enlisted to transmit to the remote party over the telephone line. When a modem is in command mode, any characters sent to it are interpreted as commands for the modem to execute, per the Hayes command set. A command is preceded by the letters 'AT', which stand for 'Attention'. For example, if a modem receives 'ATDT5551212' while in the command mode, it interprets that as an instruction to dial the numbers 5551212 on the telephone, using touch-tone dialing. During a command mode operation, the modem may send responses back to the computer indicating the outcome of the command. For example, the modem may respond with the word "BUSY" in response to the ATDT command, if it hears a busy signal after dialing and is configured to listen for busy signals. Any communication in command mode (in both directions) is terminated by a carriage return. When a modem is in data mode, any characters sent to the modem are intended to be transmitted to the remote party. The modem enters data mode immediately after it makes a connection. For example, if ATDT5551212 resulted in a phone call that was answered by another computer modem, the modem would report the word "CONNECT" and then switch to data mode. Any further characters received over the serial link are deemed to be from the remote party, and any characters sent are transmitted to the remote party. When a voice-capable modem is in "voice data" mode, any data sent to the modem is interpreted as audio data to be played over the phone line, rather than character bytes to be transmitted digitally to the other party.

Switching between modes

Modems always start out in command mode when powered up. Here are the ways a modem can switch to data mode:

After a successful dial-out connection in response to an "ATD" dial command in which the modem reaches another modem. After answering the phone with the "ATA" answer command, if another modem is on the other end. After answering the phone automatically for some pre-configured reason (such as auto-answer), and connecting to another modem. (Almost all modems support auto-answering when given the command "ATS0=1".) After being given the "ATO" command after being put back in the command mode with an escape sequence (see below). In response to similar dialing or connecting commands for fax or voice communications. Modems switch back into command mode from data mode for the following reasons:

The connection got broken (for example, the other party hung up). The computer issued an escape command, which is usually a 1-second pause, then the three characters "+++", then another 1-second pause. The connection remains, but the modem can accept commands, such as "ATH" for hangup. The computer can issue the "ATO" command to return to data mode. The computer instructed the modem to terminate the call by setting the Data Terminal Ready (DTR) pin to an "off" state. The DTR pin is usually how computers invoke the termination of a modem call nowadays. The +++ escape sequence is rarely used, and may even be disabled to avoid malfunction in case these characters are legitimately a part of the data stream (ignoring the 1-second pauses).

Practical contemporary use Today, most modems are configured with the characters "&C1&D2" in the initialization string, or otherwise behave this way by default. This causes the following behavior:

The modem uses the Data Carrier Detect (DCD) pin to signal whether it's connected to a host. The computer can generally just read the DCD pin at any time and always know if the modem is in command or data mode. DCD high means data mode, and low means command mode. DCD is a signal sent from the modem to the computer. (Note that DCD also remains high if in command mode after a +++ escape sequence, but in practice, software uses this so rarely, if at all, so it's not really an issue.) The modem interprets the Data Terminal Ready (DTR) pin as a signal from the computer to know when it wants to terminate a call. DTR is a signal from the computer to the modem. The computer keeps DTR high at all times until it wants to terminate a call, at which time the computer lowers DTR for a second or two. The computer also keeps DTR low when no programs are running that want to use the modem - this keeps the modem from answering calls due to auto-answer or otherwise doing something unexpected or undesired. The computer may safely assume that after DTR has been brought low for a couple seconds, that the modem will be in command mode.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Command mode and data mode

Start with the simplest possible case. Write down what Command mode and data mode claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Command mode and data mode before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Command mode and data mode ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Command mode and data mode

In research
Command mode and data mode appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Command mode and data mode in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Command mode and data mode is common in secondary-school and first-year university syllabi. It links to neighbouring topics Modems, so understanding it makes those chapters shorter.
In everyday life
Look for Command mode and data mode outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Command mode and data mode” →

How to study Command mode and data mode in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Command mode and data mode means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Command mode and data mode out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Command mode and data mode in simple terms?

Command mode and data mode are two modes in which a computer modem may operate. These modes are defined in the Hayes command set, which is the de facto standard for all modems.

Why does Command mode and data mode matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Command mode and data mode?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Command mode and data mode.

Tags

  • Modems

Keep exploring