

                            Simple Time/Date Logger

                               by Steve Lawther
                               
This code can be used to log the time and date of a switch or 5 volt TTL input
changing state, say for logging when an equipment on extended test goes into
fault. It needs a PC to be left on though the testing, and uses the PC's clock,
so logging resolution is about 1/18 of a second.

An example of the use of the code was when a logic analyser connect to an
equipment on unattended test indicated multiple occurances of a fault
condiction.  The logic analyser was too old to log the timing of the triggers,
so an old tosh. portable PC and this program was added to monitored the
'trigger output' of the analyser.  On the Monday after a week-end of unattended
testing, the analyser again showed multiple triggers.  The time / date logging
showed though that all of the triggers had occured at 7.31 on the monday morning.
It turned out that this was the time at which the factory started a 280 KVA
motor-generator machine - the starting sequence put severe transients onto the
factory mains, which corrupted the logic analyser, falsely triggering it! - The
equipment under test was fine!

The logger watches the 'Out-Of-Paper' signal and logs any change in its state
to both the screen and the hard-disk. The hard-disk file is called RESULTS.CDU
in the root directory of C drive. It is only opened for the instant of writing
a change, as protection against power-cuts and over-zealous security guards
corrupting it.

CONNECTIONS

For a ground refered signal, just connect the signal to pin 13 of the PC's 
25 way D type, and the ground to pin 18 of the D type. 

For a switch or other contacts just connect as above; this works so long as
the input is pulled up inside the PC. How do you know if it is? - Just try it
and if it works ok, fine.
If it doesn't, add a resistor (10K) between pin 13 and one of the data pins
(pins xx to xx), and output 255 to the printer port to pull the data pins high
 - This need the addition of a line in the C code to set it up.

USING THE EXE

Remember to check the PC's time and date before using.

run 'LOGGER.EXE' and press any key to start. All changes from then on are
logged  to the screen and hard-disk - the file is called RESULTS.CDU
in the root directory of C drive. To stop the logging again press any key.

THE SOURCE CODE

The C code (borland C++)is provided for you to alter to your own requirements,
eg to extend logging to other signals using the other printer port inputs
 - ERROR, BUSY, etc or to change the wording and file-name from the situation
specifics currently there.

LEGAL STUFF

Note:-
        Any user of this code should be aware the code is provided as is,
        and has not been fully tested to commercial standards.
        
        The author would be grateful for any bug reports, and descriptions
        of the uses this code has been put to.

        
-------------------------------------------------------------------------------  
****************************************************************************
*    All code supplied in 'LOGGER.ZIP' and the resulting compiled code     *
*               copyright 1994-96 Steve Lawther                            *
****************************************************************************

Use of any of this code requires Steve Lawther to be credited within the
source code.
Any Commercial use of part or all of this code requires the permission of the
author, Steve Lawther, and a payment may be required. For more details
Email 
        steve.lawther@gecm.com
--------------------------------------------------------------------------------       

Here ends the legal stuff - Go use the code.

