Board index » delphi » Help Request: Serial communication Problem in Delphi

Help Request: Serial communication Problem in Delphi

All,

I am write a program which uses serial communication.
In the program, I may use port number more than com10.
I have test my program, when port number is less than Com10.
It can work. But when I want to use Com10. It can't work.
I don't know why? Please help. Thanks in advance.
Environment: Delphi 5, Windows2000
Createfile call format:
FHandle := CreateFile( pchar('\\.\' + PortName),
                         GENERIC_READ or GENERIC_WRITE,
                         0, // Not shared
                         nil, // No security attributes
                         OPEN_EXISTING,
                         FILE_ATTRIBUTE_NORMAL,
                         0 // No template
                        ) ;
Thanks again.

Ryan Liu

 

Re:Help Request: Serial communication Problem in Delphi


Are you sure that you have 10 com ports in your system? It sounds unlikely.
A quick look in the Win32.hlp file doesn't show any limit for number of com
ports on the system. How are you generating the "Portname" string?

Cheers,
Nicholas Sherlock

Quote
"Ryan Liu" <yy...@lucent.com> wrote in message

news:b3kol8$ato@netnews.proxy.lucent.com...
Quote
> All,

> I am write a program which uses serial communication.
> In the program, I may use port number more than com10.
> I have test my program, when port number is less than Com10.
> It can work. But when I want to use Com10. It can't work.
> I don't know why? Please help. Thanks in advance.
> Environment: Delphi 5, Windows2000
> Createfile call format:
> FHandle := CreateFile( pchar('\\.\' + PortName),
>                          GENERIC_READ or GENERIC_WRITE,
>                          0, // Not shared
>                          nil, // No security attributes
>                          OPEN_EXISTING,
>                          FILE_ATTRIBUTE_NORMAL,
>                          0 // No template
>                         ) ;
> Thanks again.

> Ryan Liu

Re:Help Request: Serial communication Problem in Delphi


Quote
>I am write a program which uses serial communication.
>In the program, I may use port number more than com10.
>I have test my program, when port number is less than Com10.
>It can work. But when I want to use Com10. It can't work.
>I don't know why? Please help. Thanks in advance.
>Environment: Delphi 5, Windows2000
>Createfile call format:
>FHandle := CreateFile( pchar('\\.\' + PortName),
>                         GENERIC_READ or GENERIC_WRITE,
>                         0, // Not shared
>                         nil, // No security attributes
>                         OPEN_EXISTING,
>                         FILE_ATTRIBUTE_NORMAL,
>                         0 // No template
>                        ) ;

Can you give any more information about the error you are getting - with
nothing more than a statement that it doesn't work it's hard to know
where to go!

--
======================================================================
To reply by email remove the letter x from before the @
Any email sent may be quoted in full or in part in relevant newsgroups
======================================================================
Confidence is what you have when you don't understand the situation

Re:Help Request: Serial communication Problem in Delphi


Newsx & Nicholas ,

Thanks for your help.
I can confirm that my computer have 10 Port(I have install Moxa card
C218Turbo/PCI(which have 8 Port + 2Port(Computer)), which can find from
regedit-local machine-hardware-....
I don't get any clear error information too. Because I can open this port 10
and can send message to this port, I can't receive any data. In others
Port(<9), I can receive the data. I wonder whether there are some parameters
of the Port affect it?

Thanks for deep help.
Ryan Liu

Re:Help Request: Serial communication Problem in Delphi


In message <b3ml01$...@netnews.proxy.lucent.com>, Ryan Liu
<yy...@lucent.com> writes

Quote
>Newsx & Nicholas ,

>Thanks for your help.
>I can confirm that my computer have 10 Port(I have install Moxa card
>C218Turbo/PCI(which have 8 Port + 2Port(Computer)), which can find from
>regedit-local machine-hardware-....
>I don't get any clear error information too. Because I can open this port 10
>and can send message to this port, I can't receive any data. In others
>Port(<9), I can receive the data. I wonder whether there are some parameters
>of the Port affect it?

>Thanks for deep help.
>Ryan Liu

If you've got the base address and IRQ settings set to the same as one
of the other ports (quite possible if you have so many) then you'll
often find that one device works while another doesn't.

It's commonly seen when people install COM3 and COM4 - unless you change
the default settings you'll find that, for example, the digital camera
on COM1 works fine but the modem on COM3 doesn't. If you use the modem
first then you'll find it works fine but the camera doesn't.

Hope that helps at least a little!

--
======================================================================
To reply by email remove the letter x from before the @
Any email sent may be quoted in full or in part in relevant newsgroups
======================================================================
Confidence is what you have when you don't understand the situation

Other Threads