14. XMODEM File Transfers                
                             
14.0 Overview                           
                             
This section describes the use and setup of the XMODEM file transfer mode of PC-PLOT-IV. Sections on uploading, downloading, user support, and technical details are included.   
                             
The original definition of XMODEM has been extended in many cases to protocols called YMODEM, ZMODEM, and many other variations. These additions usually call for non-standard data record sizes or transmission of filenames as part of the initial communication between the sender and receiver.   
                             
PC-PLOT-IV supports basic XMODEM send and receive using an 8 bit checksum and the extension to allow a 16 bit CRC error code. Other extensions are not supported.   
                             
14.1 File Transfer Menu                      
                             
Entering an ALT-T command will bring up the file transfer menu. There are several options which the user may choose.   
                             
      Protocol File Transfer Menu 
1. Send file with XMODEM 
       
      2. Receive file with XMODEM checksum 
3. Receive file with XMODEM crc 
   
      4. Reserved (KERMIT send)           
      5. Reserved (KERMIT receive)       

14.2 Uploading files using XMODEM 
             
                             
To upload a file using XMODEM, prepare the host computer to accept the XMODEM transfer by running an XMODEM receive program or select an online menu option for XMODEM receive.   
                             
Depress ALT-T to get the file transfer menu and select option #1. Enter the filename of the file on your microcomputer to be sent to the remote host. The XMODEM module will display the following data: 
                             
  Sending File= sample.set                     
  File size is 7317 bytes 57, 128 byte blocks 
Waiting for host acknowledge 0002 
Sending checksum mode 
           
  < Transferring Data File > 
Sending record # 0058 
< XMODEM Complete > 
                 
                             
The status display shows the user the filename being transmitted, the size of the file to be sent in bytes and in 128 byte XMODEM records, how many times the synchronizing routine sent a character to the XMODEM receiving computer, the sending 
mode (checksum or CRC), a message to mark the start of the data transfer, the record number currently being sent, and a status message which shows that the XMODEM transfer is complete. At the end of the transfer, PC-PLOT-IV returns to normal online mode.   
                             
During an XMODEM send operation, if an error is encountered, the 'Sending' message changes to 'Re-sending record # xxxx'. If an unrecoverable error is encountered   
or too many successive or total errors occur, the transmit routine will abort with the message: 
                               
  <## XMODEM Aborted-too many errors ##>             

14.3 Downloading files using XMODEM 
             
                               
To download a file using XMODEM in PC-PLOT-IV, enter the commands necessary to cause the host computer that you are communicating with to start an XMODEM transfer. 
                               
  Using CompuServ, you start an XMODEM download with the following command:       
                               
  DOW TEST.BIN/PROTO:XMODEM<cr>                
                               
  where TEST.BIN is the file to be downloaded.             
                               
Other online services such as GENIE have a menu approach to starting an XMODEM transfer. Select the download option from the menu, enter a filename to download, and confirm selection with a D<cr>. GENIE will then inform you that the file transfer is ready. 
                               
Then enter an ALT-T command and select option 2 or 3 from the menu. Option 3 is always the best choice because the 16 bit error checking polynomial will result in a much lower probability of errors being undetected. If the transmitting host does not respond to the prompt for a CRC mode transfer in three tries, PC-PLOT-IV will automatically switch to checksum mode. 
                               
Enter the file name to create on your microcomputer at the prompt on line 25. The filename will be displayed on the top line. the message: 
                               
  <Waiting for Synchronization>                    
                               
  will appear on the next line.                       
                               
  <Synchronized>                          
                               
  will appear when PC-PLOT-IV receives either the checksum or CRC mode acknowledge from the remote host.   
                               
  Receiving Record # xxxx                         
                               
  indicates which record is being currently received.           
                               
  Successive Errors = xxxx           Total Errors = xxxx         
                               
  will appear if an error occurs and PC-PLOT-IV requests a re-transmission of a record. If the error count exceeds the number preset in the ALT-J setup menu, PC-PLOT-IV will abort the XMODEM transfer.     
                               
  <XMODEM file received without error>                   
                               
  or                             
                               
  <## XMODEM aborted ##>                       
is the final message.                    
                       
14.4 MMODEM Support Policy              
                       
While we will make every effort to support users of PC-PLOT-IV, we cannot spend telephone support time on XMODEM support problems. The PC-PLOT-IV XMODEM has been thoroughly tested and it does work properly. 
                       
As time permits, we will respond to WRITTEN XMODEM problems from registered users ONLY. Please specify the exact configuration of your computer, the on-line service that you were calling, and list the messages that appeared on the screen. 
                       
Most problems with XMODEM will be timeout errors where the network that you are using to communicate with the local host will stop sending characters for longer than the timeout value set in the ALT-J menu. Other problems arise due to extremely noisy lines which may cause excessive retries or may scramble the record number being received. 
                       
14.5 MODEM Technical Details             
                       
XMODEM is a transmission-level protocol for sending and receiving data files with error detection and correction. If an error is detected in a given message packet, the receiver requests a re-transmission of the packet. 
                       
There are no special characters sent in the data stream. Each transmission message consists of a header packet, 128 bytes of data, and a trailer packet for error checking. 
                       
  Xmodem Data Record Layout                 
                       
  <soh><blk#><255-blk#><128 bytes><checksum or CRC>         
                       
  <soh>   = 01 hex                   
  <blk #>   = binary number, starts at 01 increments by 1, and wraps OFFH to OOH (not to 01)     
  <255-blk #> = blk # after going thru 8086 "NOT" instr, i.e.       
                          each bit complemented in the 8-bit block number. 
<cksum>   = the sum of the data bytes only (ignore carry) 
<CRC>   = 16 bit polynomial checksum 
 
                       
  <soh> O1H           <ack> 06H           <can> 18H 
<eot> 04H            <nak> 15H 
         
                       
Transmission and reception modes are set to 8 data bits/no parity automatically on entry to the XMODEM module and restored to the previous setting on exit. 
                       
The XMODEM protocol is a receiver-driven protocol. The receiver initiates the protocol and controls the flow of data with a control character to indicate correct or incorrect reception of a data record. 
                       
The XMODEM process begins with the receiver sending a NAK for checksum mode or a 'C' for CRC mode. If the transmitter does not acknowledge after the receiver has sent 3 'C' characters, it switches to checksum mode and sends a NAK code. 
                       
When the transmitter receives the NAK or 'C', it begins sending message packets. After each message packet is sent the transmitter waits for the receiver to either an ACK (acknowledge ACK=06 hex ) or NAK (not acknowledge). If the transmitter receives a 
NAK, it retransmits the previous data block. If it receives an ACK, it sends the next data block. 
                                 
If the transmitter misses the NAK or ACK because of a channel error, the same message packet will be retransmitted after a timeout period which is programmable. If the message packet which was retransmitted was received properly before, the receiver will ACK the message and ignore the data. All errors are retried. 
                                 
Once into receiving a block, the receiver goes into a timeout for each character and the checksum. If the receiver wishes to <nak> a block for any reason (invalid header, timeout receiving data), it must wait for the line to clear. 
                                 
  Synchronizing: If a valid block number is received it will be:           
                                 
  1) the expected one, in which case everything is fine             
                                 
  2) a repeat of the previously received block. This should be considered OK, and only indicates that the receivers <ack> got glitched, and the sender re-transmitted         
                                 
  3) any other block number indicates a fatal loss of synchronization, such as the rare case of the sender getting a line-glitch that looked like an <ack>.           
    Abort the transmission, sending a <can>.               
                                 
After the last message has been sent (end of file), the receiver will be looking for another SOH to start the next data packet. The transmitter will send an EOT (04 hex) to signify the end of file. The receiver will ACK the EOT as the final step. 
                                 
      XMODEM data flow                        
                                 
  Receiver                                                                                               Transmitter       
                                 
  Sends NAK every 4 seconds until transmitter starts sending data                     
                                 
                  Sends one data record       
                                 
  Sends ACK if received correctly 
Sends NAK if not received correctly 
                 
                                 
                  Sends one data record       
                                 
  Sends ACK if received correctly 
Sends NAK if not received correctly 
                 
                                 
                  Sends EOT for end of file   
                                 
  Sends ACK if received correctly                       
                                 
Timeout values(default)                          
                                 
Receiver                                 
Max rx errors                                                                                               40         
Successive rx errors                                                                                     10         
Initial receiver timeout-wait for first message                                                  40 sec     
Intercharacter timeout                                                                                    20 sec 
Timeout following transmission of an ACK or NAK and next SOH or EOT.   20 sec 
       
Timeout between NAKs before transmitter sends first data record                  20 sec         
         
Transmitter                       
Max tx errors                                                                                                  40           
Successive tx errors                                                                                        10           
Initial timeout-wait on NAK from receiver                                                        40 sec. 
Timeout following transmission of data block and reception of ACK or NAK   20 sec
       
           
Flow control when transmitting                                                                         XON/XOFF       
Intercharacter delay                                                                                         programmable     
                         
14.6 XMODEM Setup Menu                
                         
The XMODEM module in PC-PLOT-IV has a set of values pre-programmed on startup which are selected for use with large packet-switched networks such as CompuServ or Telenet. All of the values are programmable and can be set by the user for a specific on-line service. The ALT-J menu contains all of the XMODEM setup values. 
                         
  Upload/Download Setup Screen 
-------------------------------------------------
 
 
  Intercharacter Delay 
  .1 sec 
 
         
 
  Line end delay 
 .1 sec 
20   
         
 
  TX initial sync errors 
 
10   
         
 
  TX initial sync timeout 
  sec 
 
         
 
  TX data/ack delay 
  sec 
20   
         
 
  TX retry count 
 
10   
         
 
  RX start delay 
  sec 
 
         
 
  RX NAK/C count 
 
10   
         
 
  RX interchar timeout 
  sec 
20   
         
 
  RX retry count 
 
10   
         
 
  Total Errors 
 
40   
         
 
  Successive Errors 
 
10   
         
 
  Length of Break (ALT-B) 
 .1 sec 
 
         
                         
  Commands: Cursor Up/Dn ALT-S Exit/Save ALT-Q Quit End Entry With <cr>     

14.610 Intercharacter Delay
                 
                         
The intercharacter delay parameter provides a 'throttling' mode where the maximum effective baud rate can be limited in cases where the host computer cannot accept characters at the full rate selected in the ALT-S menu. The normal value for this parameter is 0. 
                         
14.611 Line end delay                    
                         
The line end delay is a setting which selects the amount of time following a <cr> in ASCII upload mode. This parameter is used in systems that require a short time delay after each line of text is sent. The normal value for this parameter is 0. 
                         
14.612 TX initial sync errors                
                         
Number of characters to receive from 'receiver' which are not a 'C' or NAK before aborting transfer. 
                   
14.613 TX initial sync timeout      
                   
Time to wait for a character from the 'receiver' before timing out when waiting for a 'C' or NAK. 
                   
14.614 TX data / ack delay          
                   
Maximum time between sending the end of a data packet and receiving an ACK or NAK from the receiver.
                   
14.615 TX retry count              
                   
Number of times that the 'transmitter' will re-send a data block before the XMODEM transfer is aborted.
                   
14.616 RX start delay              
                   
Time between sending 'C' or NAK characters while attempting to synchronize with the 'transmitter'. 
                   
14.617 RX NAK/C count            
                   
Number of 'C' or NAK characters that will be sent before the 'receiver' gives up trying to synchronize with the 'transmitter' and aborts the XMODEM mode. 

14.618 RX interchar timeout
       
                   
  Maximum time allowed between individual characters in an XMODEM record.   
                   
14.619 RX retry count              
                   
Number of times that the 'receiver' will NAK a data packet before aborting the XMODEM transfer.
                   
14.620 Total Errors                
                   
Total number of receive errors allowed in one transfer. If this number is exceeded, the XMODEM transfer will be aborted. 

14.621 Successive Errors
           
                   
Total number of errors allowed in succession. This is different than total errors in that there may be 40 errors spread out over 200 XMODEM data packets with only one or two successive errors on a single packet. 
                   
14.622 Length of Break (ALT-Q)    
                   
The length of the BREAK signal is normally set to 1/2 second. Some computers other values. The number selected is in tenths of a second. 
                   
PC-PLOT-IV     Chapter 14    XMODEM 

Contents | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Appendix