用php-win读取COM1 [英] Reading COM1 with php-win

查看:65
本文介绍了用php-win读取COM1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要读取COM端口上的传入字节,但如果没有什么可读的话,我不想让脚本挂起来。


有没有办法让PHP查询一个COM端口缓冲区,看看

在阅读之前是否有任何内容?


任何其他方法来实现结果也欢迎。


干杯,


弗雷德。

I need to read incoming bytes on a COM port but I do not want to have
the script hang if there is nothing to read.

Is there any way to have PHP interrogate a COM port buffer to see if
there is any content before reading it?

Any other method to achieve the result would also be welcome.

Cheers,

Fred.

推荐答案

bl ********** @ hotmail.com 写道:

我需要读取COM端口上的传入字节但是我不想让脚本挂起

如果有的话没有什么可读的。


有没有办法让PHP查询一个COM端口缓冲区,看看

在阅读之前是否有任何内容?


任何其他方法都可以获得结果。


干杯,

弗雷德。
I need to read incoming bytes on a COM port but I do not want to have
the script hang if there is nothing to read.

Is there any way to have PHP interrogate a COM port buffer to see if
there is any content before reading it?

Any other method to achieve the result would also be welcome.

Cheers,
Fred.



查看Windows PHP的COM对象。

使用COM可以做任何事情,你可以通过该对象完成。


只是不要混淆什么是COM端口(通信)

和什么是COM对象(组件对象模型)。

Look into the COM object for Windows PHP.
Anything you can do with COM, you can do through that object.

Just don''t get confused with what''s a COM port (communications)
and what''s a COM object (Component Object Model).




Sanders Kaufman写道:

Sanders Kaufman wrote:
bl ********** @ hotmail.com 写道:

我需要读取COM端口上的传入字节但我不希望如果没有什么可读的话,脚本会挂起




有没有办法让PHP在查看之前询问一个COM端口缓冲区以查看

是否有任何内容?


任何其他实现结果的方法也是受欢迎的。


干杯,

弗雷德。
I need to read incoming bytes on a COM port but I do not want to have
the script hang if there is nothing to read.

Is there any way to have PHP interrogate a COM port buffer to see if
there is any content before reading it?

Any other method to achieve the result would also be welcome.

Cheers,
Fred.



查看Windows PHP的COM对象。

使用COM可以做任何事情,你可以通过该对象完成。


只是不要混淆什么是COM端口(通信)

和什么是COM对象(组件对象模型)。


Look into the COM object for Windows PHP.
Anything you can do with COM, you can do through that object.

Just don''t get confused with what''s a COM port (communications)
and what''s a COM object (Component Object Model).



我不认为我感到困惑,但也许我是。


是否有用于串行端口的标准COM对象我可以通过PHP实例化

吗?

I didnt think I was confused, but perhaps I am.

Is there a standard COM Object for serial ports that I can instantiate
through PHP?


bl ********** @ hotmail.com 写道:

Sanders Kaufman写道:
Sanders Kaufman wrote:


>只是不要混淆什么是COM端口(通信)
和什么是COM对象(组件对象模型)。
>Just don''t get confused with what''s a COM port (communications)
and what''s a COM object (Component Object Model).



我不觉得我很困惑,但也许我很。


是否有用于串口的标准COM对象我可以通过PHP实例化


I didnt think I was confused, but perhaps I am.

Is there a standard COM Object for serial ports that I can instantiate
through PHP?

http:// msdn2。 microsoft.com/en-gb/library/aa490273.aspx

在Windows中 - 与COM对象不同,不如说是一套API。在MSDN文档的

中,您可以通过API了解

串口i / o的复杂性。如果您还不熟悉

编程Windows,那么

API的学习曲线非常陡峭。


如果您有权在服务器上安装ActiveX控件,

您可以选择其中一个以获得几美元

将为您做什么'问。然后,串口I / O将通过PHP轻松实现


http://msdn2.microsoft.com/en-gb/library/aa490273.aspx

In Windows - not so much a COM object, as a suite of API''s. In
the MSDN documentation, you can learn about the complexity''s of
serial port i/o with API''s. If you''re not already familiar with
programming Windows, there''s a pretty steep learning curve for
API''s.

If you have rights to install ActiveX controls on the server,
you can probably pick up one of those for a couple of bucks that
will do what you''re asking. Then, Serial I/O will be a snap
through PHP.


这篇关于用php-win读取COM1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆