P E Schoen
2012-05-27 00:27:24 UTC
(http://www.torry.net/authorsmore.php?id=3670), and I was able to get it to
work well for my application, but I had to do some tricky coding, such as
setting a critical section, and saving incoming data to a separate buffer
which was then used for error checking and data processing. It is an
integral part of two of my products, and sometimes I still get errors, but
they are more likely caused by the USB serial port driver. I'm using a
Silicon Labs CP2103 USB device.
Now I am working on another project, and I'm just reading a string of
comma-separated text data with CRLF after each line. The line is about 30
characters and I'm transmitting at 9600 baud, 1 stop bit, no parity, and no
flow control. These lines are transmitted every 300 mSec. I was able to use
Hyperterm to verify that the data can be received and displayed accurately.
Hyperterm is a problem on Win7 because you can't reload the HT files and
must re-enter the communication parameters, but that's just an annoyance.
But when I made a simple terminal program using D4 and the SerialNG
component, I would get errors where it would miss characters and even entire
sequences, and I was able to get some improvement (or break it completely)
by fiddling with the cluster size and receive character timeouts. I was
parsing the incoming data and using the memo.strings.add method to display
each line when I detected a CRLF. So I thought maybe it was unsafe to do
this from the receive cluster event processor. The demo seemed to work, but
it is not a simple terminal and it also displays data as hex, with a
So, I downloaded and installed ComDrv32
(http://www.torry.net/pages.php?id=198), and confirmed that its terminal
demo received and displayed the data properly, and I incorporated it in my
program and it works perfectly well, without any "fiddling". I had a few
problems installing the component and I had to restart D4, but then it
seemed to compile and run fine.
Does anyone have experience with either of these components? Or recommend
another? I may try a new version of my Ortmaster application with the
ComDrv32 component. If I can do it more simply, I will be happy. KISS is