点击或拖拽改变大小

SerialBaseCheckReceiveDataComplete 方法

检查当前从串口接收的数据是否是完整的,如果是完整的,则需要返回 True,串口数据接收立即完成,默认返回 False
Check whether the data currently received from the serial port is complete. If it is complete, you need to return True. The serial port data reception is completed immediately, and the default returns False

命名空间:  HslCommunication.Serial
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.0.5.0 (11.0.5.0)
语法
protected virtual bool CheckReceiveDataComplete(
	MemoryStream ms
)

参数

ms
类型:System.IOMemoryStream
目前已经接收到数据流

返回值

类型:Boolean
如果数据接收完成,则返回True, 否则返回False
备注
在默认情况下,串口在接收数据之后,需要再等一个 SleepTime 的时间,再没有接收到数据,才真的表明数据接收完成了, 但是在某些情况下,可以判断是否接收完成,然后直接返回,不需要在等一个 SleepTime 的时间,从而提高一倍的通信性能。
By default, after the serial port receives data, it needs to wait another SleepTime time, and no more data is received, it really indicates that the data reception is complete, but in some cases, you can Judge whether the reception is complete, and then return directly. There is no need to wait for a SleepTime time, thereby doubling the communication performance.
参见