Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 105 -
2.10 How to increase the global heap size for the application.
The means described here is effective to only the multi-task application.
On the multi-task C Executor application, each tasks (Main, Alarm and
Communication task) have their own DGROUP segment. The DGROUP segment size
is fixed as 64KB.
The DGROUP segment includes the initialized variables and the static or the
global variables. It is also used for the user's stack area.
In the auxiliary tasks (Alarm and Communication task), it is unusual to
define many string data or static variables and also the nested functions
may not be called so much because they are executed on the background.
Therefore, the most part of the DGROUP segment which is allocated as 64KB
of the auxiliary tasks is normally not used. By removing that unused region
to reduce the DGROUP semgnt size, it is possible to increase the global heap
area for the application program. Generally 80 through 100KB memory can be
freed for the global heap area.
The way to reducing the DGROUP segment size is described below.
(1) Using makefile of C Library BY01-1.5 (or later).
There is the definition section in the top part of "makefile" as follows.
You define the DGROUP segment size in this section.
TS1DG = FFFF # Task1's DGROUP segment limit size (HEX)
TS2DG = FFFF # Task2's DGROUP segment limit size (HEX)
TS3DG = FFFF # Task3's DGROUP segment limit size (HEX)
Specify the DGROUP segment limit size, which is the DGROUP segment size - 1,
with hexadecimal format in the variables "TS*DG" for each tasks. The default
size is 64KB for all tasks. ( FFFF(HEX) = 64KB - 1 )
For example, if you define the DGROUP segment size of the communication task
(TASK2) as 16KB, modify as follows.
TS2DG = 3FFF # Task2's DGROUP segment limit size (HEX)
(2) Using makefile of C Library BY01-1.4 (or older).
There is "TOOL" directory in the sub-directory (for example, \APP directory)
in which the C Library has been installed. "TASKALL2.DAT" file is in that
directory. This file is the template file of the build-file for linking the
whole application program. There are the definitions of the DGROUP segment
size (the limit size of the segment) for eash tasks. You modify that
definitions.