LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Computer pause every 2 seconds while writing to hard drive.

Solved!
Go to solution

What USB device are you using?  And what format are you saving your data?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 16
(729 Views)

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.

 

Message 12 of 16
(713 Views)

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.

 

0 Kudos
Message 13 of 16
(708 Views)

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 14 of 16
(703 Views)

Ok, I'll do that.

 

Thanks to everyone that contributed.  All working now.

 

0 Kudos
Message 15 of 16
(692 Views)

@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!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 16 of 16
(673 Views)