
B–61863E–1/06
3. CREATING A C PROGRAM
APPLICATION
PROGRAMMING GUIDE
399
CAUTION
1 Intel provides library CLIB2C.LIB. For functions shown in
brackets [ ], include header files stdlib.h, stdio.h, and
PMC-RC C-language library PMC2.LIB provided by FANUC.
The [ ]* function can be used with the C function of the i
series. For the [ ]* function, use the PMC–RC C library
PMC3.LIB supplied from FANUC and header files math.h
and reent.h.
2 About 300 bytes are used as a data area when I/O functions
are used.
When a mathematical function is used, a data segment of
about 200 bytes is used.
3 Because all of the standard functions are near-type, code
segments larger than 64KB must be bound individually.
Furthermore, the following procedure is necessary to use
the printf and sprintf functions in tasks consisting of more
than one segment.
(1)Standard libraries CLIB2C.LIB and PMC2.LIB must be
bound for each segment.
(2)When the printf or sprintf function is called by a
subprogram located in a different segment than the task
entry, designated bits of R9072 must be turned on once
at the beginning of the subprogram to initialize the data
area used by printf and sprintf.
D Bind SEG_CODE1 and SEG_CODE2 with standard
libraries CLIB2C.LIB and PMC2.LIB.
D Turn on bit 0 of R9072 before printf or sprintf is used
in code segment SEG_CODE2.
(3)When the function to changed the display mode from
standard (25 rows 80 columns) like pl_dspopen2,
pl_dspopen3, and pl_dspopen4 is executed, designated
bits of R9072 must be turned on once at the beginning
of the task which calls printf.
15 14 3 2 1 0
TASK-ID 10 Initialization flag
TASK-ID 11 Initialization flag
TASK-ID 12 Initialization flag
TASK-ID 24 Initialization flag
TASK-ID 25 Initialization flag
R9072
Print
Print
S Code segment: SEG_CODE1
S Has task entry
S Code segment: SEG_CODE2
Example:
Task A (TASK ID=10)