I was wondering if anyone knew of any issues of using ON TIMER and
$EVENT OFF / $EVENT ON.
I have a routine that sends a string out a serial port (COM2) that
must not be interrupted by an ON TIMER that is running at .25 seconds.
The routine that sends the string is bracketed by the $EVENT OFF and
$EVENT ON as ahown below.
---------------
$EVENT OFF
SUB SENDSTRING(S$)
'code to send S$ to COM2
PRINT #2, S$
END SUB
$EVENT ON
-----------------
The sub sendstring() is interrupted (branches to the ON TIMER GOSUB
routine) midway through sending the string out the comport. (causing
big problems)
Prior to calling SENDSTRING() other procedures may have also disabled
event trapping by using the same $EVENT OFF / $EVENT ON.
After these routines turn event trapping back on a couple of small
procedures are called before calling SENDSTRING() when it gets
interrupted.
Is there some latency in the code between where event checking is
enabled and when it gets in to the routine where it is again disabled
that might cause this interruption?
I would be glad to post the exact code that causes the problem,
however it is rather large and comples and this problem has shown up
rather infrequently, and only when communicating with other devices
over the serial port. For this reason I do not think it would help.
The program is running in a DOS window on W98se.
Any thoughts or suggestions would be much appreciated, thanks in
advance.
------------------
Comment