A
A
Andrey Surzhikov2015-03-10 18:20:36
PHP
Andrey Surzhikov, 2015-03-10 18:20:36

Is there a console utility for writing to the com port?

We need a small console utility to send a line to the com port. Maybe someone knows?
I have the following task: I
have a computer with windows and a com-port
is connected to a scoreboard (large pixel screen)
I need to run this program from PHP using exec() and write a line to the com-port.
It is not possible to work directly with the COM port from PHP.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
egor_nullptr, 2015-03-10
@egor_nullptr

php.net/manual/en/class.dotnet.php
https://msdn.microsoft.com/en-us/library/system.io...

$serial = new DOTNET('system', 'System.IO.Ports.SerialPort');
$serial->PortName = 'COM3';
$serial->Open();
$serial->Write('string');
$serial->Close();

F
FanatPHP, 2015-03-10
@FanatPHP

everything worked fine for me: I opened com1 through fopen and wrote and read as much as necessary

D
dtestyk, 2015-03-10
@dtestyk

you can try copy file.txt com1andecho text>com1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question