______________________________________________________________________
                    SERIAL PORT MONITORING UNIT
______________________________________________________________________

   The 'serialun' unit provides interrupt driven access to the serial
port. Interrupt driven access means that you can have your program doing 
anything you want and this serial unit will meanwhile read and store
anything that is sent into the serial port. You can then extract at any
time data from the buffer using the appropiate functions (provided with
the unit). 

   This unit is based entirely in an article from Dr. Dobb's Journal 
(november 1994) called "Interfacing Laboratory Instruments. I only
translated it into pascal, and arranged everything into an object (this
serial port is written in object oriented Turbo Pascal). You may also want
to check http://www.ece.uiuc.edu/~ece291/class-resources/serial.html,
which is an extremely large (100K) class resource at UIUC. I found it very
useful when writing the unit.


   TESTSER.PAS    -   Sample program for displaying whatever is sent
   TESTER2.PAS    -   Sample program for using the line reading function
   SERIAL.PAS     -   TSerialPort object
   CIRCULAR.PAS   -   SERIAL.PAS uses CIRCULAR.PAS for buffer purposes


   Please note that this unit ONLY reads from the serial port, as the
writeln function of pascal works just fine for writing to the serial port:

var 
 f : text;
begin
 Assign(f,'COM1');
 Rewrite(f);
 Writeln(f,'Put here whatever you want to send');
 Close(f);
end;

If your application requires say, sending a control command to some device
and then reading info from that device, you can start by combining
TESTSER.PAS and the little piece of code above (for writing to the serial
port). TESTSER.PAS prints in the display whatever is sent to the serial
port.

IMPORTANT!!!! Some people have had problems compiling the unit under TP
6.0. The most common problem is concerned with the AddData function. The
problem is that TP wants AddData (which is a function) to be assigned to a
variable. Under TP 7.0 this is no problem (at least with the flags I
worked with). But under TP 6.0 you just have to assign AddData to a local
variable... Problem is gone!!!!!
 
   Any problems, comments, develompents, improvements, fixes, etc, send
me an e-mail (lalm@cactus.iico.uaslp.mx). If it worked for you, please
send me a quick note. If you don't even have time to write a quick note,
just send an e-mail with subject: 'it works!!!!' :)

   Hope it is useful for you,
                                 Luis Lastras
