Board index » delphi » Serial/Parallel port communications -- HELP!

Serial/Parallel port communications -- HELP!

Does anyone know how to communicate to and from the COM ports?
I have a system with up to 6 COM ports that I have to set up a
read/write data link with. In delphi 1 it is easy, OpenComm,
CloseComm, etc...

Delphi 3 has substandard help and I cannot find this topic even
looking for the commands by name. I looked inside the windows.pas
file and found GetComm, SetComm but not the open and close
functions. Does anyone know what I have to do to communicate with
the COM ports in Win'95/NT4 - ie Delphi3?

Any ideas, or better still a book reference, would be appreciated!

Jon.

 

Re:Serial/Parallel port communications -- HELP!


OpenFile(COMn,{flags etc. that set fileaccess});

look for something like that, probably in the win32 help.

Hint: if you can't find too much in the delphi help try the win32 help if it
concerns 'lower level' calls.

HTH

  Roel

Quote
jpardoe <jpar...@ampersand.com.au> wrote:

: Does anyone know how to communicate to and from the COM ports?
: I have a system with up to 6 COM ports that I have to set up a
: read/write data link with. In delphi 1 it is easy, OpenComm,
: CloseComm, etc...

: Delphi 3 has substandard help and I cannot find this topic even
: looking for the commands by name. I looked inside the windows.pas
: file and found GetComm, SetComm but not the open and close
: functions. Does anyone know what I have to do to communicate with
: the COM ports in Win'95/NT4 - ie Delphi3?

: Any ideas, or better still a book reference, would be appreciated!

: Jon.

Re:Serial/Parallel port communications -- HELP!


In article <35204EEB.1...@ampersand.com.au>, jpardoe <jpar...@ampersand.com.au>
writes:

Quote
>Does anyone know how to communicate to and from the COM ports?
>I have a system with up to 6 COM ports that I have to set up a
>read/write data link with. In delphi 1 it is easy, OpenComm,
>CloseComm, etc...

>Delphi 3 has substandard help and I cannot find this topic even
>looking for the commands by name. I looked inside the windows.pas
>file and found GetComm, SetComm but not the open and close
>functions. Does anyone know what I have to do to communicate with
>the COM ports in Win'95/NT4 - ie Delphi3?

>Any ideas, or better still a book reference, would be appreciated!

Look in Win32.HLP Contents, Communications, About Communications and from that
page use the forward button ( >> ).
Basically, you have to open the port as a file using IOControl, and use the
handle in SetCommxxx calls. All these work through the driver, I don't think
the standard driver has support for more than 4 COM ports, and I expect your
multiple comm ports may not have a driver for Win32.

I'm afraid this is not much help <g>

Alan Lloyd
alangll...@aol.com

Re:Serial/Parallel port communications -- HELP!


-Try to look in the win32.hlp
-The 16 bit port function is moved to the win95 file operations.
-Try to find a component fx. Async32 where all the interface to the win API
is fixed

Re:Serial/Parallel port communications -- HELP!


I have Written a Delphi 3 Application using Serial Comms, If you have
Visual Basic 5, you will find the MSCOMM32.OCX, which is an ActiveX
Comms control, Just import this activeX into Delphi 3.
Note: you will have to Regester the .OCX into windows when you install
the finished application on another computer.
If you have any more questions dont hesitate in Emailing...

Mark Redman

//////////////////////////////////
/// Email: Red...@iAfrica.com  ///
/// UIN  : 160694              ///
//////////////////////////////////

Re:Serial/Parallel port communications -- HELP!


Quote
jpardoe wrote...

|Does anyone know how to communicate to and from the COM ports?
|I have a system with up to 6 COM ports that I have to set up a
|read/write data link with. In delphi 1 it is easy, OpenComm,
|CloseComm, etc...
|
|Delphi 3 has substandard help and I cannot find this topic even
|looking for the commands by name. I looked inside the windows.pas
|file and found GetComm, SetComm but not the open and close
|functions. Does anyone know what I have to do to communicate with
|the COM ports in Win'95/NT4 - ie Delphi3?
|

Hi,

You should look into the WIN32 API. See CreateFile(), DCB,
GetCommState(), SetCommState(), SetCommMask(), WaitCommEvent() and ...
study threads, especially if you want to use multiple ports as you
indicated. Under WIN32, you cannot efficiently do any serious
communication without using threads.  This is not exactly easy stuff.
If you're interested, I could mail you a basic unit that does much of
the dirty work.

Regards,
Dirk Claessens
______________________________________________
Home   : <dirk.claess...@village.uunet.be>
Office : <dirk.claessens...@belgium.agfa.com>
It's better to be approximately right,
than precisely wrong.
______________________________________________

Re:Serial/Parallel port communications -- HELP!


On Tue, 31 Mar 1998 12:03:23 +1000, jpardoe <jpar...@ampersand.com.au>
wrote:

(:>Does anyone know how to communicate to and from the COM ports?
(:>I have a system with up to 6 COM ports that I have to set up a
(:>read/write data link with. In delphi 1 it is easy, OpenComm,
(:>CloseComm, etc...
(:>
(:>Delphi 3 has substandard help and I cannot find this topic even
(:>looking for the commands by name. I looked inside the windows.pas
(:>file and found GetComm, SetComm but not the open and close
(:>functions. Does anyone know what I have to do to communicate with
(:>the COM ports in Win'95/NT4 - ie Delphi3?
(:>
(:>Any ideas, or better still a book reference, would be appreciated!

Better yet, 100255....@compuserve.com email this guy he has a TSerial
unit including source code for 15pounds UK. he has seperate ones for
D1 2 and 3. Speeds to 115K , flow control the lot!

Re:Serial/Parallel port communications -- HELP!


You might try AsyncPro by Turbopower, you can reach them at www.turbopower.com.
AsyncPro provides complete control for RS232, RS485, ISDN, Faxing, etc.

Bill Burt, Jr.
BBur...@AOL.COM

Other Threads