This issue occurs when you are acquiring data faster than you can process the data. To process the data faster instead of using the Dequeue Element function use the Flush Queue function to remove all the elements currently in the queue at once.
The Flush Queue function returns all the elements in the queue as an array. This array can then be saved in one go to your file. This process is a lot faster than trying to save each individual data point one at a time.