AW: [PHP] Serial Communication
Thanks for the help, when communicating to it via hyperterminal (or other software) it responds immidiately. I will try it on different machines within the next few days...hopefully it is just a hardware/software problem with my dev-system... best regards Ulrik //You could try the same thing using windows' HyperTerminal. Connecting trough it and sending the same commands, and check if it takes as long aswell. That way you can rule out at least half of the possible problems (are they windows/COM related or PHP related). Basically, last time I tried something similair, I noticed my system "freezing" for a few secs on sending the first command. But this was with a faulty cable, so I'm not sure if that means anything... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Serial Communication
Hello List, I have managed to communicate with the serial device with the following code: 'mode com1: BAUD=9600 PARITY=N data=8 stop=1 xon=n';//the config the device needs $fp = fopen("COM1:", "rb+");//also tried only "r+" here if(!$fp) die(); $query = chr(59).chr(32)."0".chr(13).chr(10); fputs($fp, $query); $reply = fgets($fp, 32); print($reply); This works, the "0"-command requests the ID of the device and the reply I get in $reply is exactly what it should be. The problem: it takes around 5 seconds until this reply is there, I tried different lengths to buffer in fgets, tried fgetc, fread, everything, always the same. It can't be the device blocking it, because if I send a couple of commands (to position the devices measurement head) it reacts to all of these commands in lightning speed, so I don't think it is the device slowing the thing down, BUT what could it be? Does anybody have any experience with this??? Basically, fread/fgets/fgetc just hangs the PHP core for several seconds, with 0-1% CPU load...something just stalls PHP for this peroid of time. If this is an internal problem of PHP: does anybody know a source where I can find some hints on how to communicate with the serial port over the COM implementation of php-win? Googling for "com serial port php" is a bit troublesom, since "com" in this case finds dozens of sites where com refers to "com1" and not the COM system of Win32. Any help is greatly appreciated! best regards Ulrik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] Serial Communication
Thanks for the many great replies, since at the moment the project is based on PHP4, I will try if the filesystem functions provide what I need. Opening the port and sending doesn't seem to be a problem, I'll try it out tonight. If for some reason it doesnt provide the functionality I need, I will take a closer look at migrating to PHP 5 (which shouldn't be a problem) and using the DIO functions. Thanx to everybody for the help they provided! best regards Ulrik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Serial Communication
Hello List, I am searching information about serial communication with PHP on Windows machines. I want to communicate with a colorimeter via a COM-Port, using a PHP-GTK application. Can anybody point me into the right direction (a webpage, a PHP class/function, a PHP-GTK list) where I can find infos about this? I searched the web for some hours now but didn't find anything worthy. Any help is greatly appreciated! thanks in advance! best regards Ulrik Witschass
[PHP] B/W Image
Hello List, I browses the PHP Manual for some time now but didn't find exactly what I was looking for. I need to turn images uploaded by a user to b/w images to use them in pdflib, the resulting PDF has to be black and white. Now my question: a) is this possible? if(a) b) do I do this with PHP Image functions (maybe colorallicate and stuff like that) or is it possible to actually do that in PDFLib? thanks in advance for any help Ulrik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to get the IP of a visitor
Hi, I am new to this list and to PHP, so please excuse any newbie questions :) Want I need to know is how to get either the ISP or the IP of the visitor of a page. I guess this is a environment variable, but I don't know which. Any help is greatly appreciated :) Thanx! Ulrik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php