Ohsce_eng_serial_read-從一個已打開的OHSCESerial資源所指定的串口讀取數(shù)據(jù)

2018-01-10 10:33 更新

從一個已打開的OHSCESerial資源所指定的串口讀取數(shù)據(jù)

(OHSCE >=V0.1.9)-從一個已打開的OHSCESerial資源所指定的串口讀取數(shù)據(jù)。

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

$ohsce  

    -待讀取且已打開的OHSCESerial資源

$data

   -待讀數(shù)據(jù)

$len

  -待讀長度(int)

$thex

  -十六進制返回(bool)

$timeout

  -超時時間

Example:

<?php
Ohsce_eng_serial_read($hscecom,$data,null,true); // 讀取串口數(shù)據(jù) 返回數(shù)據(jù)長度為未知 以16進制返回
echo $data; //輸出數(shù)據(jù)
Notice:

  超時時間僅在阻塞模型下有效



官網(wǎng)鏈接:http://www.ohsce.com/index.php/book/ohscelib/19.html

以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號