Table of Contents | Intro | Quickstart | Phonebook | DP Viewer | Cmd. Line Ref. | Transferring Files
BLAST Protocol | Xmodem | FTP | BLASTscript Topics | Connecting/Disconnecting
Command Ref. | Reserved Variables | Autopoll | Error Messages | ASCII Char. Set

Xmodem

Introduction

BLAST Data Pump includes Xmodem protocol for transferring files with systems that do not offer the BLAST protocol.

There are many implementations of the Xmodem protocol. Data Pump supports the standard Xmodem checksum and Xmodem CRC protocols. Data Pump will attempt to determine automatically which implementation of Xmodem is on the remote computer. Please note, not all implementations of Xmodem are compatible with the Xmodem implemented in the Data Pump. The behavior of Xmodem in Data Pump is tunable to provide compatibility with broken and bizarre implementations of Xmodem. For more information on Xmodem tunable parameters, see Xmodem and Xmodem1K Settings.

Some Limitations of Xmodem

There are several limitations to the Xmodem protocol. Awareness of these can prevent problems in using Xmodem. Xmodem protocol:

  1. Works only on 8-bit connections. Thus, if you use a serial port, make sure that in the Communications Settings dialog, Data Bits is set to "8," Stop Bits is set to "1," and Parity is set to "NONE"; or that in a script @DS_BITS is set to "8/1" and @PARITY is set to "NONE." If you use Telnet, make sure that you use an 8-bit connection.

  2. Must be run with either no flow control or hardware (RTS/CTS) flow control because the protocol provides no encoding or transparency of control characters. If you attempt to run Xmodem with XON/XOFF flow control, your connection will hang. For this reason, if you use a serial port, make sure that Flow Control in the Communications Settings dialog is set to "NONE" or "RTS/CTS," not "XON/XOFF" or "BOTH."

  3. Pads files out to the nearest 128 bytes during transmission. Thus, original file sizes will not be retained. The default pad character is "^Z." The pad character can be modified by resetting either the Pad Character field in the Xmodem and Xmodem1K Settings dialog or the @XMPADCHAR reserved variable in a script.
Selecting Xmodem

The Xmodem protocol or Xmodem1K protocol is selected by choosing "XMODEM" or "XMODEM1K" on the
Protocols Properties Page in a phonebook listing or by setting the @PROTOCOL reserved variable to "Xmodem" or "Xmodem1K" in a script.


Establishing Xmodem Transfers

Prior to writing your script to do Xmodem transfers, you need to know how to issue Xmodem commands on the remote system. If you do not know how, consult the system administrator for instructions on issuing Xmodem commands on the remote system.

After you are logged in and have given the appropriate Xmodem command on the remote computer, Xmodem file transfers are started on the local machine running Data Pump by issuing, in a script, a FILETRANSFER command and then either a GET or a SEND followed by an ESC statement.

If you are running BLAST.exe, you will see the File Transfer Status dialog, which gives the status of files being transferred.


Sending and Receiving Files with Xmodem

Below is a script that illustrates sending and receiving files with Xmodem. The script is receiving the file called "sales" from a UNIX-based machine running Xmodem. The file will be called "Sales_Data" on the local machine. The "o" at the end of the line specifies that the file should be overwritten if it exists on the local machine. The script is sending a file called "Inventory_Control" to the remote machine, where it will be called "inventory."

      CONNECT
TSEND "sx sales", LF            # Xmodem send cmd for remote machine
FILETRANSFER
GET "","Sales_Data", "o"
ESC
tsend "rx inventory", LF        # Xmodem receive cmd for remote machine
FILETRANSFER
SEND "Inventory_Control", ""
ESC

Please note, there is no provision within the Xmodem protocol for specifying the remote filename. Data Pump, however, uses the same three-parameter syntax for GET and SEND statements with all supported protocols. This common syntax allows you to change the protocol used for a transfer without having to change the script. Thus, the null strings ("") in the script above represent the remote filename. If a remote filename is specified, Xmodem ignores it.


Specifying Transfer Options

Overwrite

Overwrite is specified by putting an "o" at the end of a GET command. Overwrite will cause the transmitted file to overwrite an existing file of the same name on the local system. This will result in the destruction of the existing file, so use Overwrite with caution. An error will result if this option is not used and the file already exists on the local system. There is no provision within the Xmodem protocol for protecting against overwriting a file on a remote system during a SEND.

      filetransfer
get "", "C:\\milwaukee\\data\\sales", "o"
esc


Append

Append is specified by putting an "a" on the end of a GET command. Append will append the transmitted file to the end of an existing file with the same name on the local system. If the file does not exist on the local system, it will be created. There is no provision within the Xmodem protocol for specifying append to a file on a remote system during a SEND.

      filetransfer
get "", "news", "a"
esc


No Overwrite

No overwrite is specified by putting an "n" on the end of a GET command. No Overwrite causes the transmitted file not to overwrite an existing file of the same name on the local system. Because No Overwrite is the default, this option is not actually needed. However, to be explicit, you may add it to a script. There is no provision within Xmodem for protecting against overwriting a file on a remote system during a SEND.

      filetransfer
get "", "D:\\Retail\\daily.sal", "n"
esc

For a table listing transfer options for all supported protocols, see File Transfer Options under Transferring Files.


Ending Xmodem Transfers

Xmodem transfers end when an ESC statement is issued after a SEND or a GET.


Table of Contents | Intro | Quickstart | Phonebook | DP Viewer | Cmd. Line Ref. | Transferring Files
BLAST Protocol | Xmodem | FTP | BLASTscript Topics | Connecting/Disconnecting
Command Ref. | Reserved Variables | Autopoll | Error Messages | ASCII Char. Set

support@blast.com
Copyright © 2000, BLAST, Inc. All rights reserved.