Classic Computer Magazine Archive ST-Log ISSUE 21 / JULY 1988 / PAGE 79

TUTORIAL

Step 1 - Hard Facts

More Baudy Tales

Using a modem.

By Maurice Molyneaux

Allergic to all things Commodore, Maurice Molyneaux is an author and artist who—when not writing articles for ST-Log—continues to struggle with a recalcitrant eight-year-old science fiction novel, paints, illustrates and uses his ST for "every conceivable task." Despite a ridiculously French name, he claims to having been born in Vicenza, Italy, and denies vicious rumors that he eats escargot and calamari when computing. His Delphi username is MAURICEM.

Back in the April '87 issue of ST-Log appeared my article "A Baudy Tale," which was a beginner's guide to telecommunications. In that article I discussed what a modem is, various aspects of how they work, terminology, etc. If you haven't read that article before, it might be a good idea to read it now (if you have the issue). In this installment of Step I we're going to discuss not the subject of modem hardware, etc., but of using a modem and terminal software.

Before going on, I would like to thank Supra Corp. for providing me with their Supra 2400 baud modem for use in the writing of this article. Four different modems were used to research this article: the Hayes Smartmodem 1200, Atari SX212, Avatex 1200hc, and the aforementioned Supra 2400.

What it is

If you're new to computers, you might not know exactly what a modem is. You are probably aware that they are used with computers and telephone lines. If you've read the papers, you've probably heard about those "hackers" who use modems to break into hospital, business and government computers, wreaking havoc and wrecking files. You may picture the guys who alter phone bills, and wreck the financial accounts of people they don't like by passing around their credit card numbers. You may even picture the movie Wargames, with thoughts of people causing or nearly causing a nuclear war or other disaster.

But, as is so often the case with the news and media, you only hear reports on the misuses of such technology. It's true, people have caused havoc with computer and modems, but they are the minority. Just as a handful of homicidal maniacs are not indicative of the rest of the population of this country, people who use modems for mischief are not indicative of the majority of us who use modems for the purposes they were designed for.

There are a lot of exaggerations about modems and the people who use them. These "tall tales" are based upon the misdeeds of a few unscrupulous people, true, but they do not tell the whole story. Breaking into other people's systems and messing with their files is not the reason modems were created. They were made to allow computers to "talk" to each other over conventional telephone lines, exchanging data over great distances quickly and easily.

"Modem" is an acronym for MOdulator DEModulator, which is a fancy way of saying the sending modem MOdulates its data into a carrier signal that can be sent over a phone line, and the modem on the other end DEModulates the signal, converting it back to its original form (binary numbers).

People use modems for all kinds of things, but the heart of it is always data transmission, whether that data be the latest stock market report, digitized pictures, or just sending weird stories to friends, it all boils down to sending that data (or, should I say, copies of it) from place to place.

Choosing a modem

Modem's for the ST are all (thus far) external, meaning they are a separate box that connects to your computer rather than an internal card. Generally speaking, most any "generic" modem (in other words, one not designed for a specific system, like the XM301 for the Atari 8-bits) can be used on the ST. You needn't look for a modem to have "works with Atari ST" on its box. Any "generic" modem featuring an RS232 interface should work (be warned, however, there are always exceptions).

The first thing you should look for in a modem for your ST is a high transmission speed. The minimum speed modem you should consider buying is one capable of running at 1200 bps/baud (bps = bits per second, often used interchangeably with "baud"—see "A Baudy Tale" in the April '87 ANALOG Computing for more on bps/baud.) Forget any modem slower than that. Most ST files and programs are too large to be transferred at 300 bps. . .unless you don't mind your computer being in transfer mode for an hour or more!

2400 bps is becoming more and more common with ST owners, and with good reason. It is fast! Most people can comfortably read text being transmitted at 300 bps, and can skim text at 1200 bps. At 2400 bps you can only fast-scan it (unless you are a student of Evelyn Wood). At 2400 bps, I was able to scan 100 Forum messages in the Delphi ANALOG Atari SIG in just two minutes! Had I read them all I would have been there much longer. I merely made sure all the incoming text went into my terminal program's capture buffer, and read the messages at my leisure after I hung up. Transferring files at 2400 bps is also much less painful.

As I stressed in "A Baudy Tale" it's a good idea to have a modem which features something of the Hayes modem command set (created for Hayes Microcomputer Products), or at least the Bell 212 standard (something of a subset of the Hayes command set). All four modems I used featured this capability. (Note: the Avatex modem I was using was the 1200hc, not the 1200. The hc model has a fuller Hayes command set than the 1200 model, and is therefore preferable—although both will work. Do not purchase a 1200i, as it's an internal modem and not for the ST!) The reason for wanting such command set compatibility is that the Hayes and Bell 212 command sets are something of a standard in the industry, and most modem software will work with them easily.

Now, let me quickly describe the modems I used (excuse any omissions, but I can't possibly discuss every modem usable with the ST). Unless otherwise noted, the modems all have approximately the same "footprint" as an SF354 or SF314 disk drive, and can therefore be "stacked" under or over them. All the modems feature status lights on their front panels, external power adapters, and female RS232 ports.

Hayes Smartmodem 1200

As a Hayes it features full Hayes compatibility, and it's well built, encased in a tough metal shell. You must plug a phone cord into the modem, but you cannot carry the line "thru" the modem to a phone. If you also need a phone on the same outlet, you'll need a splitter box. The modem can operate at bps rates from under 100 up to 1200. Settings can be altered with Hayes commands, and default settings changed by setting DIP switches located (inconveniently) behind the front panel. The power switch is located around the back of the unit.

Avatex 1200hc

Features pretty thorough Hayes command set compatibility. The 1200hc has a phone cable installed, and a plug for hooking your telephone "thru" the modem. The only problem with the permanently attached cable is that you couldn't quickly replace it if it got damaged. Max speed is 1200 bps. The modem's default settings can be set using DIP switches on the back of the unit. They can also be soft-set using the Hayes commands. The unit is encased in sturdy plastic, and features power, voice/data and 300/1200 bps buttons on its front panel. . .quite handy. This modem is covered by a two-year warranty. Very nice.

Atari SX212

With good Hayes/Bell 212 compatibility, the SX212 is a smart-looking unit, encased in "Atari gray" plastic and featuring diagonal status lights on the front panel. It can transfer data at rates of up to 1200 bps, and features no user alterable hardware switches. However, it can be programmed. The power switch is on the back of the unit, annoyingly placed between the power cord plug and the modem cable. In addition to the RS232 port, there is also an Atari SIO port used for hooking the SX212 to an Atari 8-bitter. There is no phone "thru" port.

Supra Modem 2400

Also with good Hayes compatibility, the Supra Modem 2400 features a Hayesesque metal case, and is decidedly smaller than the other modems, which requires it to be at the top of a peripheral "stack." The front and back panels are closed with black plastic, that seems a tad bit soft. The power switch is on the front of the unit, and the back features a connector for phone line and a "thru" for a telephone. The modem features no DIP switches, but can be programmed, and, unlike the others, can remember your programmed settings even after you turn it off! This because it contains a static RAM chip that holds your own preferred settings (you must save them, of course). Top transmission speed is 2400 bps.

Intro to the Hayes command set

The power of the Hayes command set is that, if your modem supports it, you can program the modem itself. For example, most modems wait about 15 to 20 seconds after dialing a number to get a connection. If they don't get a connection, they hang up. Suppose the number you were dialing takes longer than this to respond. With many cheap modems there's nothing you can do, but with a Hayes compatible modem you can tell the modem how long to wait for a carrier detect (I'll explain this term later) before giving up. This is set using one of the modem's S registers, which are programmable "switches."

S register number 7 holds the value for the "Time to Wait for Ring-back/Carrier." Default is usually 20 or 30 units (units usually equal seconds). You might want to make the modem wait 60 seconds before giving up. To do this you'll need to put the value 60 into the S7 register.

To let the modem know that you are sending a modem command, you need to use the "attention" command, which is "AT" (sans quotes). Some modems require all such commands to be entered in uppercase, else they will ignore them. If you have a modem, turn it on, run your telecommunications software, or even just use the Emulator desk accessory. When you are on the terminal (as in "communications terminal") screen, type AT and press RETURN. The modem should report back OK to this. If not, make sure the modem is on and connected. Also, if you typed lowercase characters, try upper case. Now, we need to use the attention command and tell the modem to put the value 60 into register S7. This is done with the command ATS7 = 60 [RETURN]. The modem will report back OK if it worked.

To see what is currently in a modem register, you type the attention command, the S register value, and a question mark. To see what the contents of register S7 are you would type ATS7? [RETURN], and the modem will report back 60 if you followed the previous step.

Attention commands also precede dialing instructions. The command to dial the phone is ATD (attention—dial.) You would follow this with a phone number like ATD 555-1212 [RETURN]. This tells the modem to dial the specified number. Furthermore, you can tell the modem what sort of dialing to use: pulse (rotary dial) or touch tone. If you have a pulse line, you would add a P to the command, or a T if you have touch-tone dialing, as in ATDP 555-1212 or ATDT 555-1212.

As much as the Hayes command set is a standard, there are still variations. For example, using the command ATAA on the Avatex 1200hc sets the modem to auto-answer state, where it will answer the phone when it rings. Using the same command on the other modems won't work this way, as they see it as an ATA command, causing the modem to go "off-hook." (ATA works on the 1200hc, by the way.) The usual way to set auto-answer on Hayes compatibles requires setting the S0 register to a non-zero number — in other words, telling it to pick up the phone after that number of rings. Zero (the usual default) means it won't answer at all, as in ATS0 ± 2.

A complete list of S registers, modem commands, what they do and how to use them, should appear in your modem's manual.

Hook up and use

Hooking up a modem usable with the ST is usually as simple as purchasing a cable with appropriate 25-pin RS232 serial connectors, plugging one end into the modem and one into the ST's modem port. It also helps if you plug in the modem's power supply (the ST's modem port doesn't provide power for modems) and plug a phone cable from the modem into a phone jack.

Powering up is pretty simple. Unlike disk drives, which usually must be turned on prior to booting the computer, in most cases it doesn't matter when you turn on the modem, although some modems seem to do better if turned on after the computer proper.

Of course, the modem itself isn't of much use unless you have some software to run on it. Telecommunications software is usually known as "terminal" software, meaning it makes your computer/modem system act like a data terminal. The software handles the job of controlling the modem, and sending data to and receiving it from the modem. Some modems come packaged with such software, but as time goes on, less and less of this "bundling" is done, as the packaged software is rarely what the user needs.

One piece of terminal software came with your ST when you bought it. It's the VT-52 terminal emulator desk accessory (DESK2.ACC or EMULATOR.ACC), which, as the name suggests, makes your computer and modem act like a VT-52 data terminal. This software is very limited, and most users find it useless because it completely lacks any documentation. The VT-52 emulator can be used, but be forewarned that it is a terminal only. It features none of the niceties of a good terminal program. To dial with it you must issue dial commands directly to your modem, etc. It does not feature a capture buffer (where the text from your session is held in a buffer in RAM and/or saved to disk) nor can you upload or download files (upload means to send a file up to the system you are communicating with, download means to pull it down from the other system). You can type and read text, and that's about it. Commands for the emulator are Escape-key combinations (like pressing Escape then B).

You're much better off buying a real telecommunications program, like Flash, Interlink ST, or even ST Talk Professional (if it's even shipped yet). Such programs make life much easier. They store lists of phone numbers that the modem can dial, feature capture buffers, support various types of data transfer (uploading and downloading data) and disk and printer support. The more powerful ones have capture buffers that act like mini word processors, letting you edit the text you've saved. They may also let you make "scripts" of commands which will allow your computer to automatically do certain things. For example, such a "script" might be used to make your modem dial a number, and it would then automatically "log on," supplying the system you are calling with information such as your name, password, etc. In some cases, these are so powerful that they can call a system, log on, leave and read messages, etc., and hang up, all without human assistance!

One of the nicest features of most terminal programs is their ability to use a "type ahead buffer." This buffer is usually a single line editor, which allows you to type your commands, use cursor and other editing keys, and only send that line to the other system when you press RETURN. This is handy because editing text on many systems is difficult or slow, if not nearly impossible! Furthermore, you can often edit the line you just sent and re-send it if you goofed typing it the first time!

Even better, some capture buffers allow you to mark certain sections of text as "blocks" which can be saved to disk individually (sans the rest of the buffer contents) or even uploaded to the system you are connected with! You can pretype entire messages in the capture buffer, log on, and upload it.

The odds of getting even

Although the manuals for your terminal program and modem are the best means you have for learning to use them, there are a number of nasty, brutish little details that such manuals often mention in passing that can be a major headache to new users if they fail to have certain options set properly. These "four horsemen" of the beginner's apocalypse are known as "Parity," "Duplex," "Line feeds," and "Block size." Terrible names and terrible pains if you don't know about them!

Parity, if any, sets a "parity bit," an error-checking function used to insure that the data is received exactly as it was sent. Errors occur because of the curse of "line noise," that is, background distortion on phone lines that looks like data to the receiving modem. Hence the need for error checking. However, parity is usually set to NONE, because most good file transfer systems either set it themselves or use their own form of error checking. This usually has little effect on the usual text and typing done in "terminal mode" (when your computer is accessing another and you are reading text, etc.), because such text is usually sent "blind." This means that the receiving computer does not echo back what it received so that the transmitting system can insure it was received correctly. In error-checked modes, such "echoing" is standard procedure. If you are having trouble with garbled data from a system you are calling, you should try changing the parity setting from your terminal program.

Duplex sets the manner in which data is transmitted, either both directions at once (full duplex) or only one way at a time (half duplex.) This is difficult to describe, but the end result of it is that on full duplex, what your computer sends to the other computer is also echoed to your own screen. In this manner, you can see what you're typing. However, if the computer you're communicating with is also echoing the text you send back, you're liable to see something like HHEELLOO when you typed HELLO. On half duplex what you type isn't echoed, and, depending on what the other computer is doing, either you will see what you type properly, or you won't see anything at all!

The ground rule with duplex is simple. If you are on half duplex and can't see what you type, try going to full. If you are on full and are seeing double characters for everything you send, switch to half. If everything looks OK, leave it alone, unless there is a person on the other end of the connection who can't see what you are typing, in which case you might want to experiment a bit with duplex settings on both ends until both of you can see what you need to. There are also some echo options which can be selected in some terminal programs, that may alleviate difficulties changing duplex alone won't solve.

Line feeds are little known by many users of computers, though they happen all the time. When you press RETURN or ENTER on a computer keyboard, usually what happens is the computer carries out a "carriage return/linefeed" combination. The carriage return moves the cursor back to the left margin of the screen. The line feed then drops the cursor down to the next line. Some terminals have a separate Line Feed key, which is used in combination with or in lieu of a RETURN or ENTER key. (Some personal computers have line-feed keys too, check out a Kaypro running CP/M for an example.)

Your ST, modem and software are only "emulating" a data terminal, and do not feature a line feed key. Some systems treat the value for RETURN or ENTER as a carriage return only. You have to send a line feed character separately! Fortunately, most good terminal programs have a line feeds on/off toggle control somewhere. If you find that pressing RETURN returns your cursor to screen left, but doesn't go down a line, try toggling your terminal software's line feed option. Little is more frustrating than typing over what you've typed before, or what another user is typing to you at that same instant!

Block size refers to the size of a data "packet" sent in an error-checked transmission mode, like X modem. The size is usually measured in bytes. The most common size, used by the very common X modem transfer protocol, is 128 bytes (1/8th of a K.) It takes eight standard X modem blocks to make 1K (kilobyte) of data. A modified version of X modem, often called Y modem, uses 1024 byte blocks, meaning each block sent is 1K of data. Some computers do weird, nonstandard things. The dreaded C-64's modem programs often default to sending 256 byte blocks! It's easy to get confused at times. For example, in Flash you can set the X modem protocol to 128 or 1024 byte blocks. The latter is treated as Y modem, but if you forget to change this when you go to a system that doesn't support 1024 byte blocks, you won't be able to transfer any files. If you ever find that you cannot seem to send or receive data when using a file transfer protocol like X modem or Y modem (there's even a Zmodem!) try seeing whether you can change the block size. (Be warned that some terminal programs will not allow you to set this!)

On line survival

With a modem you can call all kinds of computer systems, from your friend's own personal computer to mainframes, superminis, and networks like GEnie or Delphi. There are not too many standards between all these systems, so it's easy to get confused. Many BBS systems (bulletin boards) are dissimilar in all respects from one another, with no similarity in access, log-on, help commands, or log-off (hang up) procedures. Still, if you get stuck where you don't want, don't panic, there are some things you can try. For example, the most common of all "abort" commands is the Control-C combination. In many cases, one of these alone is enough to blast you out of whatever you've stranded yourself in. In other cases, it takes multiple entries of this command. On Delphi for example, you can abort a file upload or download by rapidly pressing Control-C three times in a row. It's unlikely you'll accidentally hit such a control-key combination three times, so that way Delphi is sure you really want to quit.

Control-X and Control-Z are sometimes used, and may or may not help. Often, if you don't know where you are, what to do, or can't see a menu, typing a question mark (?) and pressing RETURN will provide a menu.

If you don't know how to log off of a system, some common commands are BYE, OFF, LOG or LOGOFF. "L" for "logoff" might work from a BBS menu. You should always try to log off properly, not just hang up or turn off your modem, because the other system might not realize what happened and think you are still on line. Some major networks can take a while to realize you're gone if you just hang up, and may still bill you for up to 20 minutes or more of on-line time when you weren't there, all because you failed to "sign off" properly!

In a real emergency, you can resort to turning off your modem, as that will break the connection. It's not really the best way to handle things, but when all else fails....

Log off

This article, like others on so diverse and complex topics as telecommunications, tends to be a mish-mash of information. As I stated earlier, additional and worthwhile sources of information are in any documentation you have for your modem or terminal software. Also, the aforementioned original "A Baudy Tale" article may also be of help.