There's probably libraries out there for dealing with serial and parallel
operations with PHP and I'm sure someone will point one out. In the meantime
and maybe as an addition to it, you might check out Winbinder
(http://www.winbinder.com) it's a native Windows API interface for PHP that's
just great!
I looked through the sample files (WinBinder\Code\Samples after you download
and decompress the package) and there's one for accessing serial ports. Looks
like you could just change COM1 to LPT1 and do some tweaking to get it to do
what you need.
Here's the function in serial.phpw that opens the serial port:
function open_serial($portname)
{
~global $CreateFile;
~return wb_call_function($CreateFile, array(
~~$portname,
~~GENERIC_READ | GENERIC_WRITE,
~~0,
~~null,
~~OPEN_EXISTING,
~~0,
~~0
~));
}
$portname at this point is COM1 I believe.
Good luck!
-TG
= = = Original message = = =
I have a pan and tilt mechanism with an opto-isolated circuit board that
connects to the LPT port. What I am trying to do is control it totally
in PHP. Can anyone point me in the right direction for info on
communicating directly with the LPT port? Or has someone done this already?
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php