Re: Disabling some interrupts
"charles" <instrulab@xxxxxxxxxxxxx> wrote in message
news:HAqDf.23169$F_3.20906@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I am using Delphi 5 on a windows XP.machine. I am in communications with
an
> instrument via the serial port. When I start gathering information which
is
> only about every 2 minutes, and some one runs the scroll bar, using the
> mouse, up and down my program crashes.
>
> Because I gather data only once about every two minutes the operator walks
> around and drinks coffee and when he comes back he wants to see the record
> over the past hour or two and when he scrolls he loses his whole test.
>
> What I would like to do is when I start to gather data to disable all
> interrupts except the serial port and then enable those interrupts when
the
> test is done.
>
> Can I do that? And if so how do I do that? I am a novice and use Delphi
> only occasionally
>
> charles arnett
>
>
Charles:
I had responded to your previous post about disabling I/O operations, but
have not seen a reply to my suggestions or offers to help. As I said I am
relatively a novice at Delphi, but I have had extensive experience with
serial communications. Please read the software specifications and other
info, and even try running my program (if you dare), and then contact me if
you would like to discuss this further. My program uses the SerialNG
component for communications, and it seems much more stable than others I
have tried (some of them did cause crashes). I sometimes find that other
Windows background operations, probably the memory manager, will cause brief
pauses in my part of the data collection process, and sometimes data will be
lost. As I must collect it continuously in real time, at 2400 samples per
second, I just log the error count and move on. I have a debug window that
shows the number of bytes in the receive queue, and when errors occur, that
number goes up to the Maximum Queue size, which I have set at about 4800.
I can probably increase that quite a bit (anyone know of any practical
limits?), because it seems that sometimes Windows will go away and do some
sort of housekeeping that suspends the main thread, but I think the lower
level communications threads continue. Whenever I get a message that there
is data waiting in the ComPort Input Buffer, I immediately transfer it to a
separate buffer which I read and process about 5 times a second.
For your lower speed application, where real time performance is not needed,
I would suggest sending your data in some kind of packet with a checksum,
and ask for a resend if it has errors.
There must be something seriously wrong if your program crashes and you lose
the results of the test. My program very rarely crashes, except while I am
debugging new code, of course. Usually I get Access Violations which have
been mostly reading destroyed objects. I have also had problems when I did
not properly turn off the incoming communication stream before shutting down
the ComPort. I would sometimes get a hard crash if my hardware was
transmitting into the computer while rebooting.
Please feel free to contact me on this newsgroup or by email. I think I may
have emailed you from my work address, and I visited your website and was
contacted by someone (Mike?) who is sending me a CD with your demo software.
The company I work for, ETI, does calibration and may be interested in your
equipment.
--
Paul E. Schoen, President
P S Technology, Inc.
Cockeysville, MD
www.pstech-inc.com
.