Solved

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

Posted on 1997-11-18
12
378 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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