note 115001 added to function.dio-read
| From: | lrearth at hotmail dot com | Date: | Sun, 11 May 2014 08:48:49 +0000 |
| Subject: | note 115001 added to function.dio-read | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199510@lists.php.net to get a copy of this message | ||
Hi, Thank you in advance.
I am trying to connect weighing machine with PHP code. I have tested with hyperterminal it is
working fine.
But when I tried with PHP code till fopen or dio_open it executed after that when run fgets or
dio_read, it hanged not display anything.
Please check the below code -
exec('mode com2: BAUD=2400 PARITY=N data=8 stop=1 xon=on');
$fp = fopen("COM2:", "r");
if (!$fp) {
echo "Uh-oh. Port not opened.";
} else {
echo fgets($fp);
fclose($fp);
}
DIO Code -
exec('mode COM2: baud=2400 data=8 stop=1 parity=n xon=off to=on');
$fd = dio_open('COM2:', O_RDONLY | O_NONBLOCK, 0644);
echo dio_read($fd, 256);
I tried both ways, but not able to get output.
I have few doubts -
Do I require inpout32.dll file to connect?
And what is role of php_iol.dll, this file I also required?
I tried all the options, Please help me out to resolve this issue.
----
Server IP: 72.52.91.14
Probable Submitter: 114.143.149.65
----
Manual Page -- http://php.net/manual/en/function.dio-read.php
Edit -- https://master.php.net/note/edit/115001
Del: integrated -- https://master.php.net/note/delete/115001/integrated
Del: useless -- https://master.php.net/note/delete/115001/useless
Del: bad code -- https://master.php.net/note/delete/115001/bad+code
Del: spam -- https://master.php.net/note/delete/115001/spam
Del: non-english -- https://master.php.net/note/delete/115001/non-english
Del: in docs -- https://master.php.net/note/delete/115001/in+docs
Del: other reasons-- https://master.php.net/note/delete/115001
Reject -- https://master.php.net/note/reject/115001
Search -- https://master.php.net/manage/user-notes.php