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
这篇关于如何将数据从网页发送到串行端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何将数据从网页发送到串行端口?
基础教程推荐
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何替换eregi() 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
