Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm building a web page that will access a serial port to read and write data to a commercial product. I need to send queries out to the unit and it will return status information. Here's the code snippet I've used:Code: Select all
$fd = dio_open("/dev/ttyS1", O_RDWR | O_NOCTTY | O_NONBLOCK); // open the port
dio_write($fd, "Q00"); // query port 00
$val = dio_read($fd); // put the value into $varAny ideas as to why dio_read is always blank? I tried removing the control and blocking options from the dio_open (just keeping the O_RDWR option) and that didn't change anything.
Eddie
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]