Flow Control, Initialization Strings, and Querying a Modem

Occasionally, a modem will require that you give it a certain set of commands to change the way it communicates. These commands are issued to the modem by using an initialization string. Initialization strings allow you, among many other things, to fine-t une a connection to compensate for problems such as low line voltage or excessive static by changing the type of flow control used. This file will briefly explain flow control. It will also explain how to query a modem, what commands you need to look for, what they mean and how to put them together to do what you want.
 
I. What is Flow Control?
A. Hardware vs. Software

II. AT Commands
A. Basics
B. Specifics
C. 28.8 vs. 14.4
D. 9600 and 2400 modems

III. How to Query a Modem
A. Windows 3.x
B. Windows 95
C. Macintosh

IV. Displaying Stored Profiles
A. Displaying the Active Profile

V. Building a String
A. Hayes
B. Intel

VI. Common Init Strings

I. What is Flow Control?

Flow control allows the modem to monitor and control the amount of data coming from the computer (local system) or the remote modem (i.e., an ISP). When enabled, flow control will notify either end (sending or receiving) if its buffers are too full so that they stop sending data for a moment.

A. Hardware vs. Software

The next section will discuss what commands to look for, what they do and how to find them by querying a modem.

II. AT Commands

AT (short for attention) commands are used to make a modem do many different things. This section will explain what commands you need to look for to build a string. It will also describe the most common commands shared by all modems.

A. Basics

These commands should be common to all modems.
 
AT  Simply means 'attention'. Almost all modems will respond to AT. Always include this when issuing commands to the modem, whether it is one or a string of ten.
ATZ  Resets the modem to 'ready-to-dial' mode. This is also recognized by almost all modems. 
ATE1  Enables local echo so that as you send commands to the modem, they will appear on the screen. 
ATV1  Makes modem respond in verbose mode 
AT&V  This command will display all the Stored Profiles contained in the ROM of the modem. The Stored Profiles list all of the AT commands and s-registers used by the modem, depending on which profile is selected. 
AT&F  Resets the modem to Stored Factory Profile 0. Profile 0 is the default and is usually very generic. 
AT&F1  Resets the modem to use Stored Factory Profile 1. Most 28.8 modems are pre-configured with all of the Hardware Flow Control commands in Profile 1. 
&C1  Turns on what is called Carrier Detect. When two modems establish a connection, a continuous signal is started between them called a carrier signal. As long as that signal is active, the modems will continue sending and receiving. If the signal is lost, the modems SHOULD disconnect, but sometimes one (usually on the user side) will continue to try and use the connection. The &C1 command instructs the modem to "go on hook" ( a fancy way of saying 'hang up') and return to ready-to-dial mode if the carrier signal is lost. 
&D2  Turns on what is called a DTR (Data Terminal Ready) signal. This is a signal from the computer saying that it is ready to start sending commands to the modem. If the DTR signal is lost, the call will terminate. 

NOTE: Macintoshes with EXTERNAL modems do not use the DTR signal. Use &D0 instead of &D2 to turn off the DTR signal. If it is an internal modem (which are rare) then go ahead and use &D2. 

B. Specifics

There are three common sets of AT commands for Hardware Flow Control: Hayes, Intel and US Robotics. These are the commands to look for when querying a modem.
 
Hayes set  &K3  instructs the modem to use Hardware Flow Control 
&Q5  instructs the modem to use bi-directional error correction, which checks data packets for any corruptions while sending or receiving. 

NOTE: Some modems use &Q6 instead of &Q5. Try this if the modem doesn't respond to &Q5. 

Intel set  \N3  instructs the modem to use auto-reliable LAPM/MNP mode. This ensures that the user's modem can communicate with the server modem whether it uses LAPM or MNP for error correction. Similar to what &Q5 does in the Hayes set. 

LAPM - Link Access Protocol for Modems. This type of error correction uses an Automatic Repeat Request, a modem error control protocol in which the receiver asks the transmitter to resend corrupted data. 

MNP - Microcom Networking Protocol. One of the most common modem protocols that incorporates error correction with data compression. 

\Q3  instructs the modem to use bi-directional RTS/CTS flow control. The modem and local computer use the CTS (Clear To Send) signal to start and stop transmission. When the computer sends an RTS (Ready To Send) signal, the modem knows that the computer wants to transmit data. If the modem is ready to receive the data, it replies with a CTS signal. Likewise, the modem sends the computer a CTS signal when it has data to send to the computer, which responds with an RTS signal when it is ready to receive the data. 
US Robotics set  &H1  instructs modem to Hardware Flow Control for transmitting data. Modem requires CTS signal from computer to start transmission. 
&R2  instructs modem to use Hardware Flow Control for receiving data. Modem requires RTS signal from computer to start receiving. 
&M4  instructs modem to use bi-directional error correction if an ARQ (Automatic Repeat Request) connection is made. Both the sending and receiving modem must be set to use ARQ mode or the local modem will not use error correction (almost all modems default to ARQ mode.) 

C. 28.8 vs. 14.4

If you are dealing with a 28.8 modem, and need to give it an init string, try AT&F1, which should use a defaulted Hardware Flow Control Profile. If this has no effect on the connection, or if you are dealing with a 14.4 modem, go to the next section, query the modem and build a string.

D. 9600 and 2400 modems

9600 -- Most 9600 modems can do hardware flow control. They should respond to a query. Follow the instructions in Displaying Stored Profiles. NOTE: The baud rate MUST be set to 9600 or the modem will not function.
2400 - These modems were built BEFORE hardware flow control and error correction. You MUST follow some specific instructions for these modems:

III. How To Query A Modem

There are many different ways to query a modem, depending on what operating system you are dealing with. Most systems will come with a basic terminal program of some kind that will allow you to access the modem. Also, most PPP dialers have a manual login option that will let you issue commands to the modem. Each section below will have several ways to query the modem for each OS.

A. Windows 3.x

Terminal -- Windows 3.x comes with a program called Terminal. This is a basic dialer that can be used for accessing bulletin boards, UNIX systems, etc. To query with Terminal, do the following:
  1. In Program Manager, open the Accessories group and double-click on the Terminal icon.
  2. Go to the Settings menu and select Communications.
  3. In Communications, go to the bottom-right corner and select the proper comm. port from the Connector section and click OK. You should the be looking at a blank screen with a blinking cursor in the top-left corner. (If you are unsure what comm. port the modem is on, start with comm. 1 and click OK. If the modem is not on that port, Terminal will tell you. Try each port until you stop getting error messages.) After selecting the right port, click OK.
  4. A blinking cursor should be in the upper-right corner. This is where you will type the commands needed to query the modem.
You are now ready to query the modem. Go to the DISPLAYING STORED PROFILES section below to continue.

Trumpet Winsock -- This is the most common dialer for Windows 3.x. We distribute it on both the HOL and GST Win3.x install disks. To query with Trumpet, do the following:

  1. In the Program Manager, open the Internet directory and double-click on the TCPMan icon.
  2. Go to the File Menu and choose Setup. In the Network Configuration window, make sure that the Slip Port field is set to the right comm. port for the modem and click OK. Trumpet will ask you to close the program to save the changes. Do this and then re-open Trumpet.
  3. Go to the Dialer menu and select Manual Login. The screen should display 'PPP Disabled' and a blinking cursor. You will type commands at this cursor.
You are now ready to query the modem. Go to the DISPLAYING STORED PROFILES section below to continue.

B. Windows 95

The best way to query a modem in Windows 95 is to use the Pre-Dial Terminal Window that is built into the Dial-Up Networking software. To open that window so you can query the modem, do the following:
  1. Double-click on the My Computer icon on the desktop.
  2. In the My Computer window, double-click on the Dial-Up Networking icon.
  3. In the Dial-Up Networking window, click on the HOL or GST icon with the RIGHT mouse button and select Properties from the menu that appears. A General Properties window will appear.
  4. At the bottom of the General window you will see a Configure button. Click this button. A new window will appear with three tabs: General, Connection and Options. Click on the Options tab.
  5. At the top of the options window, you will see a section called Connection Control. There will be two check boxes in that section. The first one says "Bring up terminal window before dialing". Click on the box so that it contains a check mark and click OK.
  6. Click OK on the General window. This should bring you back to the HOL/GST icon.
  7. Double-click on the HOL/GST icon to bring up the Connect To window. Click Connect and the Pre-dial Terminal Window should appear. Maximize the window so it fills the screen. There should be a blinking cursor in the top-right corner.
You are now ready to query the modem. Go to the DISPLAYING STORED PROFILES section below to continue.

C. Macintosh

FreePPP -- If the user has installed software from our disks, they should have FreePPP 2.5 for the dialer. To open a terminal window in FreePPP, do the following:

NOTE: The terminal window option in ConfigPPP (any version) and FreePPP 1.0.5 will NOT work for this purpose. The terminal windows on those diallers do not have a scroll-back buffer so you cannot get back to the active profile once it has scrolled past on the screen.

  1. Go to the menu bar at the top of the screen, click on the telephone icon (it should be in the upper-right corner) and select FreePPP Setup from the menu that appears.

  2. Note: If they do not have a phone on the task bar(or the phone icon displays something other than FreePPP Setup), have the user go to the Apple menu and select "Internet Applications". Then just click on the FreePPP Setup Icon.
  3. In FreePPP Setup, click on the Accounts tab.
  4. In the Accounts tab, highlight the HOL/GST entry and click on Edit.
  5. In the Edit window, find the section that says Connect. Click on the drop-down arrow and select 'Manually'. Click OK to close the window.
  6. Click on the Connect button to bring up the terminal window.
If the user doesn't have FreePPP 2.5 on their system (due to either old system software or low memory) the find out if they have a terminal program of any kind. The most common terminal programs on a Mac are Claris Works, Zterm and White Knight. Have the user open the program and help you to find the menu that contains modem settings. Make sure that the right comm. port is selected and the program should be ready to use. All of these programs will look very similar to Terminal in Windows.

You are now ready to query the modem. Go to the DISPLAYING STORED PROFILES section below to continue.

IV. Displaying Stored Profiles

Luckily, the same process is used to query all different brands of modems. There are a very rare few that will respond differently, US Robotics being the one you will encounter most often. This section will explain what commands to use to make a modem display stored profiles. It will also explain how to interpret them to build an init string.

The following steps will be the same for all modems on all platforms, except US Robotics. See Building a String for specifics on what to do with a US Robotics modem. To display an active profile, do the following:

  1. Once you have brought up a terminal window or are in a manual login session, type 'at' (without the quotes) at the blinking cursor. You should get a response of 'OK'. If you get a different response, try one of the following:

  2.  
  3. Once you have received the proper response from the modem, type 'at&f' to reset the modem to Stored Factory Profile 0. You should receive a response of 'OK'.

  4.  
  5. After the modem has been reset to factory defaults, type 'at&v' at the cursor. This should bring up the list of Stored Profiles. They should look something like this:
ACTIVE PROFILE:
B1 E1 L1 M0 N1 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K0 &Q0 &R1 &S0 &T5 &X0 &Y0 S00:001 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:050 S08:002 S09:006 S10:014 S11:095 S12:050 S18:000 S25:005 S26:001 S36:007 S37:000 S38:020 S44:020 S46:138 S48:007 S95:000

The profile seen above (Active Profile) is exactly what you are looking for. From this profile, we can build a string.

V. Building a String

US Robotics - If you received a response of 'error' to 'at&v', the modem is most likely a US Robotics. In this case, use the following: AT&F&C1&D2&H1&R2&M4. This string should work with all US Robotics modems.

If you received an 'OK' response to 'at&v', follow the instructions below to build a string.

A. Hayes

  1. First, look to see if the active profile contains the commands you need. The profile above contains:

  2.  
  3. Second, after finding the commands that you need, determine if they do what you want or if they need to be modified:

  4.  
  5. Finally, put the string together. In this case, the string you would use is AT&F&K3&Q5. Why?
The string that was built from the above profile uses the Hayes set of AT commands. If you are querying a modem that uses the Intel set, the only major difference you will see in the active profile is a large section of backslash commands. If you do not find &K and &Q in the active profile, look for \N and \Q. Here is an example of what you might find:

B. Intel

  1. Let's assume that you found the following commands:

  2.  
  3. Now, determine which commands need to be modified:

  4.  
  5. Finally, put the string together. In this case, the string you would use is AT&F&C1&D2. Why?
Congratulations! You have successfully built an initialization string.

VI. Common Init Strings

If you happen to come across a modem that does NOT display the active profiles and responds with something other than 'error' when given 'at&v', try the following strings, starting with the Hayes set (if it is a 28.8 modem, remember to try AT&F1 first):
Hayes - AT&F&C1&D2&K3&Q5

Intel - AT&F&C1&D2 \N3 \Q3 (the spaces are important!)

Or take a look at our init string list
 

.

Written by Steve Bishop ** GST Internet Services ** 4/24/97