Serial port communications with Delphi 3.0 and Windows NT 4.0/95

I'm ussing Delphi 3 Proffesional Version with Windows NT 4.0 or Windows 95 indistinctively, and I need to access to serial ports to communicate with a multiport board. I need to know the way of doing that (mainly in Windows NT 4.0). Extra points will be given for a rapid solution.
gironaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZifNabCommented:
Hi girona!

I've got two solutions:

 One : Use a freeware component. It's one I use now and it's very good. It's programmed for D2 BUT I'm sure it also works for D3. It uses Win Api32 so you can't use it for D1 (then you need the 16bit version of it) It works on Win95 and NT 4.0 because I use that too.

 Two : Make your own component. For that I found a very good documentation with samples on the net. It had everything you need for writing to hardware ports (3.x, 95, NT) I can send that to you too.

 Component can be found on (maybe there is a D3 version now, but I don't think that's needed, because this component already uses Win APi 32) :

TCommPortDriver.

URL   : * new * http://mdlive.com/d3k/
      * old * http://free.websight.com/Cocco2/

Need help using it, no problem it's easy and well documented and if you still got problems I can try helping you. I also use this component.
Can't find the component? Just ask! and I'll send it to you by a way you like it.

Documentation :

 Problem, I don't know anymore from which site I got this. So if you want it, we 've to find a way to send it to you. By e-mail?

Have fun,
c.u. ZifNab;


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ZifNabCommented:
Well, isn't this weird?
If you speak of the devil! Just browsing around and guess what? The maker of CommPortdriver just released a new version for all delphi versions. Here you can get it :

torry.rimini.com/vcl/comms/cd320107.zip

 Try it out and good luck!

c.u. ZifNab;
0
gironaAuthor Commented:
Thanks for that information, I'll try it this afternoon (GMT+1 time). I'd also interested in where can I find (or if you can send me) that information about creatin my own component for communications. P.S.: my e-mail is 'jagirona@hotmail.com'
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

ZifNabCommented:
Hi girona,
I'll send you the information to your address. I'll also include the TcommDriver component (D1,D2,D3,CB)

Have fun,
c.u. ZifNab;

0
gironaAuthor Commented:
Thanks for that ZifNab. Now I have more doubts (told me just 15 minutes ago). I have to create a multithread process with two threads, one have to be reading the multiport board in a non-end loop and send some parameters to the other thread that have to access a database. I tried the threads in Delphi 2.0 but I couldn't do anything because it hanged the program. How can I do that (in Delphi 3 and NT/95)?
0
ZifNabCommented:
Sorry, with threads I can't help you. Sorry. Haven't used them. I once read something about them, but also I can't remember where exactly. At SDP or Torry help documents I suppose.
But with the new version of TCommDriver component you can use threads, maybe there lies an answer. Sorry, that I'm not able to help you.

0
gironaAuthor Commented:
Do you know the SDP address? I couldn't find it. Thanks.
0
gironaAuthor Commented:
Do you know the SDP address? I couldn't find it. Thanks.
0
ZifNabCommented:
sunsite.icm.edu.pl/delphi
sunsite.informatik.RWTH-Aachen.DE/delphi

0
gironaAuthor Commented:
I finally used the TcommPortDriver from Cocco in the program. It works right but what I can't make is put the right timeouts. I have to read packets of 17 bytes, and I have three different timeouts. A 50 miliseconds timeout between bytes, a 400 ms timeout to receive a ACK/NACK and a 800 ms timeout between different packets. The ACK/NACK is a packet of three bytes. Do you have an idea of where have I to put these differents timeouts? I can read from the keyboard in com6, I send it a packet and works fine, but when I try to send more than one (three for example), only one or two arrive.
0
brianf112697Commented:
Hi
I think I have done the same thing that you are wanting to do.
The problem we had was that we needed to read multiple comm ports (4) then write them aout to a series of database tables then every X number of readings we had to empty the data and do some analysis and then write the data to history complete with charts ouch. If you would like I can send you some code to show our technique it probably won't be what you need but would probably give you some ideas on how to proceed.

Luck
Brian
0
ZifNabCommented:
Sorry, that I haven't answered yet, but my computer had a little 'melt-down'. It's already solved now, but still have problems. I don't have a quick answer right now to your question, but I'll look at it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.