IDENTIFICATION DIVISION. PROGRAM-ID. CI$INITIALIZE_USR_MODEM. DATE-WRITTEN. 25-Mar-1985. DATE-COMPILED. *AUTHOR. Ken Richardson. * * This program initializes a U.S. ROBOTICS modem to the correct * parameters for VMS, e.g. quiet mode (no RING or CONNECT messages * sent to VMS). * * To the glory of God. * ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. symbolic carriage-return is 14 . SOURCE-COMPUTER. VAX. OBJECT-COMPUTER. VAX. DATA DIVISION. WORKING-STORAGE SECTION. 01 program-variables. 02 record-sub pic s9(09) comp. 02 iosb. 03 iostatus pic s9(4) comp. 03 iobytes pic s9(4) comp. 03 ioterminator pic s9(4) comp. 03 ioterminator-size pic s9(4) comp. 01 program-constants. 02 ws-true pic x(01) value "T". 02 ws-false pic x(01) value "F". 02 ss$_normal pic s9(09) comp value is external ss$_normal. 02 unformatted-write-command pic s9(9) comp. 02 write-command pic s9(9) comp value external io$_writepblk. 02 unformatted-io-modifier pic s9(9) comp value external io$m_noformat. 02 modem-initialization-variables. 03 initialization-record-table. * The U.S. Robotics modems can take up to 60 characters on a command line. * Z - Reset modem to power-on register values * E0 - Echo off * Q1 - Result messages made "Quiet" 04 command-1. 05 filler pic x(01) value carriage-return. 05 filler pic x(59) value spaces. 04 command-2. 05 filler pic x(04) value "AT Z". 05 filler pic x(01) value carriage-return. 05 filler pic x(55) value spaces. 04 command-3. 05 filler pic x(08) value "AT E0 Q1". 05 filler pic x(01) value carriage-return. 05 filler pic x(51) value spaces. 04 command-1-size pic s9(9) comp value 1. 04 command-2-size pic s9(9) comp value 5. 04 command-3-size pic s9(9) comp value 9. 03 initialization-record-array redefines initialization-record-table. 04 initialization-record occurs 3 pic x(60). 04 initialization-record-size occurs 3 pic s9(9) comp. 03 initialization-record-count pic s9(9) comp value 3. 01 timer-things. 02 time-delay-variable pic x(8) value "0 0:0:01". 02 delta_time comp-2. 01 program-switches. 02 program-aborting-sw pic x. 88 program-aborting value "T". LINKAGE SECTION. 01 modem-channel pic s9(9) comp. 01 modem-return-status pic s9(9) comp. PROCEDURE DIVISION using modem-channel, modem-return-status. Initialize-modem. compute unformatted-write-command = write-command + unformatted-io-modifier call "sys$bintim" using by descriptor time-delay-variable by reference delta_time move ws-false to program-aborting-sw perform varying record-sub from 1 by 1 until record-sub > initialization-record-count or program-aborting call "sys$qiow" using by value zero by value modem-channel by value unformatted-write-command by reference iosb by value 0 by value 0 by reference initialization-record ( record-sub ) by value initialization-record-size ( record-sub ) by value 0 by value 0 by value 0 by value 0 giving modem-return-status * The US Robotics modems pause 250 milliseconds after receiving a command, so we wait one second after giving each one: if modem-return-status = ss$_normal then if iostatus = ss$_normal then call "sys$schdwk" using by value zero by value zero by reference delta_time by value zero call "sys$hiber" else move iostatus to modem-return-status move ws-true to program-aborting-sw end-if else move ws-true to program-aborting-sw end-if end-perform exit program .