简体   繁体   English

PHP Windows读取对串行端口usind的写入/从DOTNET System.IO.Ports

[英]PHP windows read write to/from serial port usind DOTNET System.IO.Ports

I try to capture data from a industrial scale weight serial port connection in my PHP webpage and print ticket. 我尝试从PHP网页中的工业规模重量串行端口连接中捕获数据并打印票证。 Also I need to forward data to another serial port for display propose. 另外,我还需要将数据转发到另一个串行端口以进行显示建议。 I explore anything from here and Google ...except very expensive ActiveXperts Serial Port SDK I cannot find anything more complex than PHP native fopen. 我从这里和Google探索任何东西……除了非常昂贵的ActiveXperts串行端口SDK外,我找不到比PHP本机fopen更复杂的东西。

I found this here, but nothing happend...no error trigger nothing 我在这里找到了,但是什么也没发生...没有错误什么也没有触发

$serial = new DOTNET('System', 'System.IO.Ports.SerialPort');
$serial->PortName = 'COM1';
$serial->Open(); 

Please give me a clue about how to implement this. 请给我一个有关如何实现这一点的线索。

You could use 你可以用

$serial = new DOTNET('System', 'System.IO.Ports.SerialPort');
$serial->PortName = 'COM1';
$serial->Open(); 

and then and 然后

$serial->Write();
$serial->Read();

If there is no error is worth a try. 如果没有错误值得一试。 You can also check out http://msdn.microsoft.com/en-us/library/system.io.ports.serialport(v=vs.110).aspx Also you usually end up with that info if you are searching for windows com# communication with php. 您还可以查看http://msdn.microsoft.com/zh-cn/library/system.io.ports.serialport(v=vs.110).aspx如果您正在搜索,通常也会得到该信息Windows com#与php通信。 Check out: https://www.google.com.mx/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CB0QFjAA&url=https%3A%2F%2Fgithub.com%2FXowap%2FPHP-Serial&ei=JXdSVKPsHYmGyQSftIL4Dw&usg=AFQjCNGxbGUeLotG_DvmUzDo2yBScDAqTw&sig2=AUp7IvRqKXesVZIF6Xf6MA Its native php that suppossedly works in windows no complicated stuff and reconfigs needed 检出: https : //www.google.com.mx/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CB0QFjAA&url=https%3A%2F%2Fgithub.com%2FXowap%2FPHP-Serial&ei=JXdSVKPsHYmGyQSftIL = AFQjCNGxbGUeLotG_DvmUzDo2yBScDAqTw&sig2 = AUp7IvRqKXesVZIF6Xf6MA可以在Windows中正常工作的本机php,不需要复杂的内容和重新配置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM