home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR9 / RS232_.ZIP / RS232.DOC < prev    next >
Text File  |  1993-07-01  |  35KB  |  843 lines

  1. **************************************************************************
  2.  
  3.                     RS232
  4.                 Version  1.01
  5.                   Ring  Development
  6.                Maple Grove,  Minnesota
  7.  
  8. **************************************************************************
  9.  
  10.      The files created during extraction are as follows :      
  11.  
  12.      FILE                        SIZE
  13.      --------------------------------
  14.      RS232.    DOC              34840
  15.      RS232.    EXE              15620
  16.      RS232A.   EXE               7920
  17.      XT.       EXE               3720
  18.      TY.       EXE               7620
  19.      TYBIG.    EXE               9240
  20.      ADDLINES. EXE               6525
  21.      READ.     ME                3170
  22.      ORDER.    FRM               1220
  23.  
  24. **************************************************************************
  25.  
  26.                   TABLE  OF  CONTENTS
  27.                   -------------------
  28.  
  29.     1    Introduction
  30.      1.1  Program Installation
  31.     2    RS-232 Basics
  32.     3    RS232 Program Usage
  33.      3.1  Cabling to PC
  34.      3.2  Theory of Operation
  35.      3.3  User Interface
  36.      3.4  Command Line Arguments
  37.      3.5  If you have a real slow PC and/or fast baud rate - Overrun Error
  38.     4    Utility Program Usage
  39.      4.1  RS232A
  40.      4.2  XT
  41.      4.3  TY
  42.      4.4  TYBIG
  43.      4.5  ADDLINES
  44.     5    Closing
  45.  
  46. **************************************************************************
  47.  
  48.     1    INTRODUCTION
  49.  
  50.      The RS232 program here should enable you to debug most of your
  51.      RS-232 problems much faster than before. With the program, you
  52.      can actually see the data transmitted in both directions on a real
  53.      time basis. The program also supports the monitoring of all hardware
  54.      lines for those nasty hardware handshaking problems.
  55.  
  56.      5 utility programs are also provided to aid in wading through the
  57.      data generated. These utilities are described in Section 4.
  58.  
  59.      There are no hardware changes needed in the PC, the program does
  60.      all the monitoring necessary through the 2 COM ports. The program
  61.      can be used if your PC has only 1 COM port, though the program
  62.      will give the most beneficial information if you have 2. Nowadays,
  63.      a second COM port can be added to any PC for a minimum investment.
  64.  
  65.      The hardware needed to use this program is a simple homemade cable
  66.      that you create. The cable you need can be probably be built in an
  67.      hour from spare parts lying around. Section 3.1 discusses the cable
  68.      that most likely will be the one you need.
  69.  
  70.  
  71.     1.1  PROGRAM INSTALLATION
  72.  
  73.      Installing the RS232 program and the associated utilities is quite
  74.      simple. It is simply a matter of copying the .EXE files to any
  75.      directory where you want to run the program(s). A more versatile
  76.      directory would be a directory that is already in the 'PATH' of
  77.      the PC. This enables operation of the program(s) from any place
  78.      on the disk. A typical directory in the PATH is \DOS.
  79.  
  80.      To copy the program(s) to the \DOS directory :
  81.  
  82.      1) COPY *.EXE \DOS        (copy files to \DOS)
  83.  
  84.      To copy the program(s) to a new directory (ex \RS232) :
  85.  
  86.      1) MD \RS232              (make RS232 directory)
  87.      3) COPY *.EXE \RS232      (copy files to \RS232)
  88.  
  89.  
  90. **************************************************************************
  91.  
  92.     2    RS-232 BASICS
  93.  
  94.      RS-232 is a communication standard that has existed for many
  95.      years. It's main purpose is to transfer data from one device
  96.      to another. For instance, a tester to a host computer so the
  97.      computer can store the test results on disk.
  98.  
  99.      The standard RS-232 connector has 25 pins, though a lot of
  100.      PC's have a 9 pin connector. The pin assignments for each
  101.      signal is as follows (for 25 and 9 pin connectors) :
  102.  
  103.  
  104.                      TABLE  I
  105.  
  106.      SIGNAL                      PIN # (25)   PIN # (9)     IN/OUT
  107.      -------------------------------------------------------------
  108.      Ground                          1           N/A          --
  109.      Transmit Data                   2            3           Out
  110.      Receive Data                    3            2           In
  111.      Request to Send     (RTS)       4            7           Out
  112.      Clear to Send       (CTS)       5            8           In
  113.      Data Set Ready      (DSR)       6            6           In
  114.      Signal Ground                   7            5           --
  115.      Data Carrier Detect (DCD)       8            1           In
  116.      Data Terminal Ready (DTR)      20            4           Out
  117.      Ring Indicator      (RI)       22            9           In
  118.  
  119.      Note that besides receive/transmit data, there are 2 output
  120.      lines and 4 input lines. These are used for modem control and
  121.      hardware handshaking, which will be discussed later.
  122.  
  123.      The simplest communication hookup has 3 wires; transmit data,
  124.      receive data, and signal ground. The transmit and receive lines
  125.      need to be crossed (whether in the connecting cable or internal
  126.      to the either device). See Figure 1. This is so the transmit
  127.      line of device 1 is tied to the receive line of device 2, and
  128.      vice versa.
  129.  
  130.      This configuration only supports software handshaking. Suppose
  131.      device 1 transmits a block of data to device 2. Once device 2 has
  132.      received the data, it transmits back to device 1. Device 2 can
  133.      transmit a character meaning "OK, send the next block of data" or
  134.      transmit a character meaning "I don't like the data, send that last
  135.      block of data again". The actual protocol used is determined by
  136.      the software running on both devices.
  137.  
  138.  
  139.      DEVICE 1 (25 Pin)                         DEVICE 2 (25 Pin)
  140.  
  141.      PIN  2----------------\  /--------------------PIN  2     Transmit
  142.                 \/
  143.                 /\
  144.      PIN  3----------------/  \--------------------PIN  3     Receive
  145.  
  146.  
  147.      PIN  7----------------------------------------PIN  7     Signal GND
  148.  
  149.  
  150.                  (FIGURE 1)
  151.  
  152.  
  153.      Another configuration uses 5 wires and this is used primarily
  154.      for a hardware handshaking protocol. It uses the 3 wires in
  155.      Figure 1 and also the 2 wires shown in Figure 2.
  156.  
  157.  
  158.      DEVICE 1 (25 Pin)                         DEVICE 2 (25 Pin)
  159.  
  160.      PIN  4----------------\  /--------------------PIN  4     RTS
  161.                 \/
  162.                 /\
  163.      PIN  5----------------/  \--------------------PIN  5     CTS
  164.  
  165.  
  166.  
  167.                  (FIGURE 2)
  168.  
  169.  
  170.      From Table I above, you see that pin 4 (RTS) is an output signal
  171.      and pin 5 (CTS) is an input signal. No data is transferred through
  172.      these pins. They are just control lines using a specific voltage
  173.      level for the high state and another voltage level for the low
  174.      state. The software running in device 1 can program pin 4 to be
  175.      high or low and then device 2 can read this value as high/low
  176.      and act accordingly. Here is a typical example. Suppose device 1
  177.      is a large mainframe and device 2 is a tester of some sort. Now
  178.      assume that there are many testers (say 10) and all are hooked
  179.      up to our mainframe (one tester on 10 different mainframe COM
  180.      ports), our central data gathering point. It would be difficult
  181.      for our mainframe to gather data on all 10 testers simultaneously,
  182.      so we implement a hardware handshaking protocol. Our protocol says:
  183.      "A tester can not transmit it's test results until it sees the CTS
  184.      line go high". If the CTS line is low, our tester will not transmit
  185.      it's test results. So now, all our mainframe software has to do is:
  186.  
  187.      1)  Set the RTS line on the port for tester 1 high, this sets
  188.          the CTS line high at tester 1.
  189.      2)  Tester 1 sees that CTS has gone high, then it starts its
  190.          transmission of the test results.
  191.      3)  After completion of the test results, set the RTS line low
  192.          for tester 1. This will inhibit tester 1 from further
  193.          transmissions.
  194.      4)  Now set the RTS line for tester 2, and repeat the above
  195.          steps for all 10 testers.
  196.  
  197.  
  198.      Pins 20 and 6 may also be used as pins 4 and 5 were above.
  199.      Another possible use for the input pins is to connect an
  200.      input pin to a +5V signal in the remote device (for example,
  201.      a power supply voltage). This is convenient if the remote
  202.      device is not always powered on. Your program in essence can
  203.      monitor the power supply of the remote device and know when
  204.      it is powered up and safe to 'talk' to.
  205.  
  206.      Pins 8 (DCD) and 22 (RI) are normally used in communicating
  207.      with a modem. Data Carrier Detect is set high by the modem
  208.      when it is talking to another modem. Ring Indicator is set high
  209.      by the modem when there is an incoming call.
  210.  
  211.  
  212. **************************************************************************
  213.  
  214.     3    RS232 PROGRAM USAGE
  215.  
  216.     3.1  CABLING TO PC
  217.  
  218.      The cabling to the PC can be as simple or complex as the need
  219.      dictates. Refer to section 3.2 for more details. If your system
  220.      only has a 3 wire protocol, the cabling will be very simple.
  221.      The top 7 wires shown are all optional (for a 3 wire software
  222.      handshaking protocol).  The cable will be wired as follows
  223.      (all pin numbers assume a 25 pin connector, use TABLE I above
  224.      for 9 pin connector conversions):
  225.  
  226.      NOTE : If you are debugging a hardware handshaking problem,
  227.         then obviously some of the 'optional' wires shown below
  228.         are actually necessary.
  229.  
  230.  
  231.        25 Pin MALE    ***STRAIGHT THROUGH CABLE***   25 Pin FEMALE
  232.  
  233.        =======  OPTIONAL WIRES ========
  234.  
  235.                        CHASSIS GND
  236.        PIN  1----------------------------------------PIN  1
  237.  
  238.                        RTS
  239.        PIN  4----------------------------------------PIN  4
  240.  
  241.  
  242.                        CTS
  243.        PIN  5----------------------------------------PIN  5
  244.  
  245.                        DSR
  246.        PIN  6----------------------------------------PIN  6
  247.  
  248.                        DCD
  249.        PIN  8----------------------------------------PIN  8
  250.  
  251.                        DTR
  252.        PIN 20----------------------------------------PIN  20
  253.  
  254.                        RI
  255.        PIN 22----------------------------------------PIN  22
  256.  
  257.  
  258.  
  259.        =======  REQUIRED WIRES ========
  260.  
  261.                        XMIT
  262.        PIN  2---+------------------------------------PIN  2
  263.             |
  264.   TO                |                      REC                        TO
  265. DEVICE     PIN  3-----------+----------------------------PIN  3     DEVICE
  266.   1                 |       |                                         2
  267.             |       |              SIGNAL GND
  268.        PIN  7-------+--------------------------------PIN  7
  269.             |   |   |
  270.             |   |   |
  271.         ________|   |   |_________
  272.        |    ________|_________    |
  273.        |   |                  |   |
  274.        |PIN|                  |PIN|
  275.        3   7                  7   3
  276.  
  277.     COM 1 of PC            COM 2 of PC
  278.  
  279.  
  280.                  (FIGURE 3)
  281.  
  282.  
  283.      So with this cable, PC COM 1 will monitor the transmit line of
  284.      device 1 (receive line of device 2) and PC COM 2 will monitor
  285.      the receive line of device 1 (transmit line of device 2). The
  286.      cabling scheme just inserts a straight through cable installed
  287.      between the 2 devices under test and then tap off the desired
  288.      signals and run them into the PC. Note that both signal lines
  289.      are wired to the PC COM ports pin 3 (receive line). This is
  290.      because the PC is never an active participant in the communi-
  291.      cation. It is only there to monitor the communication.
  292.      The computer needs 2 COM ports so it can monitor both halves of
  293.      the communication. (This program can be used with only 1 COM
  294.      port in the PC, see section 3.2 below).
  295.  
  296.      Now, it should be easy to extend the above cabling to include
  297.      the desired hardware lines as needed. If you need to monitor
  298.      the CTS line of device 1, just add another wire from device 1,
  299.      pin 5 (CTS) to PC COM 1, pin 5, and so on.
  300.  
  301.  
  302.     3.2  THEORY OF OPERATION
  303.  
  304.      The theory behind this program is quite straight forward. The
  305.      purpose is to monitor the RS232 communication between 2 devices.
  306.      This is accomplished by inserting a cable in the line and
  307.      tapping off the desired signals and connecting them to the PC.
  308.      See section 3.1. The PC only 'listens', it never transmits any
  309.      data. It only monitors what is coming across the cable, in both
  310.      directions. For optimum benefit a PC with 2 COM ports is needed,
  311.      though you can use a PC with only 1 COM port. Also, each device
  312.      has 4 hardware lines and all 4 lines for both devices can be
  313.      monitored if your cable has the lines hooked up to the PC. If your
  314.      PC only has 1 COM port, you can only monitor one half of the
  315.      conversation. However, if you have 2 PC's and they each have 1 COM
  316.      port, you can use 1 PC to monitor the transmit line and the other
  317.      PC to monitor the receive line, though you will lose the timing
  318.      information. The timing of the communication can be quite useful.
  319.  
  320.      See section 4.5 below. This is a portion of an actual Kermit file
  321.      transfer between 2 computers. PC COM 1 was listening to the computer
  322.      that was initiating the Kermit session and PC COM 2 was listening
  323.      to the computer that was being put in server mode. The computer on
  324.      COM 1 was invoking Kermit with the command ">SYSLIB2>KERMIT SV".
  325.      As you can see in the actual transmission timing :
  326.  
  327.      Computer 1 : ">S"
  328.      Computer 2 : echos a 7F
  329.      Computer 1 : "YS"
  330.      Computer 2 : echos a ">"
  331.      Computer 1 : "L"
  332.      Computer 2 : echos a 7F
  333.      Computer 1 : "I"
  334.      Computer 2 : echos a "S"
  335.      Computer 1 : "B"
  336.      Computer 2 : echos a 7F
  337.      Computer 1 : "2"
  338.      Computer 2 : echos a "Y", etc.
  339.  
  340.      You can see that the second computer is echoing back the command
  341.      it is receiving, with a few stray 7F characters embedding in
  342.      the data stream. The format of the data in section 4.5 is
  343.      exactly what will be logged to disk on a write data command.
  344.      The raw hex values will be on the left side and the ASCII
  345.      equivalents will be on the right side. If a data character is
  346.      a non ASCII character, it will be displayed as a period. They
  347.      will appear on the PC's display this way also.
  348.  
  349.  
  350.     3.3  USER INTERFACE
  351.  
  352.      To start the program, just enter RS232. The optional command line
  353.      arguments are discussed in section 3.4 and can also be seen by
  354.      entering 'RS232 -H'.
  355.  
  356.      If the first thing displayed is 'Bad COM ports specified', the
  357.      likely cause is that your PC has only 1 COM port. The program
  358.      assumes that you are using 2 COM ports. You will need to use
  359.      the '-1' command line argument to use the program with this PC.
  360.      See section 3.2.
  361.  
  362.      The display is split up into 2 areas, the top 20 lines of the
  363.      screen and the bottom 5. The top 20 lines is where the captured
  364.      data is displayed. They are shown in alternating colors of blue
  365.      and light blue for a color monitor or normal video and reverse
  366.      video for a monochrome monitor. See below for more discussion of
  367.      these top 20 lines.
  368.  
  369.      The bottom 5 lines of the display is split up into 4 smaller areas.
  370.      The two sections on the left show available function keys for
  371.      performing specific tasks. The 8 function keys supported are :
  372.  
  373.      F1  : Help    (Displays help screen)
  374.      F4  : Goto    (Go directly to a specific position in the read buffer)
  375.      F7  : Srch    (Search the read buffer for specific data)
  376.      F10 : EXIT    (Exit RS232 program, must confirm exit with 'Y')
  377.  
  378.      Alt-F1  : Gather Data                       (Monitor ports for data)
  379.      Alt-F4  : Gather Data and Clear Read Buffer (Monitor ports for data)
  380.      Alt-F7  : Write the read buffer to disk.
  381.      Alt-F10 : Write the read buffer to disk and then Exit.
  382.  
  383.      The next section on the left shows the present configuration of the
  384.      COM ports. The default setup is 9600 baud, 8 bit characters, no
  385.      parity and 1 stop bit. These can changed with the command line
  386.      arguments discussed in section 3.4.
  387.  
  388.      The last section on the bottom displays the total read buffer
  389.      available in bytes, the number of bytes used, and the percentage.
  390.      Initially, the total read buffer is typically 450 - 500K in size
  391.      (on a 640K machine) with 0 bytes used and 0 %. After the program
  392.      loads into memory, it allocates all remaining conventional memory
  393.      as a read buffer. This behavior can be changed by using command line
  394.      argument '-K' discussed in section 3.4 below.
  395.  
  396.  
  397.      FUNCTION KEYS :
  398.  
  399.      F1  -  HELP      Displays short help screen
  400.  
  401.      F4  -  GOTO      This will let you jump around the read buffer
  402.               very easily. For example, if you have 350K used
  403.               in your read buffer, it is very slow to 'PG DOWN'
  404.               from beginning to end. After pressing F4, you
  405.               will get prompted for an offset. Enter the desired
  406.               offset from the beginning of the buffer, example :
  407.               215400. The number you enter will be rounded down
  408.               to the nearest multiple of 16.
  409.  
  410.      F7  -  SRCH      This will let you search the read buffer for
  411.               specific data. You can search for ASCII text or
  412.               a hex pattern. An example of an ASCII text search
  413.               would be 'KERMIT FILE TRANSFER'. An example of a hex
  414.               pattern search would be '0120204A0D0A'. The hex
  415.               search above would search the read buffer for the
  416.               6 data bytes 01, 20, 20, 4A, 0D, 0A. NOTE! : The
  417.               search takes place from the present display position
  418.               to the end of the read buffer. After a successful
  419.               search, pressing 'ALT N' will find the next occur-
  420.               rence of the search, from the new display position
  421.               to the end of the read buffer.
  422.  
  423.               Pressing 'ALT A' will prompt directly for an ASCII
  424.               text search and pressing 'ALT H' will prompt
  425.               directly for a hex pattern search.
  426.  
  427.               The search does not distinguish between COM 1 and
  428.               COM 2, the data is treated as one long buffer.
  429.  
  430.               For a text search, the search is case sensitive.
  431.               'FILE' is different than 'file'.
  432.  
  433.               For a hex pattern search, the program only accepts
  434.               the characters 0-9, A-F (and also a-f). All other
  435.               characters are not allowed and the program will
  436.               tell you that there is an illegal character in the
  437.               string.
  438.  
  439.      F10 -  EXIT      Press this to exit RS232. You will be asked 'Are
  440.               you sure ? (Y/N)'.  Press 'Y' to confirm the exit.
  441.               Any key other than 'Y' is treated as 'N'.
  442.  
  443.  
  444.      ALT-F1  -  GATHER DATA
  445.               This puts the PC in the mode to actually capture
  446.               data. If there is already data in the read buffer,
  447.               any new data is appended to the end of the present
  448.               data. Pressing 'ESC' will discontinue 'gather data'
  449.               mode. If the blinking 'PRESS ESC' is annoying,
  450.               pressing any other key will turn off the blinking.
  451.               In this mode, the bottom left portion of the
  452.               display has changed to indicate the status of both
  453.               COM ports.  The bottom left portion of the screen
  454.               now looks something like :
  455.  
  456.               --------------------------------------------------
  457.               1  CTS : L   PAR : -     2  CTS : L   PAR : -
  458.                  DSR : L   FRM : -        DSR : L   FRM : -
  459.                  DCD : L                  DCD : L
  460.                   RI : L                   RI : L
  461.  
  462.               This is showing the status of the 4 hardware lines
  463.               CTS, DSR, DCD, and RI for both COM ports. If the
  464.               line is low, you will see a normal video 'L'. If
  465.               the line is high, you will see a reverse video 'H'.
  466.  
  467.               This is also showing whether a parity (PAR) or
  468.               framing (FRM) error has happened on either port.
  469.               If no error has occurred, you will see a normal
  470.               video '-'. If a parity/framing error has occurred,
  471.               you will see a reverse video block in place of the
  472.               '-' and also a 'latched' solid block 1 space to the
  473.               right of the normal display.
  474.  
  475.               The hardware lines and the parity/framing errors
  476.               are updated continuously.
  477.  
  478.      ALT-F4  -  GATHER DATA AND CLEAR READ BUFFER
  479.               This is the same as ALT-F1, except that if there is
  480.               any data in the read buffer, the old data in the
  481.               read buffer is discarded.
  482.  
  483.      ALT-F7  -  WRITE BUFFER TO DISK
  484.               This will write the present read buffer to disk.
  485.               The default file name is 'RS232.LOG'. If 'RS232.LOG'
  486.               already exists on disk, then the old file contents
  487.               will be lost and overwritten with the new data.
  488.               The default file name can be changed by using the
  489.               '-F' command line argument or by pressing the
  490.               'ALT F' key. Pressing 'ALT F' will prompt you for
  491.               a new filename. A full drive:\pathname\filename
  492.               can be used, if desired.
  493.  
  494.      ALT-F10 -  WRITE BUFFER TO DISK AND EXIT
  495.               After writing the read buffer to disk, RS232 will
  496.               terminate.
  497.  
  498.      OTHER 'ALT' KEYS :
  499.  
  500.      ALT 'A'          Prompt directly for an ASCII text search.
  501.  
  502.      ALT 'F'          Change the default filename for logging data.
  503.  
  504.      ALT 'H'          Prompt directly for a hex pattern search.
  505.  
  506.      ALT 'L'          Toggle between upper/lower case for hex values
  507.               in the display.
  508.  
  509.      ALT 'N'          Search for the next occurence of a previously
  510.               successful search.
  511.  
  512.  
  513.      As mentioned above, the top 20 lines of the screen is where the
  514.      captured data is displayed. At most, 160 bytes of the read buffer
  515.      can be shown at a given time. The screen is broken down into 10
  516.      sets of 2 lines each. These 2 lines (top for COM 1, next for COM 2)
  517.      will show 16 bytes of the read buffer. The data will be on the top
  518.      line if it came in COM 1 or the second line if it came in on COM 2.
  519.  
  520.      From the snapshot shown below, COM 1 was receiving 2E, 61, 73, 59,
  521.      and 0D (line a). Then COM 2 started to get 7F, 01, 2A, etc up to
  522.      23 (line b). COM 2 was still receiving the data 26, 3B, 0D, 00 (line
  523.      d). And finally, COM 1 received the data 01, 30, 20, etc (line c).
  524.  
  525. (a)      2E 61 73 59 0D                                   1  .asY.
  526. (b)                     7F 01 2A 20 53 7E 2A 20 40 2D 23  2       ..* S~* @-#
  527. (c)                  01 30 20 59 7A 2A 20 5C 40 2D 23 26  1      .0 Yz* \@-#&
  528. (d)      26 3B 0D 00                                      2  &;..
  529.  
  530.      Every 2 lines in the display make up real time, left to right. There
  531.      can never be 2 characters above each other in the display for COM 1
  532.      and COM 2 in the same time period. This is not happening above. Lines
  533.      a & b make up 1 time period while lines c & d make up the next time
  534.      period.  The example below could never happen.
  535.  
  536.                     || ||    ||
  537. (e)      2E 61 73 59 0D             20 41    43           1  .asY.     A C
  538. (f)                     7F 01 2A 20 53 7E 2A 20 40 2D 23  2       ..* S~* @-#
  539. (g)                  01 30 20 59 7A 2A 20 5C 40 2D 23 26  1      .0 Yz* \@-#&
  540. (h)      26 3B 0D 00                                      2  &;..
  541.  
  542.  
  543.      When you are gathering data, nothing else can be done until you
  544.      press ESC to end the gather data session. The PC is dedicated to
  545.      monitoring both COM ports for activity. For example, you cannot
  546.      write the read buffer to disk while in gather data mode. The display
  547.      is updated continually with new data as it comes in. When ESC is
  548.      pressed to end 'gather data', then you can write the buffer to disk,
  549.      search for data, etc. When you are not gathering data, any incoming
  550.      data to the PC is not collected.
  551.  
  552.      You can scroll through the read buffer by using the HOME, END, PG UP,
  553.      PG DOWN, and UP/DOWN arrows. Pressing the HOME key will move you to
  554.      the beginning of the read buffer (offset 0). Pressing the END key
  555.      will move you to the end of the read buffer. Pressing the PG UP /
  556.      PG DOWN keys will move you up/down 160 bytes in the buffer, and the
  557.      UP/DOWN arrows will move you up/down 16 bytes in the buffer.
  558.  
  559.  
  560.     3.4  COMMAND LINE ARGUMENTS
  561.  
  562.      The command line arguments may use the '-' or '/' character,
  563.      be upper or lowercase, and must be separated by spaces. The
  564.      recognized arguments are:
  565.  
  566.      -1           :   Only use 1 COM port for monitoring data. See
  567.               section 3.2 for more details.
  568.  
  569.      -A           :   Mask off the most significant bit of all
  570.               incoming data.
  571.  
  572.      -B<number>   :   Where <number> is any legal baud rate. The default
  573.               baud rate is 9600. The maximum baud rate supported
  574.               is 115200. If an illegal baud rate is entered, the
  575.               baud rate used is the closest one supported by the
  576.               system (PC).
  577.  
  578.      -C<number>   :   Where <number> can be 5, 6, 7, or 8. This is
  579.               the of number of bits per character. The default
  580.               is 8.
  581.  
  582.      -D           :   Disable screen update during 'gather data'. Use
  583.               this option if you ever see a blinking "OVERRUN
  584.               ERROR" message on the screen. (See section 3.5)
  585.  
  586.      -F<text>     :   Where <text> is alternate file name for
  587.               writing the read buffer to the disk. The
  588.               default file name is 'RS232.LOG'.
  589.  
  590.      -G           :   Go directly into gather data mode. This may be
  591.               useful if invoking RS232 from a .BAT file.
  592.  
  593.      -H           :   Display the command line arguments.
  594.  
  595.      -K<number>   :   Where <number> is the number of K-bytes of RAM
  596.               NOT to allocate as a read buffer. The default
  597.               is to allocate all remaining conventional memory
  598.               as a read buffer. This may be undesirable if you
  599.               have a TSR that requests some RAM when invoked.
  600.               EX : -K64 will leave 64K of RAM free.
  601.  
  602.      -M<2 numbers>:   Where the two numbers are which 2 COM ports to
  603.               use. The possible options are 1, 2, 3, or 4. The
  604.               default is to use COM 1 and 2.
  605.               EX: -M13 to use COM 1 and COM 3.
  606.  
  607.      -P<letter>   :   Where the possible letters are N, E, O, M, S.
  608.               This sets the parity to None, Even, Odd, Mark,
  609.               or Space. The default is None.
  610.  
  611.      -S<number>   :   Where <number> can be 1 or 2. This is the number
  612.               of stop bits. The default is 1.
  613.  
  614.  
  615.      Example      :   RS232 -b19200 -pe -c7 -fdata.txt
  616.  
  617.  
  618.     3.5  IF YOU HAVE A REAL SLOW PC AND/OR FAST BAUD RATE - OVERRUN ERROR
  619.  
  620.      When the RS232 program is in 'gather data' mode, you may see
  621.      a blinking "OVERRUN ERROR" message. This happens when the PC
  622.      can not keep up the with data transfer taking place. The data
  623.      transfer shown in section 4.5 was captured at 19200 baud with
  624.      no problems on a 6 MHz AT PC. However, if you try to capture
  625.      115200 baud on a 4.77 MHz XT, you may have a problem.
  626.  
  627.      Here's a general look at the processing performed:
  628.  
  629.  
  630.      LOOP FOREVER
  631.        scan keyboard                   (looking for ESC key to break out)
  632.  
  633.        for both COM1 and COM2:
  634.           update status of 4 hardware lines    (high or low)
  635.           update parity and framing errors
  636.           check for overrun error
  637.  
  638.           has a character arrived at either port ?
  639.         if so
  640.           get the character
  641.           store character in read buffer
  642.           store whether it came in on COM 1 or COM 2
  643.           update the screen with the new data received  (***)
  644.         end if
  645.        end for
  646.      END LOOP FOREVER
  647.  
  648.  
  649.      There are basically four ways to correct the "Overrun Error":
  650.      (In order of preference)
  651.  
  652.      1) Disable most if not all TSRs that are running. These steal
  653.         precious clock cycles from the main program. SMARTDRV is an
  654.         especially bad one. SMARTDRV is commonly used with Windows
  655.         to speed up disk reads/writes, but is can take over control
  656.         of the CPU for hundreds of milliseconds which is just too long
  657.         for practically any baud rate that we are trying to capture.
  658.  
  659.      2) Disable screen updating by using the -D command line option.
  660.         See *** above. Updating the screen is actually a rather
  661.         time consuming task, relative to the other processing.
  662.  
  663.      3) Slow down the baud rate. Not at all unreasonable. For example,
  664.         you could debug a 38400 baud problem at 9600 baud and probably
  665.         be safe. This logic would only fail if you were debugging long
  666.         distance communications.
  667.  
  668.      4) Buy a faster PC
  669.  
  670.  
  671. **************************************************************************
  672.  
  673.     4    UTILITY PROGRAM USAGE
  674.  
  675.     4.1  RS232A.EXE
  676.  
  677.      This program simply displays the current settings (how each
  678.      COM port is configured) for all 4 COM ports on a PC.  If a
  679.      given port doesn't exist, then 'NONE' is displayed for that port.
  680.      To run, just type 'RS232A' and return. A typical output is as
  681.      follows:
  682.  
  683.      COM1:   0x03F8   9600 Baud   8 Bit Chars   1 Stop Bits   No Parity
  684.      COM2:   0x02F8   9600 Baud   8 Bit Chars   1 Stop Bits   No Parity
  685.      COM3:   None
  686.      COM4:   None
  687.  
  688.      So this PC has 2 COM ports and both are configured for 9600,8,1,N.
  689.      The '0x03F8' is the base address of the port in the computer's
  690.      memory. The '0x' is a C programming convention for a hexadecimal
  691.      constant, so the base address of COM1 is 3F8 hex and the base
  692.      address of COM2 is 2F8 hex. These addresses are read from the
  693.      BIOS data area at 40h:0000h.
  694.  
  695.  
  696.     4.2  XT.EXE
  697.  
  698.      When RS232 logs data to the disk, the data file can be quite
  699.      large. A 500K byte read buffer in the program can result in
  700.      a 4.3M data file. This size file is usually impractical to
  701.      work with, so 'XT' will extract certain portions of the file
  702.      (actually, this program can be used on any ASCII file). 'XT'
  703.      requires 4 arguments on the command line:
  704.  
  705.      1)  Source file name
  706.      2)  Destination file name
  707.      3)  Starting line number
  708.      4)  Ending line number
  709.  
  710.      Entering less than 4 arguments will result in the following
  711.      display output:
  712.  
  713.      Usage  : XT <source-file> <destination-file> <start-line> <end-line>
  714.           A '+' as the first char of the destination file will append
  715.      Example: XT DATA.TXT TEMP.TXT 1091 1584
  716.  
  717.      Let's assume you have a very large 'RS232.LOG' data file but you
  718.      are only interested in lines 1211 through 1600 (See TY, TYBIG).
  719.      Use program XT to extract the desired lines as follows:
  720.  
  721.      XT RS232.LOG RS232.TMP 1211 1600 <Return>
  722.  
  723.      The program will then create file 'RS232.TMP' with the desired
  724.      lines from the original file. The original file is unchanged. If
  725.      the new file name already exists, the old file contents are lost,
  726.      unless the destination file has the read-only attribute set.
  727.  
  728.  
  729.     4.3  TY.EXE
  730.  
  731.      'TY' is a utility to look at any ASCII file on the computer's
  732.      display. The usage is TY <filename>. To view RS232.LOG, simply
  733.      enter 'TY RS232.LOG' <return>. Press function key F1 for help.
  734.      Some of the features are search capability, scroll left/right,
  735.      and go to any line number instantly. Also displayed is the
  736.      current line number and the total number of lines in the file.
  737.      This program attempts to load the entire file into memory, for
  738.      the fastest possible viewing. If the file size exceeds the
  739.      available RAM in the computer, the program will exit with an
  740.      out of memory error. If this error occurs, use program TYBIG
  741.      (see below). On a typical 640K PC, 550K is usually available
  742.      for applications, depending on the number of device drivers,
  743.      TSR's, etc.
  744.  
  745.  
  746.     4.4  TYBIG.EXE
  747.  
  748.      This program looks and acts exactly like TY, except that it is
  749.      used for viewing very large files. This program has to perform
  750.      disk I/O for some operations, and therefore is somewhat slower
  751.      than TY. Usage is TYBIG <filename>.
  752.  
  753.  
  754.     4.5  ADDLINES.EXE
  755.  
  756.      This program is used to alter the appearance of the 'RS232.LOG'
  757.      data file. Using this program on the data file makes it somewhat
  758.      more legible. The original data file is unchanged. Usage is
  759.      ADDLINES <Source-file> <Destination-file>. If the destination file
  760.      already exists the old file contents will be lost, unless the
  761.      destination file has the read-only attribute set.
  762.  
  763.      Example : ADDLINES RS232.LOG RS232.TXT <Return>.
  764.  
  765.      If the original RS232.LOG file looked something like this :
  766.  
  767.      20 3E 53    59 53    4C    49    42    32    3E  1   >S YS L I B 2 >
  768.           7F       3E    7F    53    7F    59     2     .  > . S . Y
  769.         4B    45    52    4D 49    54    20    53     1   K E R MI T   S
  770.      7F    53    7F    4C       7F    49    7F    42  2  . S . L  . I . B
  771.      56    0D                                         1  V .
  772.         7F    3E 7F 45 7F 49 7F 20 7F 56 7F 0A 0D 7F  2   . >.E.I. .V....
  773.                               1
  774.      4B 65 72 6D 69 74 2D 47 43 4F 53 20 56 33 2E 31  2  Kermit-GCOS V3.1
  775.                               1
  776.      0A 0D 7F 53 65 72 76 65 72 20 6D 6F 64 65 0A 0D  2  ...Server mode..
  777.      01 30 20 49 7A 2A 20 5C 40 2D 23 26 31 7E 22 20  1  .0 Iz* \@-#&1~"
  778.                               2
  779.      20 7A 5C 40 0D                                   1   z\@.
  780.             7F 01 29 20 59 7E 2A 20 40 2D 23  2       ..) Y~* @-#
  781.           01 3F 20 52 3E 75 64 64 3E 69 72 73 3E  1     .? R>udd>irs>
  782.      5D 0D 00                                         2  ]..
  783.      70 65 74 65 72 73 6F 6E 3E 73 74 65 70 72 6F 74  1  peterson>steprot
  784.                               2
  785.      2E 61 73 59 0D                                   1  .asY.
  786.             7F 01 2A 20 53 7E 2A 20 40 2D 23  2       ..* S~* @-#
  787.              01 30 20 59 7A 2A 20 5C 40 2D 23 26  1      .0 Yz* \@-#&
  788.      26 3B 0D 00                                      2  &;..
  789.  
  790.  
  791.      then RS232.TXT would look like this :
  792.  
  793.      20 3E 53    59 53    4C    49    42    32    3E  1   >S YS L I B 2 >
  794.           7F       3E    7F    53    7F    59     2     .  > . S . Y
  795.      --------------------------------------------------------------------
  796.         4B    45    52    4D 49    54    20    53     1   K E R MI T   S
  797.      7F    53    7F    4C       7F    49    7F    42  2  . S . L  . I . B
  798.      --------------------------------------------------------------------
  799.      56    0D                                         1  V .
  800.         7F    3E 7F 45 7F 49 7F 20 7F 56 7F 0A 0D 7F  2   . >.E.I. .V....
  801.      --------------------------------------------------------------------
  802.                               1
  803.      4B 65 72 6D 69 74 2D 47 43 4F 53 20 56 33 2E 31  2  Kermit-GCOS V3.1
  804.      --------------------------------------------------------------------
  805.                               1
  806.      0A 0D 7F 53 65 72 76 65 72 20 6D 6F 64 65 0A 0D  2  ...Server mode..
  807.      --------------------------------------------------------------------
  808.      01 30 20 49 7A 2A 20 5C 40 2D 23 26 31 7E 22 20  1  .0 Iz* \@-#&1~"
  809.                               2
  810.      --------------------------------------------------------------------
  811.      20 7A 5C 40 0D                                   1   z\@.
  812.             7F 01 29 20 59 7E 2A 20 40 2D 23  2       ..) Y~* @-#
  813.      --------------------------------------------------------------------
  814.           01 3F 20 52 3E 75 64 64 3E 69 72 73 3E  1     .? R>udd>irs>
  815.      5D 0D 00                                         2  ]..
  816.      --------------------------------------------------------------------
  817.      70 65 74 65 72 73 6F 6E 3E 73 74 65 70 72 6F 74  1  peterson>steprot
  818.                               2
  819.      --------------------------------------------------------------------
  820.      2E 61 73 59 0D                                   1  .asY.
  821.             7F 01 2A 20 53 7E 2A 20 40 2D 23  2       ..* S~* @-#
  822.      --------------------------------------------------------------------
  823.              01 30 20 59 7A 2A 20 5C 40 2D 23 26  1      .0 Yz* \@-#&
  824.      26 3B 0D 00                                      2  &;..
  825.      --------------------------------------------------------------------
  826.  
  827.  
  828. **************************************************************************
  829.  
  830.     5    CLOSING
  831.  
  832.      If you have any questions or problems regarding the programs,
  833.      feel free to contact :
  834.  
  835.      Michael Ring
  836.      Ring Development
  837.      10750 108th Ave. N.
  838.      Maple Grove, MN  55369
  839.  
  840.      (612) 425-7807
  841.  
  842. **************************************************************************
  843.