home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
turbopas
/
comdemo.ark
/
COMDEMO.DOC
< prev
next >
Wrap
Text File
|
1986-08-24
|
6KB
|
122 lines
COMDEMO.PAS - A TURBO PASCAL COMMUNICATIONS DEMONSTRATION
Introduction
COMDEMO.PAS is a demonstration of communications using Turbo Pascal. It
uses a proposed standard library of communications library of routines that
can be implemented for a variety of microcomputers. COMDEMO.PAS will allow
a connection to a remote computer via a communcations port. It will also
allow file transfer of ASCII files between the two computers.
COMDEMO.PAS was written as a 'test- case' for CLIB180.INC - it's also
useful as the 'first piece' to customize a 'text-capture' utility for a new
micro system, which doesn't yet have a way to 'talk protocol'. Turbo
Pascal's inherent compilation speed and relatively high portability will
help in getting the first and crucial step accomplished : enable text
capture to and from another system. The typical next step is to establish
an error correcting protocol like Kermit.
Further information is available from 'CLIB180.INC', 'CLIB180.DOC', and
the source of this program 'COMDEMO.PAS'.
COMDEMO.PAS makes heavy use of the standard communications library. All
character I/O is done through the library functions, and disk I/O is done
through standard Turbo functions. This program should run on most micro-
computers that are supported by Turbo Pascal without modification, if a
similar set of library functions are implemented for it.
This program was written by Jeff Duncan, with considerable help and
advise from Bernie Eiben. Comments, suggestions, etc, are welcome. I can
be reached at (617) 839-5673 (evenings) or send comments to
LSM>DUNCAN@DEC-MARLBORO (preferable).
Installation
Unless the user obtains a compiled copy of COMDEMO.PAS for his system, it
must be installed and compiled. The following is the installation
procedure for the program.
1. Obtain a copy of COMDEMO.PAS and the communications library include
file for your system.
2. Rename the include file 'COMMLIB.INC'.
3. Compile COMDEMO.PAS to disk.
4. Installation complete.
Operation
When COMDEMO.PAS is run, the message : *** Connected to remote port ***
is printed on the console. At this point, all characters displayed on the
screen are characters received from the communications port. Any
characters typed at the console are sent out the communications port. This
creates a virtual terminal connection to a remote system.
Also printed is a menu of commands possible for COMDEMO. All are
prefixed with Control-backslash. All commands may be in upper case, lower
case, or the control representation of the character. The following are
the possible commands:
B- Set the baud rate. A list of possible baud rates is displayed and
the user is prompted to type the number of the desired baud rate.
The program reports the success or failure of the operation, and
reconnects to the communications port.
D- Set carriage return delay. This will allow the user to set the
delay after each carriage return is sent during a send operation.
The default delay is 0, and the actual value of delay is system
dependent. Maximum value for the delay variable is 32767. This
will help when sending to a system that requires a delay, and will
also help by allowing a slow echoing system time to catch up and not
overflow the computer's input buffer. On a VT180, numbers in the
100's will give a reasonable delay as the delay is approximately
5ms/unit.
E- Exit program. Any open log files will be closed.
H- Redisplay menu.
P- Set the communications port. A list of possible ports is displayed
and the user is prompted to type the number of the desired port.
The program reports the success or failure of the operation, and
reconnects to the communications port.
Q- Exit program. Any open log files will be closed.
R- Receive a file. A prompt will be given for a filename, and that
file will be opened. Warning, this is a destructive open, no check
is done for an existing filename. All characters received from the
communications port will be saved in a log buffer. When logging is
complete, either ^\-W, or an exit command will close the log file
and save it to disk. The size of the log buffer is 32k, so on small
systems this program must be compiled to disk. The size of the log
buffer is set by the constant 'maxbuffer'. Fortunately, the size of
the log buffer does not affect the size of the compiled program, at
least under CP/M, so any size may be used provided it fits in
memory.
S- Send a file. A prompt will be given for a filename, and that file
will be sent via the communications port to the remote system. All
lines will be terminated with a carriage return only to be
compatible with typical editors and text capture mechanisms of
computers. At the end of the file transfer, the file will be
closed. All characters received during the file transfer will be
displayed on the screen. Typing any character will abort the
operation.
W- Write currently logged data, and close the log file. All data
accumulated will be saved in the open file, if one were opened at
the time. No warning is given if a file was not opened, or no data
was accumulated.
System Dependent Code
There should be no system dependent code in the program, except, of
course, the communications library. The program sets the default
communications port, baud rate, and parity as defined in the communications
library. Other ports and baud rates may be set after the program is
started by using the ^\-B and ^\-P commands.