Not really, I will try to be clearer:
On the host side:
- Before running your FPGA VI, the FIFO should have been configured using the "Configure" method with a sufficient depth.
- Always read the FIFOs as you do in your "standard read" case, then use the values or not depending on your needs. It should be done frequently enough so that the FIFO depth is never reached.
- Remove your "False" case, which is useless.
On the FPGA side:
- Do not flush here, you do not know how many you flush.
If the buffer on the host side is correctly sized and the read operation frequent enough, the FIFO buffer will never fill up and you avoid having to manage the complicated case were the data are out of place.
Check example "Interleaving Channel Data (DMA).lvproj" in the example finder.
When that works, if it is still a requirement to manage the case of the buffer filling up, then you can proceed using a state machine and a synchronization mechanism (using interrupts, controls, handshakes or whatever...). As explained, you must ensure the FPGA stops writing, then empty both buffers (FPGA and host sides), then you are good to start writing again.
Regards,
Raphaël.