Topic: Interrupt/TSR Problem
Author: gpwrags@gp.co.nz
Date: 24 Nov 94 13:42:23 +1300 Raw View
Hello C/C++ users,
I have a bit of a problem. Myself and another are
required to write some software for our company that has us a bit
beat. The project is the purpose of reading impulses coming from a
printing press. What is required is, to have a TSR(Terminating and
Stay Resident) program sitting in memory reading and counting these
impulses which are approx 500/second, and another program every second
to register the count for that second. The second program would print
the results either to the screen or to a file. The impulses are paper
and reel speeds and they get to the PC via an input card that unfortunately
does not generate for hardware interrupts. Two programs are needed
because the TSR program can't be allowed to stop to do the printing &
recording of data or it will lose some impulses. The alogorithm we
have so far is:
TSR
-Interrupt(a DOS interrupt/function)
-Read the state of the input ports,
signal high => register
signal low => increment count
-Continue
Secondary
- Access the buffer that the TSR count is located, read it and then
clear it so the new count can begin for the next second.
-Print the speeds out to the screen or a file.
The main problems are:
- How to point to read a buffer that is being simutaneaously used by
two programs
- Which DOS function/interrupt to use since we can not use hardware
interrupts, this is the main problem
Any help/information at all would be appreciated.
Angus Sutherland
(gpwrags@gp.co.nz)