Discussion:
Serial port component, ComDrv32 vs SerialNG
(too old to reply)
P E Schoen
2012-05-27 00:27:24 UTC
Permalink
Raw Message
For a long time I have used the SerialNG component provided by Domis
(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
date-time stamp.

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
wonderful!

Thanks,

Paul
Jamie
2012-05-27 01:08:47 UTC
Permalink
Raw Message
Post by P E Schoen
For a long time I have used the SerialNG component provided by Domis
(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 date-time stamp.
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 wonderful!
Thanks,
Paul
I don't use components for that operation, I simply do it at the API
level..

I am thinking that what ever problem you are having with the serial
port is most likely a miss use of code in the components you down loaded?

If you are not using hardware flow control, there are issues with
some of these so called USB serial adapters.


I never have written a serial component, maybe I should take a crack
at it ! :)

Jamie.
S.G
2012-05-27 09:44:31 UTC
Permalink
Raw Message
Post by P E Schoen
Does anyone have experience with either of these components? Or
recommend another?
I have not even heard about either of those components, not ever.

I have always thought and assumed that "everybody" developing with
Delphi and doing serial port communication use the old good Turbo Power
Async Pro package.
http://sourceforge.net/projects/tpapro/

All my serial communication is done with Asynch Pro for 10 years or
more. Nothing specially fancy though, fax machines, payment terminals,
serial printer tasks etc. only.

You were talking something about critical sections and maybe threads, I
have never had to go there. But I see Asych Pro newsgroup has rather
fresh postings about them also.

S.G.
Marco van de Voort
2012-05-27 20:40:14 UTC
Permalink
Raw Message
Post by S.G
I have always thought and assumed that "everybody" developing with
Delphi and doing serial port communication use the old good Turbo Power
Async Pro package.
http://sourceforge.net/projects/tpapro/
Hmm, I usually see TComport (by Dejan Crnila) being used:

http://sourceforge.net/projects/comport/
P E Schoen
2012-05-28 02:29:52 UTC
Permalink
Raw Message
Post by Marco van de Voort
Post by S.G
I have always thought and assumed that "everybody" developing
with Delphi and doing serial port communication use the old
good Turbo Power Async Pro package.
http://sourceforge.net/projects/tpapro/
http://sourceforge.net/projects/comport/
I downloaded them but the documentation for the Asynch Pro specifies D7 and
above, while TComport is D5 and above. I have D4.

Thanks,

Paul
S.G
2012-05-28 06:55:33 UTC
Permalink
Raw Message
Post by P E Schoen
I downloaded them but the documentation for the Asynch Pro specifies D7
and above, while TComport is D5 and above. I have D4.
http://sourceforge.net/projects/tpapro/files/tpapro_docs/4.06/tpapro_docs.zip/download
SystemRequirements
------------------
To use Async Professional, you must have the following hardware and
1. A computer capable of running MicroSoft Windows 95/98/ME or
Windows NT/2000.
A minimum of 16MB of RAM is recommended.
2. Delphi 3 or later or C++Builder 3 or later.
That's what I currently see there.

I have used older era Apro versions also in D3, back in nineties.
Jamie
2012-05-28 15:08:27 UTC
Permalink
Raw Message
Post by S.G
Post by P E Schoen
I downloaded them but the documentation for the Asynch Pro specifies
D7 and above, while TComport is D5 and above. I have D4.
http://sourceforge.net/projects/tpapro/files/tpapro_docs/4.06/tpapro_docs.zip/download
SystemRequirements
------------------
To use Async Professional, you must have the following hardware and
1. A computer capable of running MicroSoft Windows 95/98/ME or
Windows NT/2000.
A minimum of 16MB of RAM is recommended.
2. Delphi 3 or later or C++Builder 3 or later.
That's what I currently see there.
I have used older era Apro versions also in D3, back in nineties.
I just totally love the new fire fox version that got shoved down my
throat.. THat link up there totally screws it up and locks it every time..

Jamie
P E Schoen
2012-05-29 04:31:20 UTC
Permalink
Raw Message
Post by S.G
2. Delphi 3 or later or C++Builder 3 or later.
That's what I currently see there.
I have used older era Apro versions also in D3, back in nineties.
The documentation appears to be for an earlier commercial version. The
download is for version 5.00:

http://sourceforge.net/projects/tpapro/

The readme states:

where <Compiler> is one of:
<D7> -- for Delphi 7.
<D2005> -- for Delphi 2005. (win 32 target).
<D2007> -- for Delphi 2006 and Delphi 2007.
<D2010> -- for Delphi 2010.

And the document PDFs in the download are for older versions from around
2001 where D3 was specified.

Hopefully the ComDrv32 package will meet my needs. I'll have a better idea
if I use it in my www.ortmaster.com software, but that's a major project and
unfortunately not designed well enough to make the conversion easy. It was
my first Delphi project (~2003) and for quite while I did not have a proper
grasp of OOP. And I'm still weak in that aspect of programming. I made my
first Windows app using BorlandC++, but I also had C4 and a friend uses
Delphi professionally and recommended that I use it.

The other library I found specifies D5 and above in the readme file, but the
packages include packages for D3 and D4:
package CPortLib4;

Thanks,

Paul
Marco van de Voort
2012-05-29 07:34:34 UTC
Permalink
Raw Message
Post by P E Schoen
The other library I found specifies D5 and above in the readme file, but the
package CPortLib4;
Afaik that /is/ the TComport component.
S.G
2012-05-29 09:09:34 UTC
Permalink
Raw Message
Post by P E Schoen
Post by S.G
I have used older era Apro versions also in D3, back in nineties.
The documentation appears to be for an earlier commercial version. The
Asych Pro turned to open source already about in 2005. Also the 4.x
versions were free versions.

Yet Sourceforge does not seem ot offer any older versions for download
at all. Looks like they are even quite actively refusing it.

There are several direct links from outside that point to 4.06 version
ZIP packages on Sourceforge site. Now I see all these links have been
directed to point only to the new 5.0 version.

Yet the older 4.06 version that I also currently have, and works on
D3..D7 versions, it is available for instance from here.
http://statik.kappa.ro/download/utilities/net/tpapro_4_06.zip

S.G.
P E Schoen
2012-05-29 10:20:38 UTC
Permalink
Raw Message
Post by S.G
Yet the older 4.06 version that I also currently have, and
works on D3..D7 versions, it is available for instance from
here.
http://statik.kappa.ro/download/utilities/net/tpapro_4_06.zip
I downloaded it, installed it, and I'm running the terminal demo. Seems to
work well.

Thanks!

Paul
P E Schoen
2012-05-29 12:35:15 UTC
Permalink
Raw Message
Post by P E Schoen
I downloaded it, installed it, and I'm running the terminal demo.
Seems to work well.
I spoke too soon. I am not sure I installed it correctly, and while the
application was running it got hung up and I had to close Delphi. When I
restarted, I got a series of errors. So I have Delphi running, and

(1) I select the A406_R40.dpk as a project
(2) I compile it. I don't see any indication that it did, but I think it was
already compiled. I have the A406_R40.bpl in the packages folder, and the
date/time is current.
(3) I click install but it gives me the error not a design time package. OK.
(4) I close the project.
(5) I choose to install the A406_D40.dcu. It tries to read it into the
editor and truncates a line.
(6) I choose to install the A406_R40.dcu. It tells me the package was
installed and components registered and they appear on the tabbed list. Now
I can load the demo project and all is OK, for now.
(7) I exit Delphi, and then restart. It says the program can't start because
A406_R40.bpl is missing from your system. Try reinstalling the program to
fix this problem.
(8) Then another dialog box about trying to load it next time. I click no
and I don't get the errors, but the components are gone until I reinstall
them.

But the A406_R40.BPL is in the Delphi4\Lib folder and it has been updated.
I'm not real excited about reinstalling Delphi and the upgrade patches and
regenerating the various other components I have, but maybe that's what it
will take. But for now, I'll just use the serial port component I have that
seems to be working.

I don't fully understand the process of installing packages and components.
Some other weird things also happened, where it complained that the file was
already open in another editor, and the A406_D40 was added to the project
and it complained it could not find the PAS file of that name.

Thanks,

Paul
Jamie
2012-05-29 15:43:13 UTC
Permalink
Raw Message
Post by P E Schoen
Post by P E Schoen
I downloaded it, installed it, and I'm running the terminal demo.
Seems to work well.
I spoke too soon. I am not sure I installed it correctly, and while the
application was running it got hung up and I had to close Delphi. When I
restarted, I got a series of errors. So I have Delphi running, and
(1) I select the A406_R40.dpk as a project
(2) I compile it. I don't see any indication that it did, but I think it
was already compiled. I have the A406_R40.bpl in the packages folder,
and the date/time is current.
(3) I click install but it gives me the error not a design time package. OK.
(4) I close the project.
(5) I choose to install the A406_D40.dcu. It tries to read it into the
editor and truncates a line.
(6) I choose to install the A406_R40.dcu. It tells me the package was
installed and components registered and they appear on the tabbed list.
Now I can load the demo project and all is OK, for now.
(7) I exit Delphi, and then restart. It says the program can't start
because A406_R40.bpl is missing from your system. Try reinstalling the
program to fix this problem.
(8) Then another dialog box about trying to load it next time. I click
no and I don't get the errors, but the components are gone until I
reinstall them.
But the A406_R40.BPL is in the Delphi4\Lib folder and it has been
updated. I'm not real excited about reinstalling Delphi and the upgrade
patches and regenerating the various other components I have, but maybe
that's what it will take. But for now, I'll just use the serial port
component I have that seems to be working.
I don't fully understand the process of installing packages and
components. Some other weird things also happened, where it complained
that the file was already open in another editor, and the A406_D40 was
added to the project and it complained it could not find the PAS file of
that name.
Thanks,
Paul
If you are operating the system in package mode, I think you need a
copy of the package file in OS system folder.

If you browse your windows/system32 folder, you may find many package
files there.


When a final product runs on another PC, the system32 folder is
usually the place the packages get installed, if it gets compiled to
work that way.

You can elect a stand alone app of course, with everything compiled
in it, which is what I do however, the IDE, the last time I looked,
operates via packages. Also, if you are seeing this error in a test run,
it too maybe expecting to find the package in the system32 folder.

Jamie
P E Schoen
2012-05-30 07:10:09 UTC
Permalink
Raw Message
Post by Jamie
If you are operating the system in package mode, I think you need
a copy of the package file in OS system folder.
The compiled executable works just fine. It is the design time file that has
a problem. It is looking for A406_D40.bpl. It was not in the Delphi BIN
folder, where all the other BPL files are, but putting a copy there does not
help
Post by Jamie
If you browse your windows/system32 folder, you may find many
package files there.
Nope. Not a one.
Post by Jamie
When a final product runs on another PC, the system32 folder
is usually the place the packages get installed, if it gets
compiled to work that way.
You can elect a stand alone app of course, with everything
compiled in it, which is what I do however, the IDE, the last time
I looked, operates via packages. Also, if you are seeing this error
in a test run, it too maybe expecting to find the package in the
system32 folder.
No, my programs are all stand alone. It is the Borland IDE that has a
problem. The strange thing is this:

(1) With Delphi running, I select Components | Install Packages. The Asynch
Pro design time package appears in the list, but when I check the box it
says it can't find the file. although I know it is there, in the path given.
(2) I select Install Component. The Asynch run time and design time
components are in the selection box. But the unit file name is blank, and it
wants something there. It defaults to PAS files but it will accept a DCU. I
am assuming it is the design time package so I select A406_D40.DCU. But it
tries to load it into the editor, and truncates a line.
(3) But if I select the A406_R40.DCU, it just shows the package manager. But
now I can select Install Packages, and when I check the box, the components
appear and all is OK until the next time I start Delphi.

I'm about done with this, but I'd like to know what's going on. Maybe if I
reinstall from the original CD it may give me an option to repair the
program? Will it keep my installed components and preferences and settings,
and the upgrade patches?

Thanks,

Paul
Jamie
2012-05-30 15:01:16 UTC
Permalink
Raw Message
Post by P E Schoen
Post by Jamie
If you are operating the system in package mode, I think you need
a copy of the package file in OS system folder.
The compiled executable works just fine. It is the design time file that
has a problem. It is looking for A406_D40.bpl. It was not in the Delphi
BIN folder, where all the other BPL files are, but putting a copy there
does not help
Post by Jamie
If you browse your windows/system32 folder, you may find many
package files there.
Nope. Not a one.
Post by Jamie
When a final product runs on another PC, the system32 folder
is usually the place the packages get installed, if it gets
compiled to work that way.
You can elect a stand alone app of course, with everything
compiled in it, which is what I do however, the IDE, the last time
I looked, operates via packages. Also, if you are seeing this error
in a test run, it too maybe expecting to find the package in the
system32 folder.
No, my programs are all stand alone. It is the Borland IDE that has a
(1) With Delphi running, I select Components | Install Packages. The
Asynch Pro design time package appears in the list, but when I check the
box it says it can't find the file. although I know it is there, in the
path given.
(2) I select Install Component. The Asynch run time and design time
components are in the selection box. But the unit file name is blank,
and it wants something there. It defaults to PAS files but it will
accept a DCU. I am assuming it is the design time package so I select
A406_D40.DCU. But it tries to load it into the editor, and truncates a
line.
(3) But if I select the A406_R40.DCU, it just shows the package manager.
But now I can select Install Packages, and when I check the box, the
components appear and all is OK until the next time I start Delphi.
I'm about done with this, but I'd like to know what's going on. Maybe if
I reinstall from the original CD it may give me an option to repair the
program? Will it keep my installed components and preferences and
settings, and the upgrade patches?
Thanks,
Paul
The use of the "_" in the file name looks suspicious?

Jamie
P E Schoen
2016-08-18 23:50:02 UTC
Permalink
Raw Message
Post by S.G
Post by P E Schoen
Does anyone have experience with either of these components? Or recommend
another?
I have not even heard about either of those components, not ever.
I have always thought and assumed that "everybody" developing with Delphi
and doing serial port communication use the old good Turbo Power Async Pro
package. http://sourceforge.net/projects/tpapro/
All my serial communication is done with Asynch Pro for 10 years or more.
Nothing specially fancy though, fax machines, payment terminals, serial
printer tasks etc. only.
You were talking something about critical sections and maybe threads, I
have never had to go there. But I see Asych Pro newsgroup has rather fresh
postings about them also.
I know this is an ancient thread, but I have experienced some new problems
using SerialNG with Windows 10, and I was able to use the demo TTY
application from ComDrv32 to verify that it works on Win10. However, after
modifying my Ortmaster project to use ComDrv32 instead of SerialNG, it works
on my Win8 machine but still has problems on Win10. The problems were
noticed by a customer who upgraded a tablet from Win8.x to Win10, and the
application no longer works. Thus it cannot be the hardware of the USB port
used for CDC emulation, and is likely not in the BIOS.

On my Win10 Toshiba Satellite laptop, the application tries to test the
serial port by sending test characters and expecting a certain response. But
the application with the ComDrv32 component shows an error of BufferMax. The
previous application with SerialNG gives the following error messages:

Msg start reactivating port
Error reopening port
Error cannot set queue size
Msg start reactivating port
Error getting overlapped result (19x)
Msg start deactivating port
Error setting Comm Timeout
Error writing data

I downloaded and installed the Async Pro package, but the demo Emulator.exe
simple terminalprogram only seems to recognize COM2 and my device enumerates
as COM16 on my Win8 machine.

Hopefully this newsgroup is still active enough to be useful. I've been away
for a couple of years doing more work with PIC coding, Arduino coding, and
electronics projects. I see that SED is still very active, although many of
the discussions are political. I registered on the Embarcadero forum but
that seems pretty inactive. The Delphi Pages forum
(http://www.delphipages.com/) seems quite active, but although it shows that
I have successfully registered, I can't post.

Thanks!

Paul

Loading...