?
Solved

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

Posted on 1997-11-18
12
Medium Priority
?
405 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 400 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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.

Join & Write a Comment

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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…

585 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