Hey,
I'm not that familiar with PHP so maybe what I'm asking for is not even possible. I plan to establish a webserver that is connected to a RS232 device. I don't have any problems accessing the RS232 interface with a PHP-script, it's all working fine.
Now I want the incoming data from the device being display on the servers webpage almost in realtime. When I say almost I mean that the client who is logged on to the website should be able to define the update rate of the incoming data.
So here comes the problem, I need something like the java script setinterval() function that is working on the server-side and repeats the data request to the device in an infinite loop with the given time interval.
I don't want to refresh the whole page as I will have to update about 20 sets of data within seconds!
I found this code:
http://phpclasses.chimit.nl/package/5544-PHP-Call-a-function-after-a-period-of-time.html
it looks pretty promissing but I just can't make it working...
As I said I'm a PHP-noob so I just put the code below on the start of my own code and provided the Timer.class.php file in my project folder. Could anyone explain how I could make the test function repeating endlessly on a 1sec basis using this code so I would get a screen full of "called"? So far I only get two "called" :-)
Thanks!
declare(ticks=100);
function test ()
{
print "<br>called";
}
require_once 'Timers.class.php';
setTimeout('test', 110000000);
setInterval('test', 10000000);
[attachment deleted by admin]