How to flush the buffer every time after xPC FIFO read the buffer

조회 수: 4 (최근 30일)
Zhuo Li
Zhuo Li 2012년 7월 1일
Hi, I found that my xPC logged data has a lot of duplicate meassages due to FIFO read block sampling.
To my understanding, the FIFO read block works in the way that keeps sampling the buffer and outputs the samples.
hence, when the xPC receives [97 98 99 100 13] (ASCII of 'a' 'b' 'c' 'd' '\r'), the FIFO read block gives me multiple lines of [97 98 99 100 13 0]. (0 is inserted due to null terminating).
What's more, when the xPC receives a shorter string, e.g., [99 13], the FIFO read block gives me [99 13 0 100 13 0]. It seems just overwrite the old string at the new string length, not after that.
That is why I feel refreshing the buffer is highly needed. I saw in the "read HW FIFO" block, there is a check option of "flush the buffer on start up". I wonder is there similar actions such as flush buffer everytime after the FIFO read the buffer?
Thanks!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by