Handle a serial communication on COM1

Handle a serial communication on COM1

am 18.03.2006 21:45:20 von select.now

Hi,

I intend to manage a serial communication with a
cash register trought COM1.

Everything works fine, only after I set manually an open connection to
COM1 with an Windows32 dedicated apps. I want to eliminate this
proceeding to manage this communication by main php application.

I want to find any resources (man, docs) to help myself to do this. I
look for PHP functions (or applications) to manage the connection with
this device.

Thank you in advance.

--
best wishes,
a programmer select.now@gmail.com

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Handle a serial communication on COM1

am 19.03.2006 20:43:37 von gmc

select now escribió:

>Hi,
>
>I intend to manage a serial communication with a
>cash register trought COM1.
>
>Everything works fine, only after I set manually an open connection to
>COM1 with an Windows32 dedicated apps. I want to eliminate this
>proceeding to manage this communication by main php application.
>
>I want to find any resources (man, docs) to help myself to do this. I
>look for PHP functions (or applications) to manage the connection with
>this device.
>
>Thank you in advance.
>
>--
>best wishes,
>a programmer select.now@gmail.com
>
>
>
Hi,

I think you need to look for Win32 API.

If you are using PHP4, you need the php_win32api extension, otherwise
php_ffi should be the right one on PHP5.

That should do the work for accessing to the win32 api functions.

I believe that's the only way (going thru the win32 api). I don't know
of the existence of any other package or extension to do such a job
-managing a com port device-.

As I say, you need to use some win32 api calls to manage the com port
device, and then you can handle the data with usual PHP code. Please
somebody correct me if I'm wrong...

The other way could be to use an auxiliary program, as there are some
that convert a COM port in a TCP port so you can communicate as if you
where on sockets (tcp2com I remember its called, and it is not the only
one) but this way could have some anoyances, anyway perhaps it is a
easier way for doing the job, but you relay on a external app for that
to work this way and that is not good.

Hope it helps.

Regards,
Gonzalo
http://gmc.serveisw3.net

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php