02-28-2013 10:41 AM
What USB device are you using? And what format are you saving your data?
02-28-2013 01:01 PM
The USB device I'm using is a custom device that I designed. The data format is string.
I managed somehow to put together a producer/consumer arrangement and that seems to have fixed the problem. Can't believe it works, considering it's my first time and the code wasn't designed that way. Anyway, some questions come to mind. When I first start this off, I create a queue for the application. For as long as the app runs, it is running in a while loop that is now designated the producer loop. When recording, It is putting data in, and my consumer loop is taking it out. First off, is there any chance of this causing a memory leak? Second, is there a way to purge the queue at the start of recording so I know I don't have any old data in there?
Thanks for the heads up on this approach. It has been a great help.
02-28-2013 01:07 PM
I found a flush queue vi that should be useful for flushing/purging the queue, so I should be good there. I just want to make sure I'm not gonna create a memory leak. If so, what safeguards do I need to implement?
Thanks.
02-28-2013 01:11 PM
I guess I would put an upper limit on the buffer just in case something happens and it gets stuck, you won't run your PC out of memory.
02-28-2013 01:24 PM
Ok, I'll do that.
Thanks to everyone that contributed. All working now.
02-28-2013 03:33 PM
@rickford66 wrote:
The USB device I'm using is a custom device that I designed. The data format is string.
I managed somehow to put together a producer/consumer arrangement and that seems to have fixed the problem. Can't believe it works, considering it's my first time and the code wasn't designed that way. Anyway, some questions come to mind. When I first start this off, I create a queue for the application. For as long as the app runs, it is running in a while loop that is now designated the producer loop. When recording, It is putting data in, and my consumer loop is taking it out. First off, is there any chance of this causing a memory leak? Second, is there a way to purge the queue at the start of recording so I know I don't have any old data in there?
Thanks for the heads up on this approach. It has been a great help.
It's easy to START with a producer/consumer architecture - it's a whole different story to convert existing code! Very nice!