Read data form serial port on windows with php. Ask Question 1. I am using Node js To read serial port and send output to PHP server. Com ports get stuck or stop sending serial communication after working for 7-8 hours. Hardware and device solutions for industrial IoT, Industrie 4.0 and real time communication - port offers the right solutions. We offer embedded multiprotcol modules, single board computers (SBCs), switches, gateways, I / O boxes, ARDUINO/PMOD boards or iPC cards.
[UPDATE]
The code posted here uses the port.dll file that can be found on the web for free. The problem with port.dll is that it will only send one byte of data every 15.8ms (translates to 633 baud rate) regardless of the intended baud rate. This is a limitation of the port.dll file.
I am leaving this port.dll code here as a reference and because it works, however, I don't recommend using port.dll.
The recommended method to send/receive on the COM port is in the next post
[/UPDATE]
Well, at the risk of embarasing myself, here is a serial port console script that I pieced together using code that I found here on the forum.
I took me quite some time to put it together. So, I am placing it here so others can benefit.
The real power of this script is the ease with which it can be modified to send data instead of ASCII characters - something HyperTerminal (and other terminal emulators) can't do.
[EDIT] I was trying to be slick by putting a timestamp on the notepad file name - without testing it. Doing this broke the script. The code shown above works as advertised. Sorry for any confusion this may have caused.[/EDIT]![Php Php](http://cnlearn.linksprite.com/wp-content/uploads/2014/02/aaaaa.jpg)
The code posted here uses the port.dll file that can be found on the web for free. The problem with port.dll is that it will only send one byte of data every 15.8ms (translates to 633 baud rate) regardless of the intended baud rate. This is a limitation of the port.dll file.
I am leaving this port.dll code here as a reference and because it works, however, I don't recommend using port.dll.
The recommended method to send/receive on the COM port is in the next post
[/UPDATE]
Well, at the risk of embarasing myself, here is a serial port console script that I pieced together using code that I found here on the forum.
I took me quite some time to put it together. So, I am placing it here so others can benefit.
The real power of this script is the ease with which it can be modified to send data instead of ASCII characters - something HyperTerminal (and other terminal emulators) can't do.
[EDIT] I was trying to be slick by putting a timestamp on the notepad file name - without testing it. Doing this broke the script. The code shown above works as advertised. Sorry for any confusion this may have caused.[/EDIT]
![Php Php](http://cnlearn.linksprite.com/wp-content/uploads/2014/02/aaaaa.jpg)