LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to solve memory full issue while writing data periodic?

Solved!
Go to solution

I can use my program to acquire sound pressure data continuously.

But when collecting data for a long time, I don't need to do it because my disk space won't be enough.

I want to run acquire data for 1 min then wait time 1 min,so I add time delay Express VI in it,and found the memory full error happen after few hours.

I found maybe the problem is the Obtain queue ,the buffer size can't store too much data, then I add the loop include the system. But It still did't work well.

Does anyone can tell me what I need to do to fix it? 

Here is my program.

0 Kudos
Message 1 of 8
(2,702 Views)

Please include a Snippet of your code. I can't view the VI, but this sounds like an easy fix by looking at the code.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 8
(2,697 Views)

Why would you put a Time Delay in your file writing loop?  Of course that is going to slow down that loop.  Your queue is probably growing.

 

If you don't want to collect data for a minute, you probably want to use the Elapsed Time Express VI to know when a minute has passed, and use a case structure to determine whether that data should be written to a file or discarded.

0 Kudos
Message 3 of 8
(2,671 Views)

I hope this what you want,I have never use Snippet  before.

0 Kudos
Message 4 of 8
(2,647 Views)

1. Why do you have a loop inside of a loop for your consumer?  That makes 0 sense.

2. Add a condition to whether or not to send data to the consumer loop.  Use the Elapsed Time express VI and have it reset every 1 minute.  When it does reset, toggle whether or not you enqueue the data.  Hold the flag in a shift register.


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 5 of 8
(2,631 Views)

The problem is simply that you still sample during your "waiting period" and you fill up the buffers. 

During the wait, you should still sample as you do, just not send it to the queue for Writing. It might seem a Little inefficient, but the logic is "let the program run as similar all the time as possible".

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 8
(2,615 Views)

hello  

1.The inside loop is a test motion that I forgot to delete.

2. You mean I need to use the Elapsed Time express VI in producer loop,right?

I also add blank time to wait. I made this configuration below.

It does work,but I am not sure it would happen any errors or not after long time acquiring.

0 Kudos
Message 7 of 8
(2,603 Views)
Solution
Accepted by topic author 大D

@大D wrote:

 

It does work,but I am not sure it would happen any errors or not after long time acquiring.


Your code is still highly flawed, but since I don't have DAQmx installed, I cannot look at your IO configurations.

 

  • Your flat sequence is not needed
  • Why is the queue in a shift register?
  • Setting the "error" and "shutdown" LEDs are never set, except at the beginning. You could use "clear indicators when called" instead (VI options...execution).
  • Your stop is not connected anywhere.
  • Your elapsed time express VI does not really do anything useful because none of the outputs are used and it resets automatically.
  • mixing waveform and dynamic data is also not very efficient.
  • If you are worried about longtime performance, why don't you occasionally check for the queue size?
  • You have a strange filename configured. Why do you save to a series of files instead of appending to one?
  • If the folder gets very full, checking the availability of the next file name can be very expensive.
  • If you want to pause writing to a file, don't write to the queue and nothing will get written. No change needed in the file writing loop.
  • You can wire the error wire directly to the "OR" compound node
  • Why can't you make the queue a plain DBL array instead? You don't write headers or time columns, so why push all that extra dynamic/waveform baggage around?
0 Kudos
Message 8 of 8
(2,598 Views)