11-09-2015 05:59 PM
@Joe_H wrote:
See example........
Here is my problem with this solution (and the default example from NI): Do you need to log ALL of the data? This is a very important question. If you follow this example exactly, whatever data is still in the queue when your producer is stopped will be GONE due to the destroying of the queue. If you need all of the data logged, then you need to have the producer send a command to the consumer to stop (like an empty array) and then destroy the queue when the consumer loop has detected that stop command (and has therefore processed all of the data).
11-09-2015 08:30 PM
JoeH & crossrulz
thanks for the comments.
I've added this while loop after the producer loop, and before clearing the queue
this lets my consumer loop catch up to the remaining data - so the queue is only cleared AFTER all data has been logged.
11-09-2015 08:39 PM
Put a small wait in that loop so you aren't polling that queue at superspeed burning up the CPU.