PHP 如何关闭RS232串口?
就是我不知道串口是否在打开,我判断如查开打,我将其关闭。 PHP如何实现?
就是我不知道串口是否在打开,我判断如查开打,我将其关闭。 PHP如何实现?
解决方案 »
- 如何用PHP开发财经类的网站
- 点击[支持]页面不刷新,但支持量增1的效果。
- PHP 求能保存最近3天的修改记录 给思路 3q
- linux php
- ?PHP可以动态生成html标签行吗?
- 一个webservers的问题,很苦恼,因为不熟悉这块。帮帮忙啊。
- 如何让word文档的含公式编辑器的内容在网页上正确显示
- 大婶们,可否耽误你们几分钟?用php帮我做一个注册登录的接口,实例,让我这个实习生了解一点啊?
- 保存页面的样式
- 在Mac电脑上,新打开一个tab页,$_SERVER['HTTP_REFERER']不能用吗?
- 欢迎加入ITPUB,群号:78235780.欢迎php开发者或DBA都进来共同学习,共勉...
- 那位高手有 PHP 通用的分页代码呢? 共享 共享呗 加分
Warning: dio_open() [function.dio-open]: cannot open file COM3: with flags 2 and permissions 0: Permission denied in D:\wwwroot\test\RS232_Server2.php on line 62
Error when open COM3PHP has encountered an Access Violation at 017573CD显然是COM口在打开着.只有我有方法判断COM口在打开着,并将其关闭就行了.再次打开就行了,或者不对开,真接用打开的COM口.
可我不知道如何判断.得到打开COM口的文件.
<?php
error_reporting(0);
while (1) {
$fd = dio_open('COM3:', O_RDWR | O_NOCTTY | O_NONBLOCK) ;
if ($fd) break;
// echo(".");
sleep(1);
}
error_reporting(E_ALL);
?>
是COM口没有关闭时,我已经终止程序.不是我没有关闭的权限.我觉得我现在只要获取打开的COM口文件,将其闭就行了.
你应该是想方法令 占有串口的进程自己关闭flags是其中一种方法
The flags parameter can also include any combination of the following flags:
O_CREAT - creates the file, if it doesn't already exist. O_EXCL - if both, O_CREAT and O_EXCL are set, dio_open() fails, if the file already exists. O_TRUNC - if the file exists, and its opened for write access, the file will be truncated to zero length. O_APPEND - write operations write data at the end of the file. O_NONBLOCK - sets non blocking mode