Commchk.doc	Version 1.8

	Documentation for the Serial protocol analizer

	Commchk is used to analyze information on a serial line by
	intercepting the information and allowing you to view the
	captured information in either a HEX format or in an ASCII format.
	The information captured may also be saved in files stored on disk.

	Commchk performs this function by routing any information read from
	com1 to com2 and any information read from com2 to com1, while
	capturing the information for display and or saving to a file.

	Commchk will split the screen into 2 windows, an upper window
	and a lower window. the upper window will display the information
	captured from com1 and sent to com2. The lower window will
	display the information captured from com2 and sent to com1.

	This program was developed to allow analyzing information being
	send from a host computer to a slave computer to determine the
	source of errors that were getting into the system.

	Alternatively, Commchk can be used to allow a computer that does
	not have a modem to access the modem of a second computer.

	Commchk command line options are summarized as follows.

		-1, -2, -3, -4	Setup ports to use. The first entry becomes
				the port designated com1 at the top of the
				screen. The second entry becomes the bottom
				half of the screen.

		-I 0/1/2	all commands up to the next "I" command
					are for the identified port.
					0 = both ports
					1 = com1
					2 = com2

		-B baud		baud rates from 300 baud to 57600
				baud are supported.

		-C		Turn on TSC Computer CRC checking
				This will then generate an additional file
				with a "C.FIL" appended when disk capture
				is turned on.

		-F file name	the file name must not have a length of
				greater than 7 characters, not including
				the path name. It is used to create create
				2 files, one for information read from com1,
				and one for information read from com2 by
				appending the communications port number
				and .fil to the end of the file name.
				IE: -f test
					generates test1.fil - com1 info
						  test2.fil - com2 info

					 -f c:\commchk\test
					generates c:\commchk\test1.fil
						  c:\commchk\test2.fil

		-H Help off	Turn off the initial help screen

		-M		Turn Modem/Line status checking on/off

		-N 		Set the port name to display on the upper
				line of the port display screen

		-P parity	Allowable paritys are
				EVEN, ODD, NONE

		-W word length	7 or 8 bits

		-R Resident	As soon as the program gets the serial ports
				initialized it will imiadiately shell out to
				dos. Information will continue to pass thru
				the serial ports from one to the other.

		-S stop bits	1 or 2 stop bits

	Example startup command:

		COMMCHK -I 1 -B 1200 -P E -W 7 -S 2 -I 2 -B 4800 -P N -W 8

		THIS SETS COM1 TO 1200 BAUD, 7 BIT, EVEN PARITY, 2 STOP BITS
		AND COM2 TO 4800 BAUD, NO PARITY, 8 BIT.


	Commchk uses an initalization file named "COMMCHK.INI" to initialize
		the serial port parameters.

		If no initialization file is found then the ports will default
		to the default PC serial port values. Values for all ports do
		not need to be supplied.

		Only values for the ports you want to change from the default.

		You may also place command line parameters in the commchk.ini file.
		The first character on a line containing command line parameters
		"MUST" be a "-" character or the line is interpeted as a serial port
		setup line as described in Section "A" below.


	Section A:
		The format of the ini file is as follows:


port,base address,interrupt vector		<== serial port setup
port,base address,interrupt vector

-M -B 4800								<== command line parameters.
-P

		The allowable ports are 1 - 6.


	The commchk display is as follows:
PORT1 BUFFER     0.0   SYSTEM BUFFER      0.0   RTS DTR DSR CTS      0     0
		 ^ SIZE OF THE BUFFER FOR PORT 1
					  ^ SIZE OF THE BUFFER USED FOR DISPLAY
				 TOTAL NUMBER OF SERIAL PORT ERRORS  ^
				 LAST RECIEVED SERIAL PORT ERROR CODE      ^

	Commchk keyboard commands are summarized as follows.

		F1 key - Help

		F4 key - Allow changing the serial port characteristics online.

		O  key - Open the currently active capture files

		C  key - Close the currently active capture files

		D  key - Toggle video display on and off

		F  key - Flush out all current serial port buffers
				 of all characters.

		A  key - place the display in ASCII mode

		H  key - place the display in HEX mode

		I  key - Reinitialize the port, also clears all buffers

		Q  key - Quit

		R  key - Toggle the RTS line

		S  key - Shell out to dos - interrups and information flow from
				 one port to the other continues to occur

		T  key - Toggle the DTR line

		L  key - Toggle the line display status line

		M  key - Toggle the Line and Modem status interrupt on/off
				 if you are on a system where the unused lines are allowed to
				 float then they may cause numerous interrupts to occur and
				 appear to lock your system. so turning these interrupts off
				 may fix this problem.

	Commchk Startup defaults are as follows
		2400 Baud, 8 Data bits, 1 Stop bit, No parity
		No capture file, com1 and com2 ports


Revision History:

	11/5/90  - 	Fixed serial protocol data errors.


	11/13/90 - 	Modified help routine to not interrupt serial data flow.

			Added Flush buffer command.

			Modified asynchronous character send routine
			errors that caused loss of characters.

			Added code to allow setting of the serial
			ports to different parameters.

			Removed SHAREWARE message.

	VERSION 1.3
	11/27/90 - 	Modified code to use only 8088/8086 code.

			Added a line at the bottom of the status windows
			that displays statistics about the serial port

			Added code to allow toggling the RTS and DTR lines

			Modified the asyncronous lines to have all serial port
			IO completely asyncronously driven to assist in
			performance on slower computers.

			Added code to allow changing the serial port
			characteristics while the program is running (F4 key).

	VERSION 1.4/1.5
	04/26/92 - 	Added the -H Startup command to turn off the initial
			help screen.

			Added the -R Command to perform an imiadiate shell to
			Dos.

	VERSION 1.6
	11/06/92	Added Port names to display for identifying the port
			Added CRC Checking for testing
			Added "C" command to turn CRC testing on

	VERSION 1.7
	01/29/93 - Modified to allow any baud rate from 50 to 115200 baud to
			be used.

		 - Added comm ports 5 & 6.

		 - Added "COMMCHK.INI" initialization file.

		 - Added ability to use 5 and 6 bit word length.

	VERSION 1.8
	02/07/93 - Fixed command line parsing for 5 and 6 bit word length

		 - Added ability to turn off Line/Modem status interrupts

		 - Added ability to place command line commands in the initialization
		   file "COMMCHK.INI"

	Written using Turbo C++, Borland C++ by:

		Timothy L. Garrison
		3003 W. Marquette Woods Rd.
		Stevensville Mi. 49127
