How to flush the buffer every time after xPC FIFO read the buffer
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Schedule Model Components finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!