AT3 is an OS/2 program with limited but useful functionality:
AT3 may be used for private personal use only, not in a commercial or business environment. Please contact the author if you have a business need for AT3.
AT3 may be distributed freely, without charging a fee, as long as it remains a complete package as originally distributed and no other changes are applied without the explicit permission by the author.
AT3 is distributed as ZIP file (AT3_16C.ZIP) with the following contents
AT3 builds the AT command to be sent to the modem from the commandline. The modem command may be specified as a single string or as separate words. AT3 will concatenate the whole commandline into a single string. The string will be preceeded with 'AT' and terminated with a Carriage Return character (ASCII 13).
The string will be sent to the modem in 8-bit, NO parity, 1 stop-bit mode.
AT3 accepts 2 optional commandline parameters to control its behaviour. These must be specified as first parameters on the OS/2 commandline and must be numeric to distinguish them from being part of the modem command. These parameters will not be sent to the modem. AT3 will send the first non-numeric and all subsequent parameters (even if numeric) to the modem.
When either the port is not available (not installed or in use), or the speed is not an acceptable value for OS/2, AT3 will terminate with an error message, and not issue any AT-command. The most common errors are:
AT3 does not perform any kind of syntax checking for modem commands.
AT3 sends the modem reply to the stdout stream, which will normally mean it will appear on the computer screen. The output may be redirected as with any other normal OS/2 command.
Some modems reply to some commands with a number of pages of output, and require user interaction (the Enter-key) for each subsequent page of output. AT3 takes care of this, such that the modem reply will appear as a single reply to the user. See Multiple modem replies for a special case.
When AT3 is invoked without any parameter, some help information is displayed, and a returncode of 1 is returned.
When the modem does not reply, the returncode of AT3 will have the value 255. This may however not be a real error, for example the modem may be in echo-off state or be programmed to never respond.
When encountering some kind of problem during execution, AT3 displays a message indicating the last executed function (DosOpen, DosRead, DosDevIOCtl, etc), and the returncode of that function. This returncode is also returned in 'errorlevel' for use in batch files.
Below some examples of the use of AT3:
These are just examples, use your imagination and your modem manual!
AT3 can also be used from a batch file or a REXX procedure.
As an example this AT3 package contains a file
IBM7855A.CMD to customise an IBM 7855-010 modem
for use by an asynchronous communications package.
With a slight modification (&M2 in stead of &M0) the modem is
started-up in sync-mode with power-on.
So the modem can be used in SDLC-mode with an SDLC-card, and in Asynchronous
mode after switching it to an Asynchronous communications port.
The modem reply may also be catched and processed in the same REXX procedure which issued the modem command with AT3. See the file AT3R.CMD for an example.
AT3 does not set DTR true during execution by default. The main reason for this is that modems which are programmed with a phone number to be dialed when DTR becomes true might inadvertently start to dial that number when AT3 only tries to deliver an AT command. On the other hand there are modems which do not accept AT commands when DTR is not true, and almost certainly will not deliver replies in that case!
To make AT3 useful for modems which require DTR being true before accepting AT-commands, AT3 scans for the environmentstring "AT3" during startup. When this string is set to "DTR", AT3 activates the DTR lead before delivering its AT-command, and drops it at termination. Otherwise AT3 keeps DTR false.
So enter (e.g. in your CONFIG.SYS):
SET AT3=DTRin case you have a modem that needs DTR to work with AT3. If you don't know, just try without this SET command to see if AT3 works as desired. If not then make it work with this enviroment setting.
NOTE AT3 makes RTS true during execution, otherwise hardly any modem would listen to commands from the computer.
When you want to use AT3 for dial commands, then you need to set the environment variable slightly different, for example:
SET AT3=DTR,500
Hardly any modem will execute a dial-command without DTR being true. But also the default timeout value of AT3 (0.5 seconds), is too short to wait for the completion of a dial command. DTR will be turned off after that time, which will cause the modem to abort the dial operation. The value of '500' in the example above modifies the standard timeout to 5 seconds (the value is expressed in hundredths of seconds), which will generally be large enough for tone-dialing. You may have to experiment with your modem to find the right value for your modem, your dial-command or your telephone network.
Warning: Any value greater than 0 is accepted, but a very low may cause AT3 to terminate before the modem had a chance to reply, especially with ERROR replies! You should experiment.
The following minor restrictions may cause you some inconvenience
AT3 is not a stand-in for the MODE command
The exception is the setting of port-speed. Using the MODE-command just for setting the speed of the COM-port has the potential problem that it may set DTR true.
Use AT3 to address your modem, use MODE to control your COM-port.
This chapter is meant to give some background information about the design of AT3.
It was originally designed for just switching a modem from SYNC to ASYNC mode (and vice versa) in a situation where communications services are used of which some use Synchronous (SDLC) protocol and others use Asynchronous protocol. This could be done with redirecting an ECHO command (ECHO ATE1 >COM1), which works perfectly for DOS in combination with some modems. However, OS/2 and some other modems behave differently.
MODE and ECHO may result in DTR becoming true (and may stay true!). And the modem might have been prpgrammed to dial a phone number from its profile to a SYNC connection point when DTR becomes true. This may have some undesirable effects:
Some modems reply with multiple output pages to show the configuration after being requested so (for example with the command AT\S or AT&V). The operator is requested to hit the ENTER key before the modem shows the next page of information. AT3 tries to anticipate on this situation by sending a CR (Carriage Return) character when the modem stops sending data. If this works for your modem you'll get the modem-configuration in 1 single outputstream. Otherwise the modem will probably stack the remaining pages and send them at the next occasion, for example when your 'real' communications program opens the COM-port!
To play it safe AT3 assumes that every modem reply is in multi-page mode. To determine the real end of the modem reply AT3 sends a CR character after it did not receive any data for a period of the timeout value, and waits again for this time. So the minimum elapsed time before AT3 terminates is at least 2 times the timeout value. Please read the following section for a possibility to speedup AT3!
AT3 waits by default about 0.5 seconds for the modem to start transferring a reply as reaction on the AT command. Most modems react much faster! On the other hand it is short enough to let AT3 terminate quickly when there is no reply, or even when there is no modem connected to the port at all.
You might experiment with shorter timeout values. This can be accomplished with the environment variable as described with Dialing, for example you might specify:
set AT3=DTR,10to obtain a 0.10 second timeout value.
AT3 is written in C-language, and uses the standard OS/2 Application Programmers Interface and functions provided by the COM-port driver COM.SYS for OS/2 2.0 and newer. The program has been compiled with IBM C/C++ 2.0 and IBM Program Development Toolkit for OS/2 Warp.
Comments, suggestions or problem reports can be sent to the E-mail
address listed in the header of this document.
Please provide all relevant information.
I cannot guarantee that any additional functionality will be
implemented, but I'll certainly do my best when your requirements would mean
a useful improvement or extension of AT3!
Below a summary of changes with each version.
For an example of the use of AT3 to custimise a modem, you may have a look at the provided sample REXX procedure IBM7855A.CMD.
When you need to analyse the modem reply in a REXX procedure
AT3R.CMD shows you a possibility.