How to flush the buffer every time after xPC FIFO read the buffer
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Schedule Model Components 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!