How can I send data from a web page to a serial port?(如何将数据从网页发送到串行端口?)
问题描述
我有一个包含基本内容的网页.我可以尝试它的格式,但现在是 PHP.我想将此数据发送到我计算机的一个串行端口(作为 PHP 页面的访问者).
I have a web page which includes a basic content. I can chance its format but it is PHP now. I want to send this data to one of the serial ports of my computer (as a visitor of PHP page).
我需要一个用于将此数据从 Internet 传输到其中一个串行端口的代码.它可以是 C++、javascript、C# 或其他任何东西.
I need a code for transferring this data from internet to one of the serial-ports. It can be C++, javascript, C# or anything else.
我正在使用 Windows(作为网页的访问者).所以,我需要将数据发送到访问者计算机的串行端口而不是服务器的.不需要阅读.
I am using Windows (as a visitor of web page). So, I need to send datas to serial port of visitor's computer not server's. Reading is not necessary.
哪个程序和流程是正确执行此操作的最佳选择?我需要它们工作得很好的示例代码部分!
Which program and process is the best option to do this properly? I need example code parts that they work just fine!
推荐答案
有一个PHP库支持写入串口.
There is a library for PHP that supports writing to serial port.
请参阅此处.
更多:
http://php.net/manual/en/function.fopen.php#20935
有关更多讨论,请参阅此问题:如何在 PHP 中读取 RS232 串口喜欢这个 QBasic 程序
See this question for more discussion: How to Read RS232 Serial Port in PHP like this QBasic Program
更新:
要在 Windows 上执行此操作,请参阅本教程:http://blog.950buy.com/article/php-use-rs232-serial-communication-to-send-file/
To do this on windows see this tutorial: http://blog.950buy.com/article/php-use-rs232-serial-communication-to-send-file/
还有这个问题:Serial comm with PHP on Windows
这篇关于如何将数据从网页发送到串行端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何将数据从网页发送到串行端口?


- 从 PHP 中的输入表单获取日期 2022-01-01
- Laravel 仓库 2022-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01