Serial read - way to get a millisecond timestamp resolution ?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi everyone,
I'm currently developping a custom high end serial communication API for various in-house purpose.
I need for this a resolution of the millisecond or tens of milliseconds when reading data.
The simpliest method to do this along the matlab documentation is to set a Callback on BytesAvailableFcn serial object property which fire event when specific terminator is read.
Thus according to the same documentation, the BytesAvailableFcn callback parameters are:
BytesAvailableFcn_Callback(this,serialObj,evt)
The event parameter contains :
Type: 'BytesAvailable'
Data: [1x1 struct]
with Data a one field structure AbsTime: [YYYY m dd HH MM SS]
Therefore, the resolution of the time monitoring is the second.
However using the record property of the serial object, the automatic log performs a millisecond resolution!
My question is: is there anyway to get a millisecond resolution in the BytesAvailable event ?
----------------------------
p.s.
The automatic record way is not suitable for my purpose and there s no possibility to subclassing/modify this (built-in ?) function.
I've also compared the accuracy of time acquisition between automatic record (serial data ready) and a manual now in the BytesAvailable Callback (serial data ready + callback call).
There is a gap in the order of the thousands ms at the first read, then there is a millisecond interval between each method, so it's seem to be a lack of accuracy for me.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!