Jump to content

Using PHP to transmit/write characters to a USB port device at 9600 baud rate


project168

Recommended Posts

Hello guys,

 

I am new to PHP programming. I am trying to figure out how to use PHP language to transmit/write characters to a USB port device at 9600 baud rate 8-N-1. Basically I just need the PHP coding to allow me to send stuff to the USB device but I have no idea how I can interface this. I did some researching but most were for RS-232 COM Port. I can't find the proper one for USB.

 

If someone can help me out, that would be awesome. Thank you!

Well, after a quick search on Google, I found this class that apparently lets you write data to a serial port.

 

It's well documented, but here's what settings I think you'll require:

 

require("php_serial.class.php");

$serial = new phpSerial(); 
$serial->deviceSet("COM1"); 

$serial->confBaudRate(9600);
$serial->confParity("none");
$serial->confCharacterLength(;
$serial->confStopBits(1);
$serial->confFlowControl("none");
$serial->deviceOpen(); 

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.