阅读(4982) (26)

Ohsce_eng_serial_read-从一个已打开的OHSCESerial资源所指定的串口读取数据

2017-01-10 10:33:53 更新

从一个已打开的OHSCESerial资源所指定的串口读取数据

(OHSCE >=V0.1.9)-从一个已打开的OHSCESerial资源所指定的串口读取数据。

Ohsce_eng_serial_read(&$ohsce,&$data,$len=null,$thex=false,$timeout=3)

$ohsce  

    -待读取且已打开的OHSCESerial资源

$data

   -待读数据

$len

  -待读长度(int)

$thex

  -十六进制返回(bool)

$timeout

  -超时时间

Example:

<?php
Ohsce_eng_serial_read($hscecom,$data,null,true); // 读取串口数据 返回数据长度为未知 以16进制返回
echo $data; //输出数据
Notice:

  超时时间仅在阻塞模型下有效



官网链接:http://www.ohsce.com/index.php/book/ohscelib/19.html