Solved

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

Posted on 1997-11-18
12
375 Views
Last Modified: 2010-08-05
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.
0
Comment
Question by:girona
  • 6
  • 5
12 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
ID: 1350797
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
 
LVL 8

Expert Comment

by:ZifNab
ID: 1350798
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
 

Author Comment

by:girona
ID: 1350799
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 8

Expert Comment

by:ZifNab
ID: 1350800
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
 

Author Comment

by:girona
ID: 1350801
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
 
LVL 8

Expert Comment

by:ZifNab
ID: 1350802
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
 

Author Comment

by:girona
ID: 1350803
Do you know the SDP address? I couldn't find it. Thanks.
0
 

Author Comment

by:girona
ID: 1350804
Do you know the SDP address? I couldn't find it. Thanks.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1350805
sunsite.icm.edu.pl/delphi
sunsite.informatik.RWTH-Aachen.DE/delphi

0
 

Author Comment

by:girona
ID: 1350806
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
 

Expert Comment

by:brianf112697
ID: 1350807
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
 
LVL 8

Expert Comment

by:ZifNab
ID: 1350808
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

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question