Microsoft KB Archive/80258

= PC Gen: Contents of Modem Script File IBM5853.MDM =

Article ID: 80258

Article Last Modified on 10/30/2006

-

APPLIES TO


 * Microsoft Mail for PC Networks 2.1e

-



This article was previously published under Q80258



SUMMARY
The following is the contents of the Microsoft Mail version 2.1e modem script file IBM5853.MDM, which can be compiled with SCRCOMP.EXE: ;*********************************************************************
 * Microsoft Mail Script File
 * Filename: ibm5853.mdm
 * Date   : March 21, 1990
 * Script : Standard script file for IBM 2400 bps modems
 * This modem has a set of 8 switches on the rear panel. These
 * switches should be set as follows:
 * 1 2  3  4  5  6  7  8
 * ON  X  X  X  X     X  X  X
 * OFF             X
 * This script file contains the standard modem setup strings used
 * by the External, Transmit and Listen programs. There are five
 * procedures defined in this script file for setting up the modem and
 * for connecting to a remote External machine.
 * The modem setup strings used here will be adequate for most
 * people but there may be some changes required if you are dialing
 * overseas and require a longer wait for Carrier Detect (S7 register)
 * or if you wish to change the speaker volume. Note that if you used
 * the -Innn option in version 1.0 or 2.0 that you will have to modify
 * the S7 register and recompile this script file.
 * Consult your modem manual for more information on setup options.
 * Script procedures defined:
 * INITIALIZE
 * RESET
 * CALL
 * ANSWER
 * DISCONNECT
 * Return codes for External, Transmit, Listen:
 * 0 - OK
 * 1 - CONNECT 300
 * 2 - not defined
 * 3 - NO CARRIER
 * 4 - ERROR
 * 5 - CONNECT 1200
 * 6 - not defined
 * 7 - BUSY
 * 8 - NO ANSWER
 * 9 - not defined
 * 10 - CONNECT 2400
 * 11 - not defined
 * 12 - CONNECT 9600 (high speed connection)
 * 3 - NO CARRIER
 * 4 - ERROR
 * 5 - CONNECT 1200
 * 6 - not defined
 * 7 - BUSY
 * 8 - NO ANSWER
 * 9 - not defined
 * 10 - CONNECT 2400
 * 11 - not defined
 * 12 - CONNECT 9600 (high speed connection)


 * Special Notes Regarding the IBM 5853 Modem:
 * While the line is ringing (you can here it ring), this modem will
 * not accept any modem commands, including &quot;ATA&quot;, the command
 * required to answer the phone. Commands can be issued to the modem
 * only when the modem stops ringing completely, or when it is in
 * between rings.
 * &quot;ATZ&quot; cannot be issued safely between line rings, because this
 * command would cause this modem to go off-hook and goes into data
 * mode, and no further; modem commands are accepted until DTR is
 * dropped, or 50 seconds later. ( The &quot;ATZ&quot; command would not reset
 * the modem as well when the modem goes off-hook this way. The
 * sequence &quot;+++&quot; would not bring the modem back to AT command mode
 * either. )
 * the modem as well when the modem goes off-hook this way. The
 * sequence &quot;+++&quot; would not bring the modem back to AT command mode
 * either. )

INITIALIZE: title &quot;IBM 2400bps modem Script&quot;

baud 2400                ; set the baud rate display &quot;  Baud Rate : 2400&quot; $attempts = 5

init_retry: if (ri = 1)              ; see if phone is ringing goto init_retry

dtr 0                    ; make sure modem is On-Hook wait 1 dtr 1

sendln &quot;ATZ&quot;             ; reset modem to default settings

wait 2 waitrsp 1

if (&quot;0&quot; isin response) goto reset_okay

if (&quot;OK&quot; isin response) { reset_okay: if (ri = 1)          ; see if phone is ringing goto reset_okay

sendln &quot;ATE0M1V0X1&quot;

wait 1 waitrsp 1

if (&quot;0^M&quot; isin response) { set_options: if (ri = 1)     ; see if phone is ringing goto set_options

sendln &quot;ATS0=0S7=45S9=6S10=50S12=50&quot;

waitrsp 1 if (response = &quot;0^M&quot;) return 0 }            }        dec $attempts if ($attempts > 0) goto init_retry

return 4

RESET: baud 2400                ; set the baud rate display &quot;  Baud Rate : 2400&quot; $attempts = 5

init_retry: if (ri = 1)              ; see if phone is ringing goto init_retry

dtr 0                    ; make sure modem is On-Hook wait 1 dtr 1

sendln &quot;ATZ&quot;             ; reset modem to default settings

wait 2 waitrsp 1

if (&quot;0&quot; isin response) goto reset_okay

if (&quot;OK&quot; isin response) { reset_okay: if (ri = 1)          ; see if phone is ringing goto reset_okay

sendln &quot;ATE0M1V0X1&quot;

wait 1 waitrsp 1

if (&quot;0^M&quot; isin response) { set_options: if (ri = 1)     ; see if phone is ringing goto set_options

sendln &quot;ATS0=0S7=45S9=6S10=50S12=50&quot;

waitrsp 1 if (response = &quot;0^M&quot;) return 0 }            }        dec $attempts if ($attempts > 0) goto init_retry

return 4

CALL: $ret = 8              ; set default ret code to &quot;no answer&quot;

clearrsp              ; clear the response buffer

echo 0                ; do not display phone number

sendln &quot;ATD&quot; + dial_mode + phone_number ; execute the dial up

echo 1                ; turn echo back on

waitrsp 120           ; wait up to 2 minutes for return code ;   from modem

if (response = &quot;1^M&quot;) {         baud 300 display &quot;>>> CONNECT 300 <<<&quot; $ret = 1 }       else if (response = &quot;3^M&quot;) {         display &quot;>>> NO CARRIER <<<&quot; $ret = 8            ; no answer or no connect }       else if (response = &quot;5^M&quot;) {         baud 1200 display &quot;>>> CONNECT 1200 <<<&quot; $ret = 5 }       else if (response = &quot;7^M&quot;) {         display &quot;>>> BUSY <<<&quot; $ret = 7            ; busy }       else if (response = &quot;10^M&quot;) {         baud 2400 display &quot;>>> CONNECT 2400 <<<&quot; $ret = 10 }       else if (response = &quot;25^M&quot;) {         baud 1200 display &quot;>>> CONNECT 1200/ECL <<<&quot; $ret = 5 }       else if (response = &quot;30^M&quot;) {         baud 2400 display &quot;>>> CONNECT 2400/ECL <<<&quot; $ret = 10 }

return $ret           ; return connect baud rate to                               ;    application

ANSWER: $ret = 8              ; set default ret code to &quot;no answer&quot;

waitrsp 1             ; see if phone is ringing

if (&quot;2^M&quot; isin response) ; 2 is numeric form of &quot;RING&quot; { answer_retry: if (ri = 1)       ; if phone actually ringing at this ;   moment goto answer_retry

if (listen = 1)   ; see if Listen program is running or                sendln &quot;ATD&quot;   ; not answer phone in originate mode ;   (Listen) else sendln &quot;ATA&quot;  ; answer the phone normally

waitrsp 120       ; wait up to 2 minutes for return code ;   from modem

if (response = &quot;1^M&quot;) {             baud 300 display &quot;>>> CONNECT 300 <<<&quot; $ret = 1 }           else if (response = &quot;3^M&quot;) {             display &quot;>>> NO CARRIER <<<&quot; $ret = 8            ; no answer or no connect }           else if (response = &quot;5^M&quot;) {             baud 1200 display &quot;>>> CONNECT 1200 <<<&quot; $ret = 5 }           else if (response = &quot;10^M&quot;) {             baud 2400 display &quot;>>> CONNECT 2400 <<<&quot; $ret = 10 }           else if (response = &quot;25^M&quot;) {             baud 1200 display &quot;>>> CONNECT 1200/ECL <<<&quot; $ret = 5 }           else if (response = &quot;30^M&quot;) {             baud 2400 display &quot;>>> CONNECT 2400/ECL <<<&quot; $ret = 10 }           }

return $ret           ; return connect baud rate to                               ;    application

DISCONNECT: wait 2                ; wait 2 seconds

send &quot;+++&quot;            ; send escape sequence to put modem ;   back to command state wait 2                ; wait 2 seconds

clearrsp              ; clear the response buffer

sendln &quot;ATH0&quot;         ; hang up the phone

waitrsp 1             ; wait for a response

if (response != &quot;0^M&quot;) ; if hang up failed, drop DTR to force ;   hang up            { DTR 0             ; drop DTR to reset modem wait 2            ; some modems require a delay here DTR 1             ; raise DTR clearrsp          ; clear response buffer }

return 0              ; always return OK

Additional query words: 2.10 2.1 2.10e

Keywords: KB80258

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.