LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can text message box processing take up system memory in LabWindows/CVI 8.0?

Hi All,
 
We have a log window in our application and it will display the last 5 most recent log messages to the uses. The user can also use the vertical scroll bar
to display all the messages that have been generated thus far. To display the log message, we use the following function call:
 
    SetCtrlVal(panelHandle, MSGBOX, log_msg);
 
My question is over time, will the continuous generation and  display of system log messages causes LabWindows/CVI to take up additional system
memory which in turn causes the 'run of the memory' error to occur?
 
Thanks,
 
LabWindows_newbie
 
 
0 Kudos
Message 1 of 3
(3,512 Views)
Yes.

By default, if the text box is not cleared periodically, the memory use will grow without limit as you add text.

The simplest way to avoid this is to set the "extra lines" attribute for the control. From CVI Help:

ATTR_EXTRA_LINES
Type: Control attribute
Description: The maximum number of text box lines that can be retained off-screen.

Use -1 to specify an unlimited number of lines.

Control Types: Text boxes.
Data Type: integer
Valid Range: -1 or greater
Default Value: -1


Select a number that suits your application. For example:

SetCtrlAttribute(panelHandle, PANEL_TEXTBOX, ATTR_EXTRA_LINES, 1000);

After adding a log message, you can set the value of ATTR_FIRST_VISIBLE_LINE to ensure that the most recent messages are visible.

Regards,
Colin.
0 Kudos
Message 2 of 3
(3,502 Views)
Colin,
 
Thanks for your suggestion of setting the ATTR_EXTRA_LINES attribute for the text box.
 
Regards,
 
LabWindows_newbie
0 Kudos
Message 3 of 3
(3,494 Views)