LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

not enough memory error

I am using Windows XP and LabVIEW2011 SP1. My RAM is 3GB. My application is to acquire data from NI 6008 DAQ card and saving it to MySql database. For this case I am using LV database connectivity toolkit 2011. I am using 4 daq cards (analog and digital channel both) at a time for data acquisition, one backend VI which is saving all the data and one front end vi which is showing all the data. I have given 1mnt delay in data saving and 1sec delay in data displaying. After 17-18hrs of continuous running it is giving a erro 'NOT ENOUGH MEMORY TO COMPLETE THIS OPERATION'. Previously I set the delay much lesser such as 1sec in data acquisition and display both, it was given the same error after only 2hours. Even before I used 100msec delay, the same error was coming after half an hour. So, with increasing the delay time, the frequency of coming this error decreases but this is not the solution right? I need perfect cause and solution of this problem. It is not even giving any error code. I have attached a picture of front panel while the error came. Another thing, once this error comes, the total operation stops, no data is saving after this error coming. Without forcefully closing from task manager, LabVIEW can't be stopped either. I haved attached the data saving vi also herewith. Please help.

Download All
0 Kudos
Message 1 of 4
(4,330 Views)

You are using lot of Gloabal variables, controls, Indicators, Build array functions which eat up memory and the build array function keeps on building in the memory if you are running continously defenetly you will run out of memory. so

 

  • Select a proper design pattern
  • create sub vis for similar functions and use it
  • Do not use this much of gloabl variables
  • Use shift register to pass data between iterations
  • avoid using lot of controls and indicators if you need more number of indicators and controls club them into a single cluster and use it.
  • Always use time delay inside the while loop (if your sub vi doesn't have time delay)
  • Do not attach this much big .bmp file attach original .png or .jpg files
-----

The best solution is the one you find it by yourself
Message 2 of 4
(4,314 Views)

It's going to be very difficult to help you with this.  Your VI is a mess - the block diagram is huge, wires run all over the place, and it contains stacked sequence structures and global variables, all classic signs of an inexperienced LabVIEW programmer.  In addition you haven't provided some subVIs and the front panel of the VI you attached does not match the one you show in your image - how do you know the problem is in this VI?

 

I can't begin to go through all your code, but the first place you should look is at feedback nodes and use of strings and local variables.  Perhaps you have a string being written to a local variable (from a brief glance at your code, I'm thinking the one called "concatenated string") that grows constantly as you add more and more data without clearing it.  Eventually the string will get so long that there will be no contiguous space in memory large enough to hold it, and you'll get the "not enough memory" error.

 

Again, that's a guess from a quick look at your code.  There could be other locations where you do something similar with an array, although I didn't see any immediately.

 

It would be well worth your time to structure this code properly: eliminate the sequence structures, use shift registers in place of the local and global variables, maybe create some subVIs to make the diagram size manageable.

0 Kudos
Message 3 of 4
(4,311 Views)

The error message your screeshot (why the whole screen instead of only the dialog?) is coming from the OS. So the OS tells you, that it cannot allocate more memory for your LV application.

 

Additional to the remarks of the previous repliers, you have to look into growing buffers. Note that "Build Array" increasing the size of an array in an shift register is also to be considered an unlimited growing buffer....

 

All in all, you have to spend some time to refactor your code before hunting down the source of the memory issue. P.Anand gave some valuable hints for this step.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 4
(4,302 Views)