Serial port access in PHP

Unfortunately serial port access in PHP is limited. COM10 and above do not work. That's why I've written and compiled a univeral tool for serial port access that can be called by PHP via the shell extension. Structure: comaxs.exe (string port, no of bytes to read as hex, command as hex values) Example from shell: comaxs.exe COM11 10 FE FE 00 E0 03 FD will write the sequence (fe fe 00 e0 03 fd) to COM11 and then listen until 16 (0x10 bytes are received. In PHP you can call the tool like: $x=shell_exec("g:/c/comxs.exe $comport $readbytes $command"); $x will contain (as a written string): "fe fe 00 e0 03 fd fe fe e0 00 03 66 10 20 14 00 fd" (This is a CI-V dialogue for the Perseus SDR communications receiver) Download comaxs.zip It's very basic and still beta. There is no timeout - the process will be active until the requested number of bytes have been received. Use 0 for write-only. If you want a more stable and elegant solution take a look at phpser.dll by TheByteWorks (with delays in the trial version).
Questions? Corrections? Ideas? Comments? PeerAxel@aol.com Back to main index on my homepage.
Disclaimer

This site is based at: radiovibrations.com/php/com-port-access.htm