Solved

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

Posted on 1997-11-18
12
371 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now