:S
; This GO file configures Multi-Tech 9600 baud and higher speed modems
; for use with AUTOLOG. This includes model series 932, 1432, 1932 and 2834.
; revised 6/27/94 rpr - added support for MT2834 series
; revised 1/24/94 rpr - added support for ZDX models
; revised 11/2/92 rpr - added support for "BL" and "1432MU" models
; revised 9/29/92 klb - added #P0, $$R1, and %E3 commands for newer models
;                     - "d/c" changed to "--" for "don't care" switch settings
; revised 1/28/92 rpr - added MultiModem II revisions (new switches & firmware)
; revised 9/4/91 rpr - added test for MT1432 and added &RF commands as needed
; revised 3/22/91 rpr -&F used for reset instead of %F & added SLEEP before
; a couple of AT commands.
; revised 4/13/91 to work with MUL932EAF modems
terse
carrier false
FOLD T
RELINK:
:<              Programming High Speed Multi-Tech modem
                 (Series 932, 1432, 1932 and 2834 modems)

If you have not already LINKED to the TRMDEF attached to the modem,
enter the command LINK followed by the name of the modem port and a RETURN.
If you have already LINKED to the modem port, just press RETURN.
(To quit, enter Q and a RETURN.)
>
       SET ERR0=0              ; reset ERR0 to 0
:K
       SAY "^M"                ; evoke error message if not linked
       IF ERR0=246 GOTO RELINK
:S
       SET REG(4)=0            ; 0=no input flow, 1=RTS input flow
       SET REG(5)=0            ; 0=old 932s, 1=Multimodem II 2=1432EAB 3=932EAF
:<Getting modem information - this may take a few seconds...>
; get modem out of data mode
       HANGUP                  ; get modem's attention
       stall
       delay 30m
       SLEEP 2
       SAY "+++"
       SLEEP 2
       SAY "ATEQ^M"
       UNTIL "OK" 1
       IF ERR0=0 GOTO GOT'OK
       SAY "ATS2=43S3=13^^"            ; deal with very old MULTI driver quirks
GOT'OK:
; make sure modem is 932, 1432, 1932 or 2834 model
       SET REG(2)=0
       SLEEP 0.5
       SAY "ATEQI0^M"          ; get firmware #
       SLEEP 1.5
       IF "144" SET REG(2)=2   ; 1432  v 1.04 firmware
       IF "2432" SET REG(2)=2  ; 932EH v 1.04 firmware
       IF "247" SET REG(2)=2   ; 932EH v 1.07 firmware or newer model
       IF "2834" SET REG(2)=3  ; 2834 (current firmware doesn't do this?)
       IF "24" GOTO ITS'A'224  ; 224 or 224E
       IF "696" GOTO ITS'A'696 ; 696E
       IF REG(2)<2 GOTO NOT'SUPPORTED
:S
       IF ""                   ; clear buffer
       SLEEP 0.5               ; standard wait-before-AT-command
       SAY "ATI2^M"            ; query modem as to model
       SLEEP 1
       IF "2834" SET REG(2)=3  ; handle undistinguished response of MT2834
       IF "BA" SET REG(5)=1    ; MultiModem II
       IF "BL" SET REG(5)=1    ; MultiModem II (lease line)
       IF "BR" SET REG(5)=1    ; MultiModem II (rack mount)
       IF "EH" SET REG(5)=0    ; we have old modem MT932EH
       IF "ZDX" SET REG(5)=4           ; ZDX models - no switches
       IF "1432MU" SET REG(5)=4        ; pocket modem
       IF "1432EAB" SET REG(5)=2       ; MT1432EAB -Unix spoofing on #4
       IF "932EAB" SET REG(5)=0        ; MT932EAB -old style switches
       IF "932EAF" SET REG(5)=3        ; MT932EAF -Unix spoofing on #4
       XY=0
       IF REG(5)=1 GOTO NEW'CASE       ; MultiModem II (metal case)
       IF REG(5)=2 GOTO EAB'CASE       ; 1432EAB (plastic case)
       IF REG(5)=3 GOTO EAB'CASE       ; 1432EAB (plastic case)
       IF REG(5)=4 GOTO TINY'CASE      ; Mu pocket modems
OLD'CASE:
:<              Programming Multi-Tech 932EH & 932EA Modems
                              (Plastic cases)

Please use the recommended cable from Appendix of your manual. Otherwise,
the modem may not perform properly!

There are two DIPswitches on the bottom of the modem.
Set the _4_ position DIPswitch on the bottom of the modem as follows:

       Segment   Position      Effect
          1         up         Force CTS on until we program modem 1st time
          2         up         Select Dial-Up rather than leased line mode
          3        down        Select Multi-Tech codes (better than Hayes)
          4        down        Asynchronous Operation

>
GOTO OFF'THE'MODEM
NEW'CASE:
:<

There are sixteen DIPswitches on the side of the MultiModem II with the metal
case. Set the DIPswitch segments as follows:

       Segment   Position      Effect
          1        up          DTR dependent on interface
          2        up          Hardware flow control
>
if reg(2)>2 goto now'leased
:<           3        up                disable command responses
>
goto new'case'4
now'leased:
:<           3        up                -10Db/0Db permissive/leased line
>
new'case'4:
:<           4        up                Unix protocol spoofing disabled
          5        --          don't care (auto answer is up)
          6        up          Maximum throughput on
          7        down        RTS dependent on interface (for now)
          8        down        enable command mode
          9        down        local digital loopback off
          10       up          dialup operation (down for leased)
          11       down        Multi-Tech responses
          12       down        Asynchronous operation
          13       up          9600 baud operation
          14       up          9600 baud operation
>
if reg(2)>2 goto now'cd'dsr
:<          15        up                not used
>
goto new'case'16
now'cd'dsr::
:<          15        up                CD/DSR from interface
>
new'case'16:
:<           16       --                not used

>
GOTO OFF'THE'MODEM
EAB'CASE:
:<
         There are two DIPswitches on the bottom of EAB & EAF modem.
Set the _8_ position DIPswitch on the bottom of the modem as follows:
       Segment   Position      Effect
          1        up          DTR dependent on interface
          2        up          Hardware flow control
          3        up          disable command responses
          4        up          Unix protocol spoofing disabled
          5        --          don't care (auto answer is up)
          6        up          Maximum throughput on
          7        down        RTS dependent on interface (for now)
          8        down        enable command mode
          9        down        local digital loopback off

Set the _4_ position DIPswitch on the bottom of the modem as follows:
          1        down        local digital loopback off
          2        up          dial-up operation
          3        down        Multi-Tech result codes
          4        down        Asynchronous operation

>
OFF'THE'MODEM:
:<
After you have set the switches accordingly, turn the modem off so that it
will reset.  Wait a few seconds. Turn the modem back on. Then press RETURN. >
:K
TINY'CASE:
SET ERR0=0
REBAUD:
:<
If you wish to use the modem at a constant baud rate, enter BAUD followed by
the baud rate desired for the serial port, else press RETURN.
>
:R
:K
IF ERR0#0 GOTO REBAUD
:S
:<
If you are running AMOS/L 1.3D, AMOS/32 1.0D, AMOS/x 2.0A, or a later
operating system, AND you are connecting pin 4 of the modem to an input flow
control pin on the computer, enter GOTO FLOW. Otherwise, press RETURN.
>
:K
       GOTO SKIP'FLOW
FLOW:
flow:
Flow:
       SET REG(4)=1
       GOTO TONE'PULSE
SKIP'FLOW:
       SET REG(4)=0
TONE'PULSE:
:<
For TONE dialing, press RETURN. For PULSE dialing enter GOTO PULSE.>
:K
       SET REG(6)=1
       GOTO FLOW'CHOICE
PULSE:
Pulse:
pulse:
       SET REG(6)=0
FLOW'CHOICE:
; handle choice of baud rate handling
:<

We recommend that you configure the modem to use speed conversion to have
INDEPENDENT speeds for the serial and modem ports of the modem. This generally
means that neither incoming or outgoing callers need worry about baud rate
matching.

However, if you have a special application that expects the modem to switch
its serial baud rate with every call (like an old Hayes modem), then you need
to enter the command GOTO OLD and a RETURN below.

Press RETURN to use INDEPENDENT rates, or enter GOTO OLD for special uses. >
:K
IND:
Ind:
ind:
:<
You have selected to use speed conversion for INDEPENDENT serial and modem
rates.  The serial port baud rate will remain constant and the modem baud rate
will be adjusted to match the remote modem's baud rate.
>
SET REG(3)=1
GOTO PROCEED
OLD:
old:
Old:
:<
You have selected to use the traditional mode where the modem and serial baud
rates must always match. You must use the /CHANGE switch when you specify
the modem driver. This informs AUTOLOG to change the serial baud rate to track
the connect rate of each call.
>
SET REG(3)=2
PROCEED:
:<
Resetting modem to factory defaults...>
       SLEEP 2
       IF ""
:<.>
       SLEEP 0.5
       SAY "AT&F^M"                    ; reset to factory defaults
:<.>
       UNTIL "OK" 5                    ; wait for response (depends on switches)
       SLEEP .5
       SAY "ATQ0^M"                    ; some models reset to Quiet mode
       UNTIL "OK" 2                    ; get  modem's attention after reset
                                       ; (some ignore 1st cmd after &F)
       IF ""
       SLEEP .5
       SAY "ATEQV1^M"                  ; make sure we get a verbose result code
:<.>
       UNTIL "OK^M^J" 2
       IF ERR0#0 GOTO NOOK
:S
; first set values common to all models
:<
Programming modem to allow X/Y/MODEM & AUTOLOG file transfers>
       SLEEP .5
       IF ""
       SAY "AT"        ; command prefix
       IF REG(6)=1 SAY "T"     ; tone dialing
       SAY "V1"        ; verbose results
       SAY "X4"        ; report BUSY, DIALTONE, NO DIALTONE
       SAY "&E1"       ; auto-reliable (&E0=MNP off, &E2=MNP only)
       SAY "&E4"       ; CTS modem-initiated flow control
       SAY "&E7"       ; XON/XOFF passed through
       SAY "&E10"      ; XON/XOFF flow control disabled in Normal Mode
; only use pacing (input flow control) if user wants it!
       IF REG(4) = 1   SAY "&E13"      ; Pacing On
       SAY "&E15"      ; enable data compression
       SAY "^M"        ; finish the AT command
:<.>
       UNTIL "OK^M^J" 2
       IF ERR0#0 GOTO NOOK             ; modem is not responding.
; &Q commands changed - try &Q0 first, then &Q0&Q3 for later firmware
       SLEEP .5
       SAY "AT&Q0^M"           ; standard result codes (not Hayes)
:<.>
       UNTIL "OK^M^J" 2
       SLEEP .5
       SAY "AT&Q0&Q3^M"        ; all possible result codes, B selects Bell
:<.>
       UNTIL "OK^M^J" 2
; set modem's default serial baud rate to current serial baud rate
       SLEEP .5
       SAY "AT$$SB"            ; $$ is a single dollar sign due to macros
       SAY SERIAL'BAUD         ; send the serial baud rate as decimal number
       SAY "^M"
       :<.>
; don't check for error - SERIAL'BAUD verb only works under AUT 3.0 & higher
; and without a valid buad rate, SB command is ignored
       UNTIL "OK^M^J" 2
; set idle disconnect to 15 minutes
       SLEEP .5
       SAY "ATS30=15^M"
:<.>
       UNTIL "OK^M^J" 2
; set other options and values
       SLEEP .5
       SAY "AT"
       SAY "$$A1"      ; buffer data during MNP link attempt
       SAY "S7=60"     ; extend connect wait time to 60 seconds for
                       ; slow long distance & int'l calls
; handle baud rate handling
       IF REG(3)=1 SAY "$$BA0^M"       ; serial baud rate constant, modem
                                       ; handles speed conversion
       IF REG(3)=2 SAY "$$BA1^M"       ; serial baud rate varies, software
                                       ; handles speed conversion
       SAY "^M"
:<.>
       UNTIL "OK^M^J" 2
       IF ERR0#0 GOTO NOOK             ; modem is not responding.
; add AT&RF1 for MT932B. Allow modems that don't support the &RF command
; to just give an error message, and continue.
       IF REG(4)=0 GOTO SKIP'RF'SET
       IF REG(5)=0 GOTO SKIP'RF'SET    ; only 1432 & newer have &RF
       SLEEP 0.5
       SAY "AT&RF1^M"
       UNTIL "OK^M^J" 2
SKIP'RF'SET:
; added #P0, %E3, and $$R1 for newer models. Allow modems that don't support
; these commands to give error message and go on.
       SAY "AT%E3^M"   ; allow +++ or BREAK escape sequence
       UNTIL "OK^M^J" 2
       SLEEP 0.5
       SAY "AT#P0^M"   ; no parity in 11 bit mode
       UNTIL "OK^M^J" 2
       SLEEP 0.5
       SAY "AT$$R1^M"  ; disconnect after 12 retransmits
       UNTIL "OK^M^J" 2
       SLEEP 0.5
       SAY "AT#B1^M"                   ; make modem more compatible in answer
                                       ; mode with old 1200 & 2400 modems
       UNTIL "OK^M^J" 2
       SLEEP 0.5
       SAY "ATQ1&W0^M"                 ; save this configuration for power up.
       SLEEP 1
:<

Your modem has been programmed - these settings will be restored every time
the modem is turned on.  Please perform this installation procedure each time
you change the port, cable, modem or BAUD RATE of the I/O port!!!

>
IF REG(5)>0 GOTO NOT'EH
:<
Now change the 4 position DIPswitch segment 1 to down to enable
hardware flow control.

Press RETURN when you have checked this switch : >
:K
>
NOT'EH:
IF REG(5)#0 GOTO SKIP'JUMPS
:<Look at the label on the bottom of modem that explains the functions of
DIP switch position #7. If the label indicates the following for DIPswitch
position #7:

+-----------------------------------+
| Single Line setting for RJ-11     |
| Multi-line setting for RJ12/13    |
+-----------------------------------+

then enter GOTO JUMPER and press RETURN. If Switch #7 is not labeled as above,
just press RETURN here:>
:K
GOTO SKIP'JUMPS
JUMPER:
Jumper:
jumper:
:<
Take the white plastic cover off the modem and make sure that the modems
internal jumper plugs (====) are set as follows: (See modem's manual section
9.4 through 9.6 for pictures)

                       back of modem
+---------------------------------------------------------------+
>
IF REG(4)=0 GOTO NO'FLOW
:<| RTS o====o    o     (RTS Functions Normally _NOT DEFAULT!_ )|
>
GOTO DRAW'CTS
NO'FLOW:
:<| RTS o    o====o     (RTS Forced On)                         |
>
DRAW'CTS:
:<|                                                             |
| CTS   o====o    o     (CTS independent of RTS)                |
|                                                               |
| DSR   o    o====o     (DSR follows CD)                        |
+---------------------------------------------------------------+
                       front of modem
>
       GOTO SHOW'SETTINGS
SKIP'JUMPS:
       IF REG(5)=4 GOTO NO'SWITCHES
       IF REG(4)=0 GOTO SEVEN'DOWN
:<
Orient the modem so you can see the DIPswitches. Make sure that
switch segment #7 is in the UP position. This setting allows
input flow control to function.
>
       GOTO SHOW'SETTINGS
SEVEN'DOWN:
:<
Orient the modem so you can see the DIPswitches. Make sure that
switch segment #7 is in the UP position. This setting allows
input flow control to function. (You indicated the port doesn't
support input flow control.)
>
SHOW'SETTINGS:
:<
Press RETURN when you have checked that the switch or jumper has been
set as detailed above.
>
:K
NO'SWITCHES:
:<
Here are the settings for your modem. You can see the settings by pressing
ATL5L7 and a RETURN any time you are linked to the modem and in TALK
mode.

>
IF ""
:R
SAY "^X^M"
SLEEP 1
SAY "ATL5L7^M"
PEEK 2
IF REG(3)=2 GOTO DVR2
:<
Use the command MODEM SMART after linking to this modem.
>
:X
DVR2:
:<
Use the command MODEM SMART/C after linking to this modem.
>
:X

NOOK: :<
           M O D E M   D O E S   N O T   A C K N O W L E D G E !

Check for these kinds of things:
       1. No power                  (Plug it in)
       2. Bad cable                 (See Appendix A)
       3. Improper switch settings  (See Appendix D)
       4. Bad baud rate             (Use 2400 Baud)
       5. You did not understand screen instructions - try again
       6. Bad modem                 (Try another one)
       7. ????                      (Replace :S in this GO file with :T)

Multi-Tech's toll free number for tech support is (800) 328-9717
>
:X
ITS'A'224:
:<
The modem is reporting that it is a Multi-Tech 224, not a 932.
Enter Q and RETURN to quit, or press RETURN to program as a 224.
>
:K
GO MUL224
:X
ITS'A'696:
:<
The modem is reporting that it is a Multi-Tech 696, not a 932.
Enter Q and RETURN to quit, or press RETURN to program as a 696.
>
:K
GO MUL696
:X
NOT'SUPPORTED:
:<
         THIS MODEM IS NOT A SUPPORTED HIGH SPEED MULTI-TECH MODEM

                       PROGRAMMING SEQUENCE ABORTED
>
:X
BAD'FIRMWARE:
:<
This configuration file does not support your modem firmware. As modem
firmware changes (which happens about 5 times a year), this file becomes
outdated. If you have a signon to our update system, look for a newer version
there.
>
F