LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Out of memory when calling CopyTabPage () function ...

Solved!
Go to solution

Hello,

 

I'm receiving error "-12 Out of memory" when using CopyTabPage (panel, TAB, 0, panel, TAB, -1) on my application (duplicating the first tab).

 

There is multi-level tab panel system (like next sample)

 

\tab_1	\sub_tab_1
		\sub_tab_2
		...
		\sub_tab_16

\tab_2	\sub_tab_1
		\sub_tab_2
		...
		\sub_tab_16

\tab_3	\sub_tab_1
		\sub_tab_2
		...
		\sub_tab_16

\tab_4	\sub_tab_1
		\sub_tab_2
		...
		\sub_tab_16

Each sub-tab panels contains appx. 16 x 60 controls (numeric, ring, string type) and some of them also stripchart graphs.

 

Did I reach the limit of CVI? Is there some things to check? (I'm developing under CVI 2012 SP1).

 

 

Could someone know how to overcome this issue?

 

Thanks,

 

George

0 Kudos
Message 1 of 13
(4,303 Views)

Hello, I don't know if an actual limit on the number of controls actually exists, but I have some questions for you:

 

  1. As far as I can understand, you have developed the first tab page (with its nested tab control with 16 pages) and want to duplicate it other times: am I right?
  2. I suppose you have simplified your code while typing it here, so TAB in real code translates to the appropriate PANEL_CONTROL form. Additionally, are you sure that 'panel' containt the handle for the panel that holds the first ("parent") tab control?
  3. Do you happen to have controls duplicated with DuplicateCtrl in some of the tabs? I had some problems in the past while duplicating a panel with duplicated controls over it: it was not the exact situation as yours (some splitters were involved) but I suppost it's worth asking
  4. Have you tried with a reduced number of controls / tab pages on the original panel?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 13
(4,300 Views)

Hello, Roberto!

 

Again, thanks a lot for your concern - you are really Enthuesiast in CVI area!!

 

To your questions:

The application is interface to the distributed control system, each sub- tab panel belongs to particular control node ... Some of them are displaying on-line data, other has data-polling activity.

 

ad 1) I prepare the first sub- tab panel as "template" (also used for default setting). During the run (and reading the configuration xml files) the approprite amount of panels are copied from the "template" panel.

 

ad 2) Yes, the code is simplified - there is original version ...

	if (nodePtr->nodeId > 1) {
		tabIdx = CopyTabPage (main_pTrigg, TRIGGER_TAB, 0, main_pTrigg, TRIGGER_TAB, -1);
	}
	else {
		tabIdx = 0;
	}

 ad 3) Huh! Maybe there is the problem - many of controls used on sub tab panels are lying on another small panels (making some generic set of them)... I suppose the following picture is better for clarify this ... The red ellipse surrounds controls on the small panel - and they are copied to next traces ...

Out_of_memory.png

 

 

ad 4) Not yet ... The problem arise today as I try to add some functionality (and activate more sub panels ...).

 

I'm wondering if there is some information of available memory for gui ...

 

George

0 Kudos
Message 3 of 13
(4,295 Views)

Wow! I must admit that I never tried such a complex UI!

I'm afraid I cannot give you specific hints: the following are only common sense suggestions...

 

Does the error arise on the first copy or after some copies? If the first option, one possible problem can be the embedded panels on the tab page, so I would start without the subpanels and see if the copy process performs without errors. This ultimately may lead to a different way of creating your panels.

 

If the error is on one of the last copies, maybe som NI fellow can share some knowledge with us on the limits CVI suffers in loading complex UIs.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 13
(4,292 Views)

Hi,

 

unfortunately the error now arises on 8th sub tab panel on sixth parent tab - five groups of sub panels are "generated" without problem ...

 

I have another question - whether I prepare the design of sub tab panels in uir file the problem comes again - or not ...? Probably I must try ...

But the advantage of runtime modification of the interface will be gone away...

 

George

0 Kudos
Message 5 of 13
(4,288 Views)

I second you: dynamical generation of controls is a powerful feature!

 

May there be simpler alternatives to that organization of panels? For example, could the controls you highlighted in your picture be organized as rows of a properly formatted table or items of a multicolumn tree? This will greatly simplify panel structure reducing a set of subpanels to a single table or tree control, while maintaining the ability to dynamically add as many rows as you want to it. Some control could be added separately like the checkbox on the last column.

 

Just a suggestion, don't know if it can completely fit you needs.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 13
(4,280 Views)

Hi, all,

 

I'm back again, unfortunately the problem with "Out of memory" comes up again :(.

 

Could someone from NI crew give a hint if there is any possibility to increase the available amount of memory?

 

Any help will be appreciated, I'm really in troubles, this issue is blocking further development ...

 

Thanks a lot,

 

George

0 Kudos
Message 7 of 13
(4,136 Views)

Hello George,

while I have really no additional clues for your situation, I would like to submit you a suggestion in the path of simplifying your user interface and perhaps avoiding the error you are facing: this is a table control structured to be similar to one of your tab panels. I know that the aspect is a bit different from your organization, but it consists of one control only instead of several child panels with their respective controls inside. It implies to dynamically create and customize table rows and to modify the functions that read / write to the table.

 

DocRabbit Table.png

 

Just my 2c.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 8 of 13
(4,114 Views)

Hi, Roberto!

 

Thanks for your suggestion - but the main complaint to this is SPEED.

Unfortunately the table refresh is too slow in contrast to the using of single controls...

 

Regards,

George

0 Kudos
Message 9 of 13
(4,111 Views)

Hi George,

 

If you can attach some form of your program that reproduces this error, I'd be happy to take a look at it for you, and then let you know if it really is a legitimate case of running out of memory, or if there's some other problem.

 

You could upload your program to NI's ftp site and then let me know here that you've done that so that I know to go look for it.

 

Luis

0 Kudos
Message 10 of 13
(4,086 Views)