11-01-2016 03:36 AM
Hello everybody,
I have come up a strange problem with which maybe you could help me with (or point me in the right direction ).
First, let me explain a little bit about the application :my application performs several mathematical operations on user input - to this aim, i have an event structure placed in a for loop, doing several mathematical operations on user input - the user clicks an item in a tree control and a certain action is performed. The tree control is populated at program start, outside the while loop / outside the event structure.
The data needed in order to populate the tree structure comes from a database. In order to populate the tree control, i need to process the data by 2 for loops (one placed inside the other - the inner loop has 7 iterations, the outher loop iterates for every element of the array comming from the database).
Now the problem is this :
- the application gives an "Out of memory" error when i control it by using remote panels
- the application runs fine when i control it directly;
- if i disable the inner for loop the application runs corectly also on remote panels, but i cannot populate the tree structure in a correct manner.
Thank you !
Andrei
11-01-2016 07:42 AM
Now attach your VI (no pictures, please) so we can help you.
Bob Schor
11-05-2016 02:31 PM
Hello everybody,
Sorry for the late answer !
I have attached a vi showing the problem - using LabView 2014 64 bit on windows 7 64 bit !
Please see also the attached print screens !
Thank you so much for the input !
Andrei
11-06-2016 09:40 AM
You really need to learn how to use sub-VIs! Your Block Diagram requires a display of about 5000 x 2500 pixels to see, with almost all of the Event cases empty, except for one that fills the whole screen. A sub-VI, on the other hand, takes 32 x 32 pixels (and can be given an icon that indicates just what it does, making the code more-or-less self-documenting).
Several of your Events create data structures held in shift registers 5000 pixels long, so you can't possibly see both ends or keep track of what is carried on those registers. Several of them appear to be filled, but not used (or cleared in some cases), very confusing. I also see a step where a 100 x 100 array is created -- if you do this a lot, you can easily eat up lots of memory.
My suggestion -- simplify and simulate. Create a very small program that creates a small data set and does something "elementary" with it. Keep the Block Diagram to a size no more than fits a 4-year-old Laptop Screen (say 1280 x 1024 pixels), using sub-VIs liberally. Every time you have an urge to do something that involves a lot of wires and functions, try to make it into a sub-VI, if only to "save screen space" -- not only will your calling VI thank you by shrinking the code down to a 32 x 32 pixel space, you'll also have a smaller routine that you can independently test and be sure that it works.
Bob Schor