|
BLAST Protocol | Xmodem | FTP | BLASTscript Topics | Connecting/Disconnecting Command Ref. | Reserved Variables | Autopoll | Error Messages | ASCII Char. Set |
CONNECT statement is executed in a script. Disconnecting is managed in a similar way. It's important to understand the structure and operation of the scripts in the Modem\ and Systems\ directories--and how you can modify them.
The Modems\ and Systems\ directories can be viewed as script "libraries" that provide the information Data Pump needs to control your modem and log onto remote computers. These libraries are collections of separate scripts named with the filename extension ".scr." The General Properties Page of the phonebook listing provides a list of valid Modem Types and System Types based on this extension, thus providing a simple means of controlling the selections available to users. The Modems\ and Systems\ libraries are activated through script commands, as follows:
CONNECT--Dials out and logs onto the remote system (uses Modems\ and Systems\).FILETRANSFER--Starts BLAST on the remote computer (uses Systems\ only).DISCONNECT--Logs off the remote system and hang ups the modem (uses Modems\ and Systems\).
The Modems\ library handles a wide range of different modems, some of which may use proprietary commands to perform functions under computer control. BLAST uses the Modem Type field to select the proper modem script from this library.
The @MODEM reserved variable also holds the value of the Modem Type field.
The @ORGANS reserved variable also holds the setting of the Wait for Call field, which determines whether to use the modem to originate or wait for calls.
The Systems\ library controls the commands sent to the remote computer for logging in, logging out, and starting BLAST. By using this library, your system can start BLAST in host mode on the remote computer. BLAST uses the System Type field to select the proper system script from this library.
The @SYSTYPE reserved variable also holds the value of the System Type field.
Creating New Modem or System Scripts
You can create specialized system and modem control files that contain only the necessary commands for your particular hardware. Typically, you will start with an existing file and make required changes, saving the file to a new name with an extension of .scr. Your new modem or system type will then appear in the list of modem or system types displayed in the Phonebook Editor.
To make a connection, the CONNECT command performs different actions depending on the values of @MODEM, @ORGANS, and @SYSTYPE. The possible sequences are shown in the form of a flow chart shown below.
POSSIBLE CONNECTION SEQUENCES
The Connection Process in Detail
When a Modem Type has been selected and the Wait for Call field is checked, the local computer will wait for a call from a remote machine. Control is passed to the .ANSWER section of the modem script to initialize the modem and wait for the call.
When the Wait for Call field is not checked, control is passed to the .DIAL section of the modem script. If a phone number is specified in the Phone Number field, .DIAL sends the phone number to the modem as a dial command. If the Phone Number field is empty, .DIAL prompts the user to enter a number. After dialing, it waits for a message from the modem indicating a successful connection.
If a System Type is specified, the corresponding .LOGON program in the system script is called for logging onto the remote system. If System Type is empty, BLAST assumes that you do not want system handling and the connect process ends, returning you to the calling script with @STATUS set to "0."
If an error is detected, the scripts return to BLAST with @STATUS set to reflect the error condition:
0--No error
Your script can check
91--Unable to initialize the modem
92--No answer
93--Can't log in: wrong userid, password
94--No carrier
95--Busy
96--No dialtone
97--Error
98--OK unexpected@STATUS to determine whether a connection is successful.
The modem and system scripts are assumed to exist in the present working directory or in subdirectories of @SCRIPTDIR. The search order for the modem script (presuming the modem type is USRobot and @SCRIPTDIR is C:\DP\Blast\Scripts\) is:
.\USRobot.scr |
.\Unix.scr |
callsub "USRobot.scr", "goto .DIAL", ":USROBOT" |
The Disconnection Process in Detail
The Disconnect process logs off the remote computer using a system script retrieved from the Systems\ directory and hangs up the modem under the control of a modem script retrieved from the Modems\ directory. When the necessary scripts have been located, a "disconnect script" is created to supervise the disconnect process. For the Modem Type USRobot and System Type Unix, the disconnect script typically resolves to the following lines of code:
callsub "Unix.scr", "goto .LOGOFF ", ":Unix" |
@STATUS is set to reflect the error condition:
0--No error
1--Unable to initialize the modem
3--Can't log out correctly
The following script illustrates the parts of a modem control script.
:QUICK # set up return code |
.DIAL, .ANSWER, .HANGUP, and .END. The appropriate section is activated when the CONNECT or DISCONNECT commands are given. The .END section, which terminates the control script (or separates the script from the next one in Modems.scr), requires a final colon (:). With this sample, you should be able to write your own modem scripts or modify the scripts in Modems.scr. Likewise, you can modify or enhance the system scripts in Systems.scr.
The following script illustrates the parts of a system script.
:HOST |
Dialing into a Computer That is Running a Slave Script
Included with the Data Pump is a "slave" script called "slave.txt," which keeps Data Pump continually ready to accept any incoming calls from a computer running BLAST protocol. When you dial into a computer running slave.txt and issue a FILETRANSFER command, the remote computer becomes a "slave" to your computer. While the remote computer is in slave mode, you can issue any filetransfer commands in your script.
NOTE: After connecting to a computer running slave.txt, Data Pump on your local machine has 25 seconds to initiate a filetransfer session. Otherwise, the slave assumes that the call is not for BLAST, hangs up the modem, and resets for the next call. Also note, if Data Pump on your local machine exceeds the Inactivity Timeout while performing local commands, you will be disconnected. For this reason, extensive use of local commands within a FILETRANSFER-ESC block is discouraged.
A "slave" session ends when an ESC statement is issued in your script or a timeout occurs.
Setting Up BLAST to Run in Slave Mode
If you choose to setup your computer to accept incoming calls and run in slave mode, you must follow these steps:
DISCONNECT command and resets Data Pump to accept the next incoming call.
|
BLAST Protocol | Xmodem | FTP | BLASTscript Topics | Connecting/Disconnecting Command Ref. | Reserved Variables | Autopoll | Error Messages | ASCII Char. Set |