Jump to content

Serial Port Communication


BhushanVamsi

Recommended Posts

Hi,

I am using PHP 5.2 to read data from a serial port on Windows XP. I had downloaded serial class from PHP site and used it. But it gets hanged up at readport() function. So i decided to use DOS commands instead of serial class.

-----After Initialising the port i had used the following code.

$read=`echo "b">COM1 & type COM1>srldata.txt`;

---------------------------------------------------------------------------------------------------------

When the control comes accross to the above code it is sending signal to the port as "b" and inflating the instrument. But after reading the data from the port into file it is not coming back into the PHp code and getting hanged up

----------------------------------------------------------------------------------------------------------

In order to stop i am going to the command prompt and issuing

c:\pskill cmd

then the control is getting back into PHP and displaying the data stored in the file. But i want the kill code to be worked out from PHP so that no other window can be opened and by staying in PHP file itself the data to be displayed. I need help from gurus in this matter.

 

Thanking in advance.

Link to comment
https://forums.phpfreaks.com/topic/111240-serial-port-communication/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.