How can I send data from a web page to a serial port?

廉价感情. 提交于 2019-12-17 20:58:21

问题


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).

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.

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!


回答1:


There is a library for PHP that supports writing to serial port.

See here.

More:

http://php.net/manual/en/function.fopen.php#20935

See this question for more discussion: How to Read RS232 Serial Port in PHP like this QBasic Program

Update:

To do this on windows see this tutorial: http://blog.950buy.com/article/php-use-rs232-serial-communication-to-send-file/

Also this question: Serial comm with PHP on Windows



来源:https://stackoverflow.com/questions/14147144/how-can-i-send-data-from-a-web-page-to-a-serial-port

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!