Series 16/18/21 C Language Executor Programming manual Page 1

Programming manual
TECHNOLOGY AND MORE
TECHNOLOGY AND MORETECHNOLOGY AND MORE
TECHNOLOGY AND MORE
GE Fanuc Automation Europe
GE Fanuc Automation EuropeGE Fanuc Automation Europe
GE Fanuc Automation Europe
C - Executer
B-62443EN-3/03
C
Computer Numerical Controls
Operator's Manual

Contents Summary of Series 16/18/21 C Language Executor Programming manual

  • Page 1GE Fanuc Automation Europe Computer Numerical Controls C - Executer Operator's Manual B-62443EN-3/03 TECHNOLOGY AND MORE
  • Page 2Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------- FANUC Series 16-MODEL B FANUC Series 16-MODEL C [4] FANUC Series 18-MODEL B [4] FANUC Series 18-MODEL C [4] FANUC Series 16i-MODEL A [5] FANUC Series 18i-MODEL A [5] C Executor Specification ---------------
  • Page 3Fanuc C-Executer Operating Manual B-62443EN-3/03E INTRODUCTION ...................................................................................................................................... 18 1. OVERVIEW .......................................................................................
  • Page 4Fanuc C-Executer Operating Manual B-62443EN-3/03E 1.1 Abort by assertion.
    ...................................................................................................... 112 2. CHARACTER HANDLING ( CTYPE.H ) ...............................................................................
  • Page 5Fanuc C-Executer Operating Manual B-62443EN-3/03E 6.7 Re-open a same stream. .................................................................... 159 6.8 Set a buffer for stream. ..................................................................... 160 6.9 Control
  • Page 6Fanuc C-Executer Operating Manual B-62443EN-3/03E 8. STRING HANDLING ( STRING.H )........................................................................................................... 213 8.1 Copy a memory block. .................................................................
  • Page 7Fanuc C-Executer Operating Manual B-62443EN-3/03E 17. Convert view coordinate into physical.
    .......................................................................... 269 18. Get color number the pixel.
    ....................................................................................
  • Page 8Fanuc C-Executer Operating Manual B-62443EN-3/03E 1. CNC window library ....................................................................................................................... 327 2. PMC window library...................................................................................
  • Page 9Fanuc C-Executer Operating Manual B-62443EN-3/03E 1.52 Write parameters (multiple output). .................................................................. 445 1.53 Read setting parameter. ...................................................................................
  • Page 10Fanuc C-Executer Operating Manual B-62443EN-3/03E [SUPPLEMENT] RETURN CODES OF CNC WINDOWS.............................................................................. 587 2. PMC WINDOW LIBRARY .........................................................................................................
  • Page 11Fanuc C-Executer Operating Manual B-62443EN-3/03E 1.4 Get CRT information. .......................................................................................... 676 1.5 Set CRT screen mode. .................................................................................
  • Page 12Fanuc C-Executer Operating Manual B-62443EN-3/03E 4.4 Show VGA window. ................................................................................................. 759 4.5 Hide VGA window. .....................................................................................
  • Page 13Fanuc C-Executer Operating Manual B-62443EN-3/03E 3.10 FCA LIBRARY................................................................................................................................. 822 LIBRARY OUTLINE ....................................................................................
  • Page 14Fanuc C-Executer Operating Manual B-62443EN-3/03E 5.1.1.3 Task switching......................................................................................................................... 890 5.1.1.4 Data access between tasks ....................................................................
  • Page 15Fanuc C-Executer Operating Manual B-62443EN-3/03E 5.10 PROGRAMMING TECHNIQUE................................................................................................... 938 5.10.1 VARIOUS TECHNIQUES ..............................................................................................
  • Page 16Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Draw 9-inch font character string.
    ................................................................................... 984 FANUC ADDITIONAL GRAPHIC FUNCTIONS ............................................................................... 985
  • Page 17Fanuc C-Executer Operating Manual B-62443EN-3/03E List of additional functions ............................................................................................................... 1031 1. Get current path number and screen index. (for multi-path) .............................
  • Page 18Fanuc C-Executer Operating Manual B-62443EN-3/03E APPENDIX A.......................................................................................................................................... 1083 SELF DEBUG FUNKTION.............................................................................
  • Page 19Fanuc C-Executer Operating Manual B-62443EN-3/03E Introduction This is a description of C Executor function specification for following FANUC CNC. Applied CNC ------------------------------------------------------ MODEL Abbreviated name ------------------------------------------------------ FANUC Se
  • Page 20Fanuc C-Executer Operating Manual B-62443EN-3/03E 1. Overview FANUC Series 16/18/16i/18i C Executor enables to add the Machine Tool [5] Builder's original screen into FANUC Series 16 and to customize screen displaying and operation interface of CNC software. It is possible to replace arbitrary scree
  • Page 21Fanuc C-Executer Operating Manual B-62443EN-3/03E 1.1 Feature (1) Low-cost customization No addtional hardware is required to use C Executor and application [4] program on FANUC Series 16/18-B/C and 16i/18i-A. (*) Many CRT/MDI devices, [5] such as 14-inch CRT with standard-keyboad, 9-inch CRT with s
  • Page 22Fanuc C-Executer Operating Manual B-62443EN-3/03E program can read from or write to FANUC FLOPPY CASSETTE ADAPTER and FANUC [4] HANDY FILE connected to CNC unit. [4] (*) "GRAPHIC DISPLAY" option is required to use graphic display, and "READER /PUNCHER INTERFACE CONTROL" to communication. (6) Using w
  • Page 23Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. System components The system components that C Executor and the user application program are built in 16/18-B/C and 16i/18i-A shows below. [5] +--------------------------------+ +----+ +-------------+ | | | <- | | | User | | | CNC window | -> | |
  • Page 24Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.2 C library C library provides following functions. (1) Input/output between peripheral equipments (CRT and MDI key) C library executes input/output operations, which are called by the user application program, such as character displaying to scree
  • Page 25Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.3 Application program (1) Program organization Application program consists of three independent tasks. +- USER APPLICATION -------------------------+ | +========================================+ | | | | | | | (A)MAIN TASK | | | | | | | +==========
  • Page 26Fanuc C-Executer Operating Manual B-62443EN-3/03E (*1) The same file cannot be accessed by two or more tasks simulta- neously. It is necessary to control exclusively in application program. (*2) Simultaneous access with MAIN TASK causes BUSY ERROR. (*3) It is necessary to control communication port
  • Page 27Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Example of application program For example, the program which consists of only Main task has following structures. ++---------------++ || main function || ++-------+-------++ | +----------+----------+ | Initialization | +----------+----------+ |
  • Page 28Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.4 The hardwares of CNC which are used in C Executor ITEM SPECIFICATION REMARKS ======================================================================== CPU i386 compatible processor It is common with CNC software. NUMERIC DATA none (16/18-B) [4] PR
  • Page 29Fanuc C-Executer Operating Manual B-62443EN-3/03E ITEM SPECIFICATION REMARKS ======================================================================== CRT [16/18-B] [4] (CHARACTER) 9-inch monochrome CRT [4] 9-inch monochrome PDP [4] 7.2-inch monochrome LCD [4] - Alphanumeric character [4] (40x16 or 8
  • Page 30Fanuc C-Executer Operating Manual B-62443EN-3/03E ITEM SPECIFICATION REMARKS ======================================================================== 7.2-inch monochrome LCD (*3) [4] - Alphanumeric character [4] (40x16(*4) or 80x25(*2),(*5)) [4] - Kanji character [4] (20x16(*4)) [4] - 16-grayscale,
  • Page 31Fanuc C-Executer Operating Manual B-62443EN-3/03E ITEM SPECIFICATION REMARKS ======================================================================== 8.4-inch color LCD (*3) [5] - Alphanumeric character [5] (40x16(*4) or 80x25(*2),(*5)) [5] - Kanji character [5] (20x16(*4)) [5] - 16-color, reverse,
  • Page 32Fanuc C-Executer Operating Manual B-62443EN-3/03E ITEM SPECIFICATION REMARKS ======================================================================== [16/18-C, 16i/18i-A] [5] - 640x400 x1(page), or [4] 640x480 x1(page) [4] - 16 or 256-color for each [4] pixel [4] - imposed output on character [4] sc
  • Page 33Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Application program development environment Application program of C Executor is developed by the Machine Tool Builder. - General PC(personal computer) is used to develop (edit and compile) appli- cation program. - Only execution of application pr
  • Page 34Fanuc C-Executer Operating Manual B-62443EN-3/03E (*) Both DPMI and VCPI are the programming interface to use the DOS appli- [4] cation program uses the extented memory above 1MB (protected memory) on [4] i386 or higher CPU. To use DPMI or VCPI, the memory manager that [4] supports these interfaces
  • Page 35Fanuc C-Executer Operating Manual B-62443EN-3/03E Software of the Machine Tool Builder +----------+ | | | | | +------+ | ----+ | | | | | | | | | | +----------+ +-+------+-+ | | | | | | +--- ( LINK ) ---> | +------+ | FANUC library | | | | | +----------+ | | | | | | | | +-+------+-+ | | | | | +------
  • Page 36Fanuc C-Executer Operating Manual B-62443EN-3/03E 3.2 Development procedure The development procedure of software for C Executor is as follows. +---------------+ --+ | SPECIFICATION | | | DESIGN | | +-------+-------+ | | | +-------+-------+ | | FUNCTION | | | DESIGN | | +-------+-------+ | | | +----
  • Page 37Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Completing program for C Executor After module level testing on PC, you develop entire application and link with FANUC library. If any error occured in this step, you confirm usage of C language library. You use makefile which is provided from FA
  • Page 38Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. C language library function list (Note) The floating point data functions that "" mark is added to the [4] function name are available on only 16/18-C and 16i/18i-A, not used [5] on 16/18-B. [4] 4.1 ANSI C language standard library The followin
  • Page 39Fanuc C-Executer Operating Manual B-62443EN-3/03E (5) Input/output remove sscanf ungetc rename vfprintf fread tmpnam vprintf fwrite fclose vsprintf fgetpos fflush fgetc fseek fopen fgets fsetpos freopen fputc ftell setbuf fputs rewind setvbuf getc clearerr fprintf getchar feof fscanf gets ferror pri
  • Page 40Fanuc C-Executer Operating Manual B-62443EN-3/03E (9) Mathematics [4] acos fabs pow [4] asin floor sin [4] atan fmod sinh [4] atan2 frexp sqrt [4] ceil ldexp tan [4] cos log tanh [4] cosh log10 [4] exp modf [4] -
  • Page 41Fanuc C-Executer Operating Manual B-62443EN-3/03E 4.2 MS-C extended C language standard library The following MS-C extended functions are provided. _chdrive _fstrcmp iskanji2 _dos_findfirst _fstrcpy iskmoji _dos_findnext _fstrcspn iskpun _dos_getdiskfree _fstricmp ispnkana _expand _fstrlen isprkana
  • Page 42Fanuc C-Executer Operating Manual B-62443EN-3/03E (continued) jtokata nthctype strnset jtolower open strrev jtoupper putenv strset kbhit read strupr lseek rmdir swab ltoa stackavail tell memicmp strcmpi toascii mkdir stricmp ultoa movedata strlwr write mtob strnicmp zentohan _clear87 cabs gc
  • Page 43Fanuc C-Executer Operating Manual B-62443EN-3/03E 4.3 Graphic library (1) MS-C compatible graphic functions The following MS-C graphic functions are provided. However, some detail specifications of functions may be different between PC and CNC because both hardwares are not compatible completely. _a
  • Page 44Fanuc C-Executer Operating Manual B-62443EN-3/03E 4.4 CNC/PMC window library The following functions which are used to input/output data between CNC /PMC are provided. (1) CNC window NAME FUCNTION -------------------------------------------------------------------------- cnc_sysinfo Read CNC system
  • Page 45Fanuc C-Executer Operating Manual B-62443EN-3/03E NAME FUNCTION -------------------------------------------------------------------------- cnc_rdtofs Read tool offset amount cnc_wrtofs Write tool offset amount cnc_rdtofsr Read tool offset amount (range specified) cnc_wrtofsr Write tool offset amount
  • Page 46Fanuc C-Executer Operating Manual B-62443EN-3/03E NAME FUNCTION -------------------------------------------------------------------------- cnc_toolnum Read tool life management data (tool number) cnc_rdtoolrng Read tool life management data (number,life,life counter)(range specified) cnc_rdtoolgrp R
  • Page 47Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Super CAP M window library [4] NAME FUNCTION [4] -------------------------------------------------------------------------- [4] capm_rdtool Read tool data file [4] capm_wrtool Write tool data file [4] capm_rdpretool Read pre-tool list [4] capm_wr
  • Page 48Fanuc C-Executer Operating Manual B-62443EN-3/03E 4.5 Other libraries (1) MDI operation library These funcitons are used to control key input from CNC's MDI panel. NAME FUNCTION -------------------------------------------------------------------------- aux_mdi_getmatrix Get MDI key matrix aux_mdi_pu
  • Page 49Fanuc C-Executer Operating Manual B-62443EN-3/03E NAME FUNCTION -------------------------------------------------------------------------- crt_getcncpalette Get color palette of CNC screen [5] win_open Open window win_close Close window win_select Select window win_activate Activate window win_move
  • Page 50Fanuc C-Executer Operating Manual B-62443EN-3/03E (4) Serial communication library These functions are used to communicate with peripherals via reader/ puncher interface(RS-232C). NAME FUNCTION -------------------------------------------------------------------------- rs_open Initialize communicatio
  • Page 51Fanuc C-Executer Operating Manual B-62443EN-3/03E (6) FCA library [4] These are the functions which communicate with FCA (FANUC CASSETTE ADAPTOR) [4] or FANUC Handy File. [4] NAME FUNCTION [4] -------------------------------------------------------------------------- [4] fca_setparam Initialize comm
  • Page 52Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor Programming Manual Copyright (C) FANUC LTD. 1995-1997. All rights reserved. - 51 -
  • Page 53Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor Description of CNC name, etc. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C Executor works on the following CNC equipments. FS16-MB, FS16-MC, FS16-TB, FS16-TC, FS16-PB, FS16-PC FS18-MB, FS18-MC, FS18-TB, FS18-TC, FS18-PB, FS18-PC FS16
  • Page 54Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor - This is a description of C Executor for FANUC Series 16/18. - DON'T use this manual for purposes except developing application programs of FS16/18 C Executor. - Some parts of this description include Japanese KANJI cha
  • Page 55Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 0. INDEX ~~~~~~~~ Filename Contents ---------------+---------------------------------------------------- 00index.man 0. INDEX 01soft.man 0.1 Required software for application development 10functn.man 1. List of Functions
  • Page 56Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor Update history 1995.10.3 1st edition. 1996. 2.7 2nd edition. 1997. 4.11 3rd edition. [ End of 00index.man ] - 55 -
  • Page 57Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor Required software for application development ================================================= The following softwares are required for development of the C Executor application program. Please purchase each package sof
  • Page 58Fanuc C-Executer Operating Manual B-62443EN-3/03E VCPI: Virtual Control Program Interface DPMI: DOS Protected Mode Interface Both are the interface specifications for the extended memory access by the DOS application programs. Therefore, the memory manager software for DOS must support VCPI or DPMI.
  • Page 59Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 1. List of Functions ==================== (abbreviation) CExe : C Executor ANSI : American National Standards Institute MS-C : Microsoft Corp. MS-C Ver 6.0, Ver 7.0 or Ver 8.0 (mark) x : available blank : not available M
  • Page 60Fanuc C-Executer Operating Manual B-62443EN-3/03E (4) Mathematics ( math.h ) ----------------------------------- ----------------------------------- Name CExe ANSI MS-C Name CExe ANSI MS-C -------------------+----+----+----- -------------------+----+----+----- acos MAC x x frexp MAC x x asin MAC x x
  • Page 61Fanuc C-Executer Operating Manual B-62443EN-3/03E (8) Input/output ( stdio.h ) ----------------------------------- ----------------------------------- Name CExe ANSI MS-C Name CExe ANSI MS-C -------------------+----+----+----- -------------------+----+----+----- remove MAC x x fputc MAC x x rename M
  • Page 62Fanuc C-Executer Operating Manual B-62443EN-3/03E (10) String handling ( string.h ) ----------------------------------- ----------------------------------- Name CExe ANSI MS-C Name CExe ANSI MS-C -------------------+----+----+----- -------------------+----+----+----- memcpy MAC x x memchr MAC x x me
  • Page 63Fanuc C-Executer Operating Manual B-62443EN-3/03E 1.2 MS-C extended C standard library Compatible functions with extended library of Microsoft C Compiler (MS-C Ver 6.0). ----------------------------------- ----------------------------------- Name CExe ANSI MS-C Name CExe ANSI MS-C ------------------
  • Page 64Fanuc C-Executer Operating Manual B-62443EN-3/03E ----------------------------------- ----------------------------------- Name CExe ANSI MS-C Name CExe ANSI MS-C -------------------+----+----+----- -------------------+----+----+----- _fstrchr MAC x _nmsize x _fstrcmp MAC x _nrealloc x _fstrcpy MAC x
  • Page 65Fanuc C-Executer Operating Manual B-62443EN-3/03E ----------------------------------- ----------------------------------- Name CExe ANSI MS-C Name CExe ANSI MS-C -------------------+----+----+----- -------------------+----+----+----- eof MAC x iskana MAC x execl x iskanji MAC x execle x iskanji2 MAC
  • Page 66Fanuc C-Executer Operating Manual B-62443EN-3/03E ----------------------------------- ----------------------------------- Name CExe ANSI MS-C Name CExe ANSI MS-C -------------------+----+----+----- -------------------+----+----+----- jtoupper MAC x spawnlpe x kbhit M x spawnv x ldexpl x spawnve x lf
  • Page 67Fanuc C-Executer Operating Manual B-62443EN-3/03E 1.3 Graphic library (1) MS-C compatible graphic functions Compatible functions with a part of graphic library of Microsoft C Compiler (MS-C Ver 6.0). --------------------------------------------------------------------------- Name CExe Function -----
  • Page 68Fanuc C-Executer Operating Manual B-62443EN-3/03E --------------------------------------------------------------------------- Name CExe Function ---------------------+----+------------------------------------------------ _setgtextvector M Set the current output vector of text. _setlinestyle M Set th
  • Page 69Fanuc C-Executer Operating Manual B-62443EN-3/03E 1.4 CNC/PMC window library Functions whish are used to input/output data between CNC/PMC. (1) CNC window library --------------------------------------------------------------------------- Name CExe Function ---------------------+----+---------------
  • Page 70Fanuc C-Executer Operating Manual B-62443EN-3/03E --------------------------------------------------------------------------- Name CExe Function ---------------------+----+------------------------------------------------ cnc_wrzofs MA Write work origin offset. cnc_rdzofsr MA Read work origin offset
  • Page 71Fanuc C-Executer Operating Manual B-62443EN-3/03E --------------------------------------------------------------------------- Name CExe Function ---------------------+----+------------------------------------------------ cnc_wrlife MA Write tool life management data (tool life). cnc_wrcount MA Write
  • Page 72Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Super CAP M window library --------------------------------------------------------------------------- Name CExe Function ---------------------+----+------------------------------------------------ capm_rdtool MA Read tool data file. capm_wrtool
  • Page 73Fanuc C-Executer Operating Manual B-62443EN-3/03E 1.5 Other libraries (1) MDI operation library These are the functions which customize key-input from MDI panel, alter key code, enable key repeating and generate key code by the application program. ---------------------------------------------------
  • Page 74Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) CRT operation library These are the functions which control CRT display and multiple window display. --------------------------------------------------------------------------- Name CExe Function ---------------------+----+-----------------------
  • Page 75Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) File operation library These are the functions which maintain file device. --------------------------------------------------------------------------- Name CExe Function ---------------------+----+------------------------------------------------
  • Page 76Fanuc C-Executer Operating Manual B-62443EN-3/03E (5) Task control library These are the functions which control task execution. --------------------------------------------------------------------------- Name CExe Function ---------------------+----+------------------------------------------------
  • Page 77Fanuc C-Executer Operating Manual B-62443EN-3/03E (7) F-ROM library These are the functions which read C Executor data stored in the flash ROM module. --------------------------------------------------------------------------- Name CExe Function ---------------------+----+---------------------------
  • Page 78Fanuc C-Executer Operating Manual B-62443EN-3/03E About floating point operation functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Floating point operation functins and "float" and "double" type variables are used only on FS16/18-C. On FS16/18-B, these functions are not available beacase FPU (Float
  • Page 79Fanuc C-Executer Operating Manual B-62443EN-3/03E Japanese(Multi-byte character) functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Following Jananese character/string functions (Multi-byte character functions) included in "MS-C extended standard library" are not available for the English version of
  • Page 80Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 2. How to make application program ================================== Table of contents 2.1 Outline 2.2 Definition of static variables 2.3 Environment variables 2.4 Special files 2.5 MAKEFILE 2.6 Remarks 2.7 How to use t
  • Page 81Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Editing the source files. Make the source files ( *.c and *.h files ) of the application program in the working directory. Use an arbitrary text editor to edit the files as same as editing the ordinary MS-DOS application. You may name the file as
  • Page 82Fanuc C-Executer Operating Manual B-62443EN-3/03E #------------------------------------------------------------------------------ # .OBJ and .C dependency block. #------------------------------------------------------------------------------ main.obj : main.c prog1.h sub1.obj : sub1.c prog1.h sub2.o
  • Page 83Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.2 Definition of static variables There are multiple versions of xlink386, which is used in link operation of the application, and there are the differences between each versions. The major difference is as follows. before ver 1.3 The BSS segment is
  • Page 84Fanuc C-Executer Operating Manual B-62443EN-3/03E Confirm that the contents of "taskall.map" file after linking of the application and that the FAR_BSS_1\FAR_BSS segment is not generated if you use the later version of xlink386 ver 1.5. The memory card file size, which is specified in "*.o2m" file u
  • Page 85Fanuc C-Executer Operating Manual B-62443EN-3/03E The user application's version number is defined in this file. For example, version number definition is as follows. char version[] = "TEST0001" ; "TEST" is the series string and "0001" is edition number. You can replace them with your original versi
  • Page 86Fanuc C-Executer Operating Manual B-62443EN-3/03E For the single task application, you should only define the macro TASK1. TASK1 = S1.OBJ S2.OBJ TASK2 = TASK3 = For the multi task application, you should define all the three macros TASK1, TASK2 and TASK3. TASK1 = S1.OBJ S2.OBJ TASK2 = X.OBJ TASK3 =
  • Page 87Fanuc C-Executer Operating Manual B-62443EN-3/03E Supplement of "makefile" format ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The format of "makefile", which is used for compiling and linking the C Executor application, has been changed a littel at BY01-1.5. You must use this new format "makefile" surely if you
  • Page 88Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Specifying xlink386 version. In the next part, you specify the version of your xlink386. If you use xlink386 Ver.2.0 (or later), you define the variable "XLINK20" by removing the leading comment mark (#) of the following line. You leave the line
  • Page 89Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.6 Remarks C Executor uses the different include files from the compiler's default. So, the object files made for the personal computer debugging cannot be used for execution on CNC. Recompile using include files for C Executor. (The include directo
  • Page 90Fanuc C-Executer Operating Manual B-62443EN-3/03E #[
  • Page 91Fanuc C-Executer Operating Manual B-62443EN-3/03E [Usage of xlib386.exe] (1) Command line syntax xlib386[Enter] or xlib386 @COMMAND[Enter] (COMMAND is the command filename) (2) Invocating commands in xlib386 "LIB>" prompt will be displayed when xlib386 has been started by only "xlib386[Enter]". You
  • Page 92Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.8 System alarm screen When CPU has detected any exception during execution of any software on the CNC unit, the exception handler in the CNC software stops whole system and displays the system alarm screen. There are some causes of system alarm, so
  • Page 93Fanuc C-Executer Operating Manual B-62443EN-3/03E SS3:ESP3 Stack pointer of privilege level 3 at exception CS:EIP CS:EIP of privilege level 3 at exception 21st line Cause of NMI Cause of NMI which is related to any hardware For the exception which is detected during execution of the application prog
  • Page 94Fanuc C-Executer Operating Manual B-62443EN-3/03E A part or all of the system alarm screen may not be displayed correctly, because software or hardware of CNC can't work correctly by the system alarm. The following brief system alarm screen may be displayed on the previous CNC software. +-----------
  • Page 95Fanuc C-Executer Operating Manual B-62443EN-3/03E Discrimination of task where the exception occured It is possible to discriminate the task which was executed when the exception occured by the contents of TR register (task register) in 7th line. Look up the displayed value of TR in "TS?_TSS" select
  • Page 96Fanuc C-Executer Operating Manual B-62443EN-3/03E To determine the error occurrence line from this screen, do the following process. You find that the exception occurred in PL3 because "ERROR-ADDRESS" in the 7th line is same as "CS:EIP" in the 16th line. You check that the code segment CS(=0837) in
  • Page 97Fanuc C-Executer Operating Manual B-62443EN-3/03E ;|*** func_1( NULL ) ; ; Line 12 << A part of taskall.map >> SEGMENTS INSTALLED IN TABLES TABLE SEL P DPL ACC USE BASE LIMIT SEGMENT NAME ------------+-----+-+---+---+---+---------+---------+------------ GDT(800) 1900H 1 0 RW 16T 00A00030H 0000000FH
  • Page 98Fanuc C-Executer Operating Manual B-62443EN-3/03E << err1.cod >> ; Static Name Aliases ; TITLE err1.c .286p .287 ERR1_TEXT SEGMENT WORD PUBLIC 'CODE' ERR1_TEXT ENDS _DATA SEGMENT WORD PUBLIC 'DATA' _DATA ENDS CONST SEGMENT WORD PUBLIC 'CONST' CONST ENDS _BSS SEGMENT WORD PUBLIC 'BSS' _BSS ENDS DGROU
  • Page 99Fanuc C-Executer Operating Manual B-62443EN-3/03E ;|*** ;|*** void main( void ) ;|*** { ; Line 9 PUBLIC _main _main PROC FAR *** 00000c c8 02 00 00 enter 2,0 ; ret = -2 ;|*** char ret ; ;|*** ;|*** ret = func_1( NULL ) ; ;|*** printf( "data=%d\n", ret ) ; ; Line 13 *** 000010 6a 00 push 0 *** 000012
  • Page 100Fanuc C-Executer Operating Manual B-62443EN-3/03E (Example 2) << err2.c >> 1: #include 2: 3: void func_2( char *ptr ) 4: { 5: printf( "%s\n", ptr ) ; 6: } 7: 8: void main( void ) 9: { 10: func_2( NULL ) ; 11: } Exception will occur at printf function in the 5th line by execution of this pr
  • Page 101Fanuc C-Executer Operating Manual B-62443EN-3/03E Therefore, you find that the library call which caused the exception is the previous operation code as follows. ;|*** printf( "%s\n", ptr ) ; ; Line 5 *** 000003 ff 76 08 push WORD PTR [bp+8] *** 000006 ff 76 06 push WORD PTR [bp+6] ;ptr *** 000009 1
  • Page 102Fanuc C-Executer Operating Manual B-62443EN-3/03E ERR2_TEXT SEGMENT ASSUME CS: ERR2_TEXT ;|*** #include ; Line 1 ;|*** ;|*** void func_2( char *ptr ) ;|*** { ; Line 4 PUBLIC _func_2 _func_2 PROC FAR *** 000000 55 push bp *** 000001 8b ec mov bp,sp ; ptr = 6 ;|*** printf( "%s\n", ptr ) ; ;
  • Page 103Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.9 Supplement about segments (1) Segments listed in link map The following segments are the ones listed in the segment table of taskall.map which is generated by xlink386. VERSION_GROUP Data segment of version.c VERSION_TEXT Code segment of version.
  • Page 104Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) Segment in which global and static variables are allocated Global variables and static variables are allocated in each segment according to the following rule. Not-initialized variables When total size of all not-initialized variables of any sour
  • Page 105Fanuc C-Executer Operating Manual B-62443EN-3/03E LOGICAL SEGMENTS INCLUDED: LENGTH ACCESS ALIGN USE SEGMENT NAME CLASS ----------+-------+-------+-----+----------------+----------- 00001D4FH ER WORD 16T TS1_fanuc_lib_T- CODE 00002DDAH RW WORD 16T TS1__DATA DATA 000000A2H RW WORD 16T TS1_CONST CONST
  • Page 106Fanuc C-Executer Operating Manual B-62443EN-3/03E 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 s
  • Page 107Fanuc C-Executer Operating Manual B-62443EN-3/03E Modify concretely as follows. << A part of "TASKALL2.DAT" file >> SEGMENT VERSION_GROUP ( BASE = 0A00030H, LIMIT = 0FH, DPL = 0 ) ,VERSION_TEXT ( LIMIT = +0, DPL = 0 ) ,SYSCONF_DATA ( BASE = 00A40000H, DPL = 3 ) ,SEG_GDT_USER ( USE32, ALIGN = DWORD,
  • Page 108Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.1 ANSI C standard library =========================== Lists of Functions ~~~~~~~~~~~~~~~~~~ 1. Diagnostics ( assert.h ) ------------------------------------------------------------------- Name Function ----------------
  • Page 109Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Mathematics ( math.h ) ------------------------------------------------------------------- Name Function ------------------------------------------------------------------- 3.1 acos Calculate the arc cosine value. 3.2 asin Calculate the arc sine v
  • Page 110Fanuc C-Executer Operating Manual B-62443EN-3/03E 6. Input/output ( stdio.h ) ------------------------------------------------------------------- Name Function ------------------------------------------------------------------- 6.1 remove Delete a file. 6.2 rename Change the name of a file. 6.3 tmpn
  • Page 111Fanuc C-Executer Operating Manual B-62443EN-3/03E 7. General utilities ( stdlib.h ) ------------------------------------------------------------------- Name Function ------------------------------------------------------------------- 7.1 atoi Convert string to int value. 7.2 atol Convert string to l
  • Page 112Fanuc C-Executer Operating Manual B-62443EN-3/03E 9. Date and time ( time.h ) ------------------------------------------------------------------- Name Function ------------------------------------------------------------------- 9.1 clock Get the current time. 9.2 mktime Convert local time to calende
  • Page 113Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ Refer ANSI C language regulation for detail function specifications. 1. Diagnostics ( assert.h ) ----------------------------------------------------------------------- 1.1 Abort by assertion.
    ------------
  • Page 114Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Character handling ( ctype.h ) ----------------------------------------------------------------------- 2.1 Test for alphanumeric character. ----------------------------------------------------------------------- [Name] isalnum [S
  • Page 115Fanuc C-Executer Operating Manual B-62443EN-3/03E ----------------------------------------------------------------------- 2.2 Test for alphabetic character. ----------------------------------------------------------------------- [Name] isalpha [Syntax] #include int isalph
  • Page 116Fanuc C-Executer Operating Manual B-62443EN-3/03E ----------------------------------------------------------------------- 2.3 Test for control character. ----------------------------------------------------------------------- [Name] iscntrl [Syntax] #include int iscntrl(
  • Page 117Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.4 Test for numeric character. ------------------------------------------------------------------------------ [Name] isdigit [Syntax] #include
  • Page 118Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.5 Test for visible character. ------------------------------------------------------------------------------ [Name] isgraph [Syntax] #include
  • Page 119Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.6 Test for lowercase alphabetic character. ------------------------------------------------------------------------------ [Name] islower [Syntax] #incl
  • Page 120Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.7 Test for printable character. ------------------------------------------------------------------------------ [Name] isprint [Syntax] #include
  • Page 121Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.8 Test for punctuation character. ------------------------------------------------------------------------------ [Name] ispunct [Syntax] #include
  • Page 122Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.9 Test for whitespace character. ------------------------------------------------------------------------------ [Name] isspace [Syntax] #include
  • Page 123Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.10 Test for uppercase alphabetic character. ------------------------------------------------------------------------------ [Name] isupper [Syntax] #inc
  • Page 124Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.11 Test for hexadecimal numeric character. ------------------------------------------------------------------------------ [Name] isxdigit [Syntax] #inc
  • Page 125Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.12 Convert uppercase to lowercase. ------------------------------------------------------------------------------ [Name] tolower [Syntax] #include
  • Page 126Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.13 Convert lowercase to uppercase. ------------------------------------------------------------------------------ [Name] toupper [Syntax] #include
  • Page 127Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Mathematics ( math.h ) ------------------------------------------------------------------------------ 3.1 Calculate the arc cosine value. ------------------------------------------------------------------------------ [Name] acos
  • Page 128Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.2 Calculate the arc sine value. ------------------------------------------------------------------------------ [Name] asin [Syntax] #include d
  • Page 129Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.3 Calculate the arc tangent value. ------------------------------------------------------------------------------ [Name] atan [Syntax] #include
  • Page 130Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.4 Calculate the arc tangent value. ------------------------------------------------------------------------------ [Name] atan2 [Syntax] #include
  • Page 131Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.5 Calculate the smallest integer value. ------------------------------------------------------------------------------ [Name] ceil [Syntax] #include
  • Page 132Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.6 Calculate the cosine value. ------------------------------------------------------------------------------ [Name] cos [Syntax] #include doub
  • Page 133Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.7 Calculate the hyperbolic cosine value. ------------------------------------------------------------------------------ [Name] cosh [Syntax] #include <
  • Page 134Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.8 Calculate the exponential function. ------------------------------------------------------------------------------ [Name] exp [Syntax] #include
  • Page 135Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.9 Calculate the absolute value. ------------------------------------------------------------------------------ [Name] fabs [Syntax] #include d
  • Page 136Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.10 Calculate the largest integer value. ------------------------------------------------------------------------------ [Name] floor [Syntax] #include <
  • Page 137Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.11 Calculate the floating point remainder value. ------------------------------------------------------------------------------ [Name] fmod [Syntax] #i
  • Page 138Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.12 Calculate the mantissa value. ------------------------------------------------------------------------------ [Name] frexp [Syntax] #include
  • Page 139Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.13 Calculate the value multiplied by the power of 2. ------------------------------------------------------------------------------ [Name] ldexp [Synta
  • Page 140Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.14 Calculate the natural (base-e) logarithm value. ------------------------------------------------------------------------------ [Name] log [Syntax] #
  • Page 141Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.15 Calculate the base-10 logarithm value. ------------------------------------------------------------------------------ [Name] log10 [Syntax] #include
  • Page 142Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.16 Get the fractional part and the integer part. ------------------------------------------------------------------------------ [Name] modf [Syntax] #i
  • Page 143Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.17 Calculate the raised value. ------------------------------------------------------------------------------ [Name] pow [Syntax] #include dou
  • Page 144Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.18 Calculate the sine value. ------------------------------------------------------------------------------ [Name] sin [Syntax] #include doubl
  • Page 145Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.19 Calculate the hyperbolic sine value. ------------------------------------------------------------------------------ [Name] sinh [Syntax] #include
  • Page 146Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.20 Calculate the square root value. ------------------------------------------------------------------------------ [Name] sqrt [Syntax] #include
  • Page 147Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.21 Calculate the tangent value. ------------------------------------------------------------------------------ [Name] tan [Syntax] #include do
  • Page 148Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.22 Calculate the hyperbolic tangent value. ------------------------------------------------------------------------------ [Name] tanh [Syntax] #include
  • Page 149Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. Non-local jumps ( setjmp.h ) ------------------------------------------------------------------------------ 4.1 Save current environment for non-local jump. ------------------------------------------------------------------------
  • Page 150Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4.2 Execute a non-local jump. ------------------------------------------------------------------------------ [Name] longjmp [Syntax] #include
  • Page 151Fanuc C-Executer Operating Manual B-62443EN-3/03E 5. Variable arguments ( stdarg.h ) ------------------------------------------------------------------------------ 5.1 Initialize arg_ptr. ------------------------------------------------------------------------------ [Name] va_start
  • Page 152Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 5.2 Get a next argument. ------------------------------------------------------------------------------ [Name] va_arg [Syntax] #include type v
  • Page 153Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 5.3 Reset arg_ptr. ------------------------------------------------------------------------------ [Name] va_end [Syntax] #include void va_end(
  • Page 154Fanuc C-Executer Operating Manual B-62443EN-3/03E 6. Input/output ( stdio.h ) ------------------------------------------------------------------------------ 6.1 Delete a file. ------------------------------------------------------------------------------ [Name] remove [Syntax] #inc
  • Page 155Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.2 Change the name of a file. ------------------------------------------------------------------------------ [Name] rename [Syntax] #include i
  • Page 156Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.3 Generate a temporary file name. ------------------------------------------------------------------------------ [Name] tmpnam [Syntax] #include
  • Page 157Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.4 Close a stream. ------------------------------------------------------------------------------ [Name] fclose [Syntax] #include int fclose(
  • Page 158Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.5 Flush a stream buffer. ------------------------------------------------------------------------------ [Name] fflush [Syntax] #include int f
  • Page 159Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.6 Open a stream. ------------------------------------------------------------------------------ [Name] fopen [Syntax] #include FILE *fopen( c
  • Page 160Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.7 Re-open a same stream. ------------------------------------------------------------------------------ [Name] freopen [Syntax] #include FILE
  • Page 161Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.8 Set a buffer for stream. ------------------------------------------------------------------------------ [Name] setbuf [Syntax] #include voi
  • Page 162Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.9 Control a buffer for stream. ------------------------------------------------------------------------------ [Name] setvbuf [Syntax] #include
  • Page 163Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.10 Print formatted data to a stream. ------------------------------------------------------------------------------ [Name] fprintf [Syntax] #include
  • Page 164Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.11 Read formatted data from a stream. ------------------------------------------------------------------------------ [Name] fscanf [Syntax] #include
  • Page 165Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.12 Print formatted data to standard output.
    ------------------------------------------------------------------------------ [Name] printf [Syntax] #include
  • Page 166Fanuc C-Executer Operating Manual B-62443EN-3/03E 2) "type" field specification. Char Type Output format -----+---------------+--------------------------------------------- d int Signed decimal number. i int Signed decimal number. u int Unsigned decimal number. o int Unsigned octal number. x int Uns
  • Page 167Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.13 Read formatted data from standard input.
    ------------------------------------------------------------------------------ [Name] scanf [Syntax] #include
  • Page 168Fanuc C-Executer Operating Manual B-62443EN-3/03E 1) Format specification format % [*] [width] [{h|l}] type type : Type of input argument, character, strings or numeric value. width : Maximum number of characters input from standard input. (positive decimal number) More characters than "width" are n
  • Page 169Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.14 Print formatted data to memory. ------------------------------------------------------------------------------ [Name] sprintf [Syntax] #include
  • Page 170Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.15 Read formatted data from memory. ------------------------------------------------------------------------------ [Name] sscanf [Syntax] #include
  • Page 171Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.16 Print formatted data to a file using variable arguments. ------------------------------------------------------------------------------ [Name] vfpri
  • Page 172Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.17 Print formatted data to standard output using variable arguments.
    ------------------------------------------------------------------------------ [Name] vprintf
  • Page 173Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.18 Print formatted data to memory using variable arguments. ------------------------------------------------------------------------------ [Name] vspri
  • Page 174Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.19 Read a character from a stream. ------------------------------------------------------------------------------ [Name] fgetc [Syntax] #include
  • Page 175Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.20 Read a strings from a stream. ------------------------------------------------------------------------------ [Name] fgets [Syntax] #include
  • Page 176Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.21 Write a character to a stream. ------------------------------------------------------------------------------ [Name] fputc [Syntax] #include
  • Page 177Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.22 Write a string to a stream. ------------------------------------------------------------------------------ [Name] fputs [Syntax] #include
  • Page 178Fanuc C-Executer Operating Manual B-62443EN-3/03E _ ------------------------------------------------------------------------------ 6.23 Read a character from a stream.
    ------------------------------------------------------------------------------ [Name] getc [Syntax] #include int ge
  • Page 179Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.24 Read a character from standard input.
    ------------------------------------------------------------------------------ [Name] getchar [Syntax] #include
  • Page 180Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.25 Read a line string from standard input.
    ------------------------------------------------------------------------------ [Name] gets [Syntax] #include
  • Page 181Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.26 Write a character to a stream.
    ------------------------------------------------------------------------------ [Name] putc [Syntax] #include int putc(
  • Page 182Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.27 Write a character to standard output.
    ------------------------------------------------------------------------------ [Name] putchar [Syntax] #include
  • Page 183Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.28 Write a string to standard output.
    ------------------------------------------------------------------------------ [Name] puts [Syntax] #include int p
  • Page 184Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.29 Put a character into a steam. ------------------------------------------------------------------------------ [Name] ungetc [Syntax] #include
  • Page 185Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.30 Read data from a stream. ------------------------------------------------------------------------------ [Name] fread [Syntax] #include siz
  • Page 186Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.31 Write data to a stream. ------------------------------------------------------------------------------ [Name] fwrite [Syntax] #include siz
  • Page 187Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.32 Get the current file position of a stream. ------------------------------------------------------------------------------ [Name] fgetpos [Syntax] #i
  • Page 188Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.33 Move the current file pointer. ------------------------------------------------------------------------------ [Name] fseek [Syntax] #include
  • Page 189Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.34 Set the current file position of stream. ------------------------------------------------------------------------------ [Name] fsetpos [Syntax] #inc
  • Page 190Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.35 Get the current file pointer. ------------------------------------------------------------------------------ [Name] ftell [Syntax] #include
  • Page 191Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.36 Rewind the current file pointer to the top of file. ------------------------------------------------------------------------------ [Name] rewind [Sy
  • Page 192Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.37 Reset error indicator of a stream. ------------------------------------------------------------------------------ [Name] clearerr [Syntax] #include
  • Page 193Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.38 Test for end-of-file. ------------------------------------------------------------------------------ [Name] feof [Syntax] #include int feo
  • Page 194Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.39 Test for error on stream. ------------------------------------------------------------------------------ [Name] ferror [Syntax] #include i
  • Page 195Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6.40 Print error message.
    ------------------------------------------------------------------------------ [Name] perror [Syntax] #include void perror( cons
  • Page 196Fanuc C-Executer Operating Manual B-62443EN-3/03E 7. General utilities ( stdlib.h ) ------------------------------------------------------------------------------ 7.1 Convert string to int value. ------------------------------------------------------------------------------ [Name]
  • Page 197Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.2 Convert string to long value. ------------------------------------------------------------------------------ [Name] atol [Syntax] #include
  • Page 198Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.3 Convert string to long value. ------------------------------------------------------------------------------ [Name] strtol [Syntax] #include
  • Page 199Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.4 Convert string to unsigned long value. ------------------------------------------------------------------------------ [Name] strtoul [Syntax] #includ
  • Page 200Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.5 Generate pseudo-random number. ------------------------------------------------------------------------------ [Name] rand [Syntax] #include
  • Page 201Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.6 Seed pseudo-random number generator. ------------------------------------------------------------------------------ [Name] srand [Syntax] #include
  • Page 202Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.7 Allocate memory block initialized by 0. ------------------------------------------------------------------------------ [Name] calloc [Syntax] #includ
  • Page 203Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.8 Free memory block. ------------------------------------------------------------------------------ [Name] free [Syntax] #include void free(
  • Page 204Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.9 Allocate memory block. ------------------------------------------------------------------------------ [Name] malloc [Syntax] #include void
  • Page 205Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.10 Reallocate memory block. ------------------------------------------------------------------------------ [Name] realloc [Syntax] #include
  • Page 206Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.11 Perform binary search. ------------------------------------------------------------------------------ [Name] bsearch [Syntax] #include vo
  • Page 207Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.12 Perform quick sort. ------------------------------------------------------------------------------ [Name] qsort [Syntax] #include void qs
  • Page 208Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.13 Get absolute value. ------------------------------------------------------------------------------ [Name] abs [Syntax] #include int abs(
  • Page 209Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.14 Get quotient and remainder. ------------------------------------------------------------------------------ [Name] div [Syntax] #include s
  • Page 210Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.15 Get absolute value. ------------------------------------------------------------------------------ [Name] labs [Syntax] #include long lab
  • Page 211Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.16 Get quotient and remainder. ------------------------------------------------------------------------------ [Name] ldiv [Syntax] #include
  • Page 212Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7.17 Convert string to double value. ------------------------------------------------------------------------------ [Name] atof [Syntax] #include
  • Page 213Fanuc C-Executer Operating Manual B-62443EN-3/03E _ ------------------------------------------------------------------------------ 7.18 Convert string to double value. ------------------------------------------------------------------------------ [Name] strtod [Syntax] #include
  • Page 214Fanuc C-Executer Operating Manual B-62443EN-3/03E 8. String handling ( string.h ) ------------------------------------------------------------------------------ 8.1 Copy a memory block. ------------------------------------------------------------------------------ [Name] memcpy [Sy
  • Page 215Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.2 Move a memory block. ------------------------------------------------------------------------------ [Name] memmove [Syntax] #include void
  • Page 216Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.3 Copy a string. ------------------------------------------------------------------------------ [Name] strcpy [Syntax] #include char *strcpy
  • Page 217Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.4 Copy a string. ------------------------------------------------------------------------------ [Name] strncpy [Syntax] #include char *strnc
  • Page 218Fanuc C-Executer Operating Manual B-62443EN-3/03E _ ------------------------------------------------------------------------------ 8.5 Concatenate a string. ------------------------------------------------------------------------------ [Name] strcat [Syntax] #include cha
  • Page 219Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.6 Concatenate a string. ------------------------------------------------------------------------------ [Name] strncat [Syntax] #include char
  • Page 220Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.7 Compare two memory blocks. ------------------------------------------------------------------------------ [Name] memcmp [Syntax] #include
  • Page 221Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.8 Compare two strings. ------------------------------------------------------------------------------ [Name] strcmp [Syntax] #include int st
  • Page 222Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.9 Compare two strings. ------------------------------------------------------------------------------ [Name] strncmp [Syntax] #include int s
  • Page 223Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.10 Find a character in a memory block. ------------------------------------------------------------------------------ [Name] memchr [Syntax] #include <
  • Page 224Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.11 Find a character in a string. ------------------------------------------------------------------------------ [Name] strchr [Syntax] #include
  • Page 225Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.12 Get string length which doesn't include a character. ------------------------------------------------------------------------------ [Name] strcspn [
  • Page 226Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.13 Find a character position in a string. ------------------------------------------------------------------------------ [Name] strpbrk [Syntax] #inclu
  • Page 227Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.14 Find the last character in a string. ------------------------------------------------------------------------------ [Name] strrchr [Syntax] #include
  • Page 228Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.15 Get string length composed by specified character. ------------------------------------------------------------------------------ [Name] strspn [Syn
  • Page 229Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.16 Find a string in a string. ------------------------------------------------------------------------------ [Name] strstr [Syntax] #include
  • Page 230Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.17 Get a token. ------------------------------------------------------------------------------ [Name] strtok [Syntax] #include char *strtok(
  • Page 231Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.18 Fill data in a memory block. ------------------------------------------------------------------------------ [Name] memset [Syntax] #include
  • Page 232Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8.19 Get string length. ------------------------------------------------------------------------------ [Name] strlen [Syntax] #include size_t
  • Page 233Fanuc C-Executer Operating Manual B-62443EN-3/03E 9. Date and time ( time.h ) ------------------------------------------------------------------------------ 9.1 Get the current time. ------------------------------------------------------------------------------ [Name] clock [Syntax
  • Page 234Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9.2 Convert local time to calender time. ------------------------------------------------------------------------------ [Name] mktime [Syntax] #include <
  • Page 235Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9.3 Get the current time. ------------------------------------------------------------------------------ [Name] time [Syntax] #include time_t ti
  • Page 236Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9.4 Convert time to string. ------------------------------------------------------------------------------ [Name] asctime [Syntax] #include char
  • Page 237Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9.5 Convert time to string. ------------------------------------------------------------------------------ [Name] ctime [Syntax] #include char *
  • Page 238Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9.6 Convert time to Greenwich mean time. ------------------------------------------------------------------------------ [Name] gmtime [Syntax] #include <
  • Page 239Fanuc C-Executer Operating Manual B-62443EN-3/03E _ ------------------------------------------------------------------------------ 9.7 Convert time to local time. ------------------------------------------------------------------------------ [Name] localtime [Syntax] #include
  • Page 240Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9.8 Compute the difference between the two times. ------------------------------------------------------------------------------ [Name] difftime [Syntax]
  • Page 241Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.2 MS-C extended C standard library ==================================== Lists of Functions ~~~~~~~~~~~~~~~~~~ -------------------------------------------------------------------------- Name Function -------------------
  • Page 242Fanuc C-Executer Operating Manual B-62443EN-3/03E _fmsize Get memory block size in heap. _fmtob Get byte length of a string. - 241 -
  • Page 243Fanuc C-Executer Operating Manual B-62443EN-3/03E -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- _fnthctype Get a kind of a character in a string. _frealloc Reallocate memory block. _
  • Page 244Fanuc C-Executer Operating Manual B-62443EN-3/03E -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- iskana Test for visible half-size KATAKANA character except a space. iskanji Test for
  • Page 245Fanuc C-Executer Operating Manual B-62443EN-3/03E -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- jtokata Convert full-size HIRAGANA to full-size KATAKANA. jtolower Convert full-size u
  • Page 246Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.3 Graphic library =================== Usage of graphic functions ~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. Kinds of the graphic display device. C Executor for FS16/18 supports the following two graphic display devices. (Refer also
  • Page 247Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Kinds of the graphic functions. C Library provides the following two kinds of the graphic functions. (1) MS-C compatible graphic functions These are the compatible functions with the graphic functions included in the MS-C Library. These are availa
  • Page 248Fanuc C-Executer Operating Manual B-62443EN-3/03E Lists of MS-C compatible functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C Executor supports the following MS-C compatible graphic functions. -------------------------------------------------------------------------- Name Function ----------------------
  • Page 249Fanuc C-Executer Operating Manual B-62443EN-3/03E -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 47. _setlinestyle Set the current line style. 48. _setpixel Draw a pixel. 49. _settext
  • Page 250Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ In the following section, the differences from the graphic functions of MS-C are mainly explained. Refer the function reference manual of MS-C for the details of each functions. The concrete behaviours of each fu
  • Page 251Fanuc C-Executer Operating Manual B-62443EN-3/03E [Remarks] This function is available on both ACRTC and VGA Graphic. - 250 -
  • Page 252Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Clear screen.
    ------------------------------------------------------------------------------ [Name] _clearscreen [Syntax] #include void _clearscreen( s
  • Page 253Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3. Draw a circle or an ellipse.
    ------------------------------------------------------------------------------ [Name] _ellipse [Syntax] #include short _el
  • Page 254Fanuc C-Executer Operating Manual B-62443EN-3/03E This function is available on both ACRTC and VGA Graphic. - 253 -
  • Page 255Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4. Paint the closed region.
    ------------------------------------------------------------------------------ [Name] _floodfill [Syntax] #include short _floo
  • Page 256Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 5. Get the current active page number.
    ------------------------------------------------------------------------------ [Name] _getactivepage [Syntax] #include
  • Page 257Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6. Get the information of the previous arc or pie.
    ------------------------------------------------------------------------------ [Name] _getarcinfo [Syntax] #inclu
  • Page 258Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7. Get the current back ground color.
    ------------------------------------------------------------------------------ [Name] _getbkcolor [Syntax] #include
  • Page 259Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8. Get the current fore ground color.
    ------------------------------------------------------------------------------ [Name] _getcolor [Syntax] #include sh
  • Page 260Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9. Get the current position in the view coordinate.
    ------------------------------------------------------------------------------ [Name] _getcurrentposition [Synta
  • Page 261Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 10. Get the current fill mask pattern.
    ------------------------------------------------------------------------------ [Name] _getfillmask [Syntax] #include
  • Page 262Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 11. Get the current font information.
    ------------------------------------------------------------------------------ [Name] _getfontinfo [Syntax] #include
  • Page 263Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 12. Get the text extent by pixel unit.
    ------------------------------------------------------------------------------ [Name] _getgtextextent [Syntax] #include
  • Page 264Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 13. Get the output vector of text.
    ------------------------------------------------------------------------------ [Name] _getgtextvector [Syntax] #include
  • Page 265Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 14. Get screen image.
    ------------------------------------------------------------------------------ [Name] _getimage [Syntax] #include void _getimage( sh
  • Page 266Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 15. Get the font pattern of Kanji character.
    ------------------------------------------------------------------------------ [Name] _getkanji [Syntax] #include
  • Page 267Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. 9-inch CRT 76543210 76543210 76543210 76543210 .......# #.....## #.###... ........ ........ ##.....# #..##... ##...... ........ ##.##### ######## ###..... ........ .......# #..##... ........ ........ .......# #..##... ........ ........ ..#.#... ..
  • Page 268Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) This function is available on only VGA Graphic. - 267 -
  • Page 269Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 16. Get the current line style.
    ------------------------------------------------------------------------------ [Name] _getlinestyle [Syntax] #include unsi
  • Page 270Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 17. Convert view coordinate into physical.
    ------------------------------------------------------------------------------ [Name] _getphyscoord [Syntax] #include
  • Page 271Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 18. Get color number the pixel.
    ------------------------------------------------------------------------------ [Name] _getpixel [Syntax] #include short _g
  • Page 272Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 19. Get the current output position of text.
    ------------------------------------------------------------------------------ [Name] _gettextposition [Syntax] #includ
  • Page 273Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 20. Get the text window border.
    ------------------------------------------------------------------------------ [Name] _gettextwindow [Syntax] #include voi
  • Page 274Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 21. Get the graphic configuration.
    ------------------------------------------------------------------------------ [Name] _getvideoconfig [Syntax] #include
  • Page 275Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 22. Convert physical coordinate into view.
    ------------------------------------------------------------------------------ [Name] _getviewcoord [Syntax] #include
  • Page 276Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 23. Get the current visual page number.
    ------------------------------------------------------------------------------ [Name] _getvisualpage [Syntax] #include
  • Page 277Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 24. Get the current writing mode.
    ------------------------------------------------------------------------------ [Name] _getwritemode [Syntax] #include sh
  • Page 278Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 25. Get the return status of graphic function.
    ------------------------------------------------------------------------------ [Name] _grstatus [Syntax] #include
  • Page 279Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 26. Get image buffer size.
    ------------------------------------------------------------------------------ [Name] _imagesize [Syntax] #include long _images
  • Page 280Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 27. Get font pattern size of Kanji character.
    ------------------------------------------------------------------------------ [Name] _kanjisize [Syntax] #include
  • Page 281Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 28. Draw a line.
    ------------------------------------------------------------------------------ [Name] _lineto [Syntax] #include short _lineto( short x, s
  • Page 282Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 29. Move the current graphic output position.
    ------------------------------------------------------------------------------ [Name] _moveto [Syntax] #include
  • Page 283Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 30. Draw a text string using the current font.
    ------------------------------------------------------------------------------ [Name] _outgtext [Syntax] #include
  • Page 284Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 31. Draw a text string in a memory.
    ------------------------------------------------------------------------------ [Name] _outmem [Syntax] #include void _
  • Page 285Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 32. Output a text string on the current position.
    ------------------------------------------------------------------------------ [Name] _outtext [Syntax] #include <
  • Page 286Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 33. Draw a pie figure.
    ------------------------------------------------------------------------------ [Name] _pie [Syntax] #include short _pie( short fill
  • Page 287Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 34. Draw a polygon.
    ------------------------------------------------------------------------------ [Name] _polygon [Syntax] #include short _polygon( short
  • Page 288Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 35. Put image data on the screen.
    ------------------------------------------------------------------------------ [Name] _putimage [Syntax] #include void _
  • Page 289Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 36. Draw a rectangle.
    ------------------------------------------------------------------------------ [Name] _rectangle [Syntax] #include short _rectangle(
  • Page 290Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 37. Register font file.
    ------------------------------------------------------------------------------ [Name] _registerfonts [Syntax] #include short _regi
  • Page 291Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 38. Map colors into all color palette.
    ------------------------------------------------------------------------------ [Name] _remapallpalette [Syntax] #include
  • Page 292Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 39. Map a color into a color palette.
    ------------------------------------------------------------------------------ [Name] _remappalette [Syntax] #include
  • Page 293Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 40. Set the current active page number.
    ------------------------------------------------------------------------------ [Name] _setactivepage [Syntax] #include
  • Page 294Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 41. Set the current back ground color.
    ------------------------------------------------------------------------------ [Name] _setbkcolor [Syntax] #include
  • Page 295Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 42. Set the clipping region.
    ------------------------------------------------------------------------------ [Name] _setcliprgn [Syntax] #include void _set
  • Page 296Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 43. Set the current fore ground color.
    ------------------------------------------------------------------------------ [Name] _setcolor [Syntax] #include s
  • Page 297Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 44. Set the current fill mask pattern.
    ------------------------------------------------------------------------------ [Name] _setfillmask [Syntax] #include
  • Page 298Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 45. Set the current font.
    ------------------------------------------------------------------------------ [Name] _setfont [Syntax] #include short _setfont(
  • Page 299Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 46. Set the current output vector of text.
    ------------------------------------------------------------------------------ [Name] _setgtextvector [Syntax] #include <
  • Page 300Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 47. Set the current line style.
    ------------------------------------------------------------------------------ [Name] _setlinestyle [Syntax] #include void
  • Page 301Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 48. Draw a pixel.
    ------------------------------------------------------------------------------ [Name] _setpixel [Syntax] #include short _setpixel( short
  • Page 302Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 49. Set the current output position of text.
    ------------------------------------------------------------------------------ [Name] _settextposition [Syntax] #includ
  • Page 303Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 50. Set the text row number.
    ------------------------------------------------------------------------------ [Name] _settextrows [Syntax] #include short _s
  • Page 304Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 51. Set the text window.
    ------------------------------------------------------------------------------ [Name] _settextwindow [Syntax] #include void _sett
  • Page 305Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 52. Set the screen video mode.
    ------------------------------------------------------------------------------ [Name] _setvideomode [Syntax] #include short
  • Page 306Fanuc C-Executer Operating Manual B-62443EN-3/03E ACRTC Graphic -------------------------------------------------------------------- Mode Size(Text) Palette (Color mode) -------------------------------------------------------------------- _98RESSCOLOR 640x400(80x25) 8 colors (PC-98) (_98RESS8COLOR)
  • Page 307Fanuc C-Executer Operating Manual B-62443EN-3/03E Specify one of following mode for the text mode. * 14-inch CRT, 9-inch CRT (small-character mode) CRT_MODE_V25_0 80-column x 25-line (starting line: 1) CRT_MODE_V25_1 80-column x 25-line (starting line: 2) CRT_MODE_V25_2 80-column x 25-line (starting
  • Page 308Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 53. Set the screen video mode and text row number.
    ------------------------------------------------------------------------------ [Name] _setvideomoderows [Syntax]
  • Page 309Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 54. Set the origin of the view port.
    ------------------------------------------------------------------------------ [Name] _setvieworg [Syntax] #include s
  • Page 310Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 55. Set the clipping region and the view coordinate.
    ------------------------------------------------------------------------------ [Name] _setviewport [Syntax] #in
  • Page 311Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 56. Set the current visual page number.
    ------------------------------------------------------------------------------ [Name] _setvisualpage [Syntax] #include
  • Page 312Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 57. Set the current writing mode.
    ------------------------------------------------------------------------------ [Name] _setwritemode [Syntax] #include sh
  • Page 313Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 58. Delete registered font file.
    ------------------------------------------------------------------------------ [Name] _unregisterfonts [Syntax] #include
  • Page 314Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 59. Enable/disable line wrapping.
    ------------------------------------------------------------------------------ [Name] _wrapon [Syntax] #include short _w
  • Page 315Fanuc C-Executer Operating Manual B-62443EN-3/03E MS-C graphic function compatibility list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "x" mark: Available Blank: NOT available ---------------------------------------------------------------------------- Name Function ACRTC VGA --------------------------
  • Page 316Fanuc C-Executer Operating Manual B-62443EN-3/03E ---------------------------------------------------------------------------- Name Function ACRTC VGA ---------------------------------------------------------------------------- _setcolor Set the current fore ground color. x x _setfillmask Set the cu
  • Page 317Fanuc C-Executer Operating Manual B-62443EN-3/03E Lists of C Executor original graphic functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C Executor graphic library supports the following original graphic functions in addition to MS-C compatible functions. -------------------------------------
  • Page 318Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ 1. Draw a standard size character.
    ------------------------------------------------------------------------------ [Name] gr_di
  • Page 319Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Draw a quad size character.
    ------------------------------------------------------------------------------ [Name] gr_displayfourlarge [Syntax] #include
  • Page 320Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3. Draw a hex size character.
    ------------------------------------------------------------------------------ [Name] gr_displaysixlarge [Syntax] #include v
  • Page 321Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4. Put monochrome image data.
    ------------------------------------------------------------------------------ [Name] _putpattern [Syntax] #include void _pu
  • Page 322Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following monochrome image data (19x8 dots) is drawn. The leading 2-word data in the buffer are the height and the width of the image pattern data. +---- 19 dots -----+ | | fedcba9876543210 765 0 ................ ... -+ 1 .####..####..#
  • Page 323Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 5. Get monochrome image data.
    ------------------------------------------------------------------------------ [Name] _getpattern [Syntax] #include void _ge
  • Page 324Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays a cursor. #include #include void example( short rsx, short rsy, short ch_num, short OldColor, short ForColor, short BakColor ) { char *image ; long image_size ; short w, h ; w = ch_num*8 ;
  • Page 325Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6. Draw a standard size string.
    ------------------------------------------------------------------------------ [Name] gr_dispstr [Syntax] #include void gr
  • Page 326Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7. Draw a hex size string.
    ------------------------------------------------------------------------------ [Name] gr_disp6str [Syntax] #include void gr_dis
  • Page 327Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8. Copy image data.
    ------------------------------------------------------------------------------ [Name] gr_bitblt [Syntax] #include void gr_bitblt( shor
  • Page 328Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.4 CNC/PMC window library ========================== Lists of Functions ~~~~~~~~~~~~~~~~~~ 1. CNC window library -------------------------------------------------------------------------- Name Function -----------------
  • Page 329Fanuc C-Executer Operating Manual B-62443EN-3/03E 1.38 cnc_statinfo Read CNC status information. - 328 -
  • Page 330Fanuc C-Executer Operating Manual B-62443EN-3/03E -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 1.39 cnc_alarm Read alarm status. 1.40 cnc_rdalminfo Read alarm information. 1.41 cnc_
  • Page 331Fanuc C-Executer Operating Manual B-62443EN-3/03E -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 1.82 cnc_t2info Read tool life management data (tool information 2). 1.83 cnc_toolnum
  • Page 332Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. PMC window library -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 2.1 pmc_rdpmcrng Read arbitrary PMC data (range specified). 2.2
  • Page 333Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ 1. CNC window library ------------------------------------------------------------------------------ 1.1 Read CNC system information. -----------------------------------------------------------------
  • Page 334Fanuc C-Executer Operating Manual B-62443EN-3/03E buf.axes = "4 " - 333 -
  • Page 335Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.2 Start output of NC program to be registered. ------------------------------------------------------------------------------ [Name] cnc_dwnstart [Syntax] #
  • Page 336Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.3 Output NC program to be registered. ------------------------------------------------------------------------------ [Name] cnc_download [Syntax] #include <
  • Page 337Fanuc C-Executer Operating Manual B-62443EN-3/03E NC program format ~~~~~~~~~~~~~~~~~ NC program to be registered to CNC is a string composed of ASCII characters as following format. LF Oxxxx LF Block1 LF Block2 LF ... LF Mxx LF % LF 0x0A ('\n'). Oxxxx Program number. Mxx M code at the end of the pr
  • Page 338Fanuc C-Executer Operating Manual B-62443EN-3/03E Moreover, return codes of several output before the last one may be returned by "Stop output NC program to be registered(cnc_dwnend)". - 337 -
  • Page 339Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program registers the next NC program to CNC. O1234 ; M3 S1200 ; G0 Z0 ; G0 X0 Y0 ; G1 F500 X120. Y-30. ; M30 ; #include #include int example( void ) { char *prg[] = { "\n", "O1234\n", "M3 S1200\n", "G0 Z0
  • Page 340Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.4 Output NC program to be registered (conditional). ------------------------------------------------------------------------------ [Name] cnc_cdownload [Syn
  • Page 341Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program is a modified version of the example of "Output NC program to be registered(cnc_download)" using this function. #include #include int example( void ) { char *prg[] = { "\n", "O1234\n", "M3 S1200\n"
  • Page 342Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.5 Output NC program to be registered (by address, conditional). ------------------------------------------------------------------------------ [Name] cnc_ac
  • Page 343Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program is a modified version of the example of "Output NC program to be registered(cnc_download)" using this function. #include #include #include int example( void ) { char *prg[] = { "\n", "O1
  • Page 344Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.6 Stop output NC program to be registered. ------------------------------------------------------------------------------ [Name] cnc_dwnend [Syntax] #includ
  • Page 345Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.7 Start output NC program to be compared. ------------------------------------------------------------------------------ [Name] cnc_vrfstart [Syntax] #inclu
  • Page 346Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.8 Output NC program to be compared. ------------------------------------------------------------------------------ [Name] cnc_verify [Syntax] #include
  • Page 347Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program compares the next NC program and "O1234" which is already registered in CNC. O1234 ; M3 S1200 ; G0 Z0 ; G0 X0 Y0 ; G1 F500 X120. Y-30. ; M30 ; #include #include int example( void ) { char *prg[] =
  • Page 348Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.9 Output NC program to be compared (conditional). ------------------------------------------------------------------------------ [Name] cnc_cverify [Syntax]
  • Page 349Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program is a modified version of the example of "Output NC program to be compared(cnc_verify)" using this function. #include #include int example( void ) { char *prg[] = { "\n", "O1234\n", "M3 S1200\n", "G
  • Page 350Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.10 Output NC program to be compared (by address, conditional). ------------------------------------------------------------------------------ [Name] cnc_acv
  • Page 351Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program is a modified version of the example of "Output NC program to be compared(cnc_verify)" using this function. #include #include #include int example( void ) { char *prg[] = { "\n", "O1234\
  • Page 352Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.11 Stop output NC program to be compared. ------------------------------------------------------------------------------ [Name] cnc_vrfend [Syntax] #include
  • Page 353Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.12 Start output NC program to be executed. ------------------------------------------------------------------------------ [Name] cnc_dncstart [Syntax] #incl
  • Page 354Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.13 Output NC program to be executed. ------------------------------------------------------------------------------ [Name] cnc_dnc [Syntax] #include
  • Page 355Fanuc C-Executer Operating Manual B-62443EN-3/03E For example, to execute commands such as M3 S2000 ; T14 ; G0 X10. ; G0 Z-5. ; M30 ; send a following string using cnc_dnc function. cnc_dnc( "\nM3S2000\nT14\nG0X10.\nG0Z-5.\nM30\n%", 32 ) ; The string data can be sent by multiple cnc_dnc functions. F
  • Page 356Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program executes the next NC commands by DNC operation. M3 S1500 ; G28 U0 W0 ; T0101 ; G0 X35. Z-10. ; M30 ; #include #include int example( void ) { char *prg[] = { "\n", "M3S1500\n", "G28U0W0\n", "T0101\n
  • Page 357Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.14 Output NC program to be executed (conditional). ------------------------------------------------------------------------------ [Name] cnc_cdnc [Syntax] #
  • Page 358Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program is a modified version of the example of "Output NC program to be executed(cnc_dnc)" using this function. #include #include int example( void ) { char *prg[] = { "\n", "M3S1500\n", "G28U0W0\n", "T01
  • Page 359Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.15 Stop output NC program to be executed. ------------------------------------------------------------------------------ [Name] cnc_dncend [Syntax] #include
  • Page 360Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.16 Start input NC program. ------------------------------------------------------------------------------ [Name] cnc_upstart [Syntax] #include #inc
  • Page 361Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.17 Input NC program. ------------------------------------------------------------------------------ [Name] cnc_upload [Syntax] #include #include
  • Page 362Fanuc C-Executer Operating Manual B-62443EN-3/03E Format of input data ~~~~~~~~~~~~~~~~~~~~ NC program which is read from CNC is a string composed of ASCII characters as following format. % LF Oxxxx LF Block1 LF Block2 LF ... LF Mxx LF % LF 0x0A ('\n'). Oxxxx Program number. Mxx M code at the end of
  • Page 363Fanuc C-Executer Operating Manual B-62443EN-3/03E ret = cnc_upend() ; return ( ret ) ; } - 362 -
  • Page 364Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.18 Input NC program (conditional). ------------------------------------------------------------------------------ [Name] cnc_cupload [Syntax] #include
  • Page 365Fanuc C-Executer Operating Manual B-62443EN-3/03E #include #include #include #define BUFSIZE 40 /* prgnum is NC program number to be read. */ int example( int prgnum ) { char buf[BUFSIZE+4] ; int ret, number ; ret = cnc_upstart( prgnum ) ; if ( ret ) return ( ret ) ; f
  • Page 366Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.19 Stop input NC program. ------------------------------------------------------------------------------ [Name] cnc_upend [Syntax] #include #includ
  • Page 367Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.20 Read condition of registration/comparison buffer. ------------------------------------------------------------------------------ [Name] cnc_buff [Syntax]
  • Page 368Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.21 Search specified program. ------------------------------------------------------------------------------ [Name] cnc_search [Syntax] #include #in
  • Page 369Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program searches the program whose program number is same as specified one, and displays the result. #include #include #include /* num is program number to be searched. */ void example( int num )
  • Page 370Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.22 Delete all programs. ------------------------------------------------------------------------------ [Name] cnc_delall [Syntax] #include #include
  • Page 371Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.23 Delete specified program. ------------------------------------------------------------------------------ [Name] cnc_delete [Syntax] #include #in
  • Page 372Fanuc C-Executer Operating Manual B-62443EN-3/03E break ; } } - 371 -
  • Page 373Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.24 Read program directory. ------------------------------------------------------------------------------ [Name] cnc_rdprogdir [Syntax] #include #i
  • Page 374Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the list of program numbers (program directory) of all NC programs registered in CNC. Program numbers, comments and character numbers of programs included in specified program number range are read with ASCII string format. Specif
  • Page 375Fanuc C-Executer Operating Manual B-62443EN-3/03E A null character ('\x00') is not added at the end of each strings stored in the buffer. For example, when the next programs are registered in CNC, the result of this function, in case that datano_s=1 and datano_e=9999, is as follows. Program number (
  • Page 376Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.25 Read program information. ------------------------------------------------------------------------------ [Name] cnc_rdproginfo [Syntax] #include
  • Page 377Fanuc C-Executer Operating Manual B-62443EN-3/03E Format of input data ~~~~~~~~~~~~~~~~~~~~ - type=0 Each data are stored in each members of the structure with binary format. - type=1 ASCII strings are stored in "buf.u.asc" with following format. % LF d1 LF d2 LF d3 LF d4 LF % LF 0x0A ('\n'). d1 Amo
  • Page 378Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.26 Read program number in executing. ------------------------------------------------------------------------------ [Name] cnc_rdprgnum [Syntax] #include
  • Page 379Fanuc C-Executer Operating Manual B-62443EN-3/03E N10 M98 P5678 ; N110 M98 P9876 ; N210 M45 ; N20 M30 ; N120 M99 ; N220 M99 ; - 378 -
  • Page 380Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.27 Read sequence number in executing. ------------------------------------------------------------------------------ [Name] cnc_rdseqnum [Syntax] #include <
  • Page 381Fanuc C-Executer Operating Manual B-62443EN-3/03E N30 G0 X110. ; N40 ... - 380 -
  • Page 382Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.28 Read actual feed rate of controlled axes. ------------------------------------------------------------------------------ [Name] cnc_actf [Syntax] #includ
  • Page 383Fanuc C-Executer Operating Manual B-62443EN-3/03E N20 G1 U10. W200. N30 ... - 382 -
  • Page 384Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.29 Read actual spindle speed. ------------------------------------------------------------------------------ [Name] cnc_acts [Syntax] #include #inc
  • Page 385Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.30 Read absolute position. ------------------------------------------------------------------------------ [Name] cnc_absolute [Syntax] #include #in
  • Page 386Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the absolute position data of the controlled axis of CNC. This absolute position is the actual tool position which includes amounts of Tool Length Compensation and Cutter Radius Compensation (M Series) or Tool Position Offset and
  • Page 387Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.31 Read machine position. ------------------------------------------------------------------------------ [Name] cnc_machine [Syntax] #include #incl
  • Page 388Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays "MACHINE 2: -265593" while the machine position data of the 2nd axis is -26.5593. (in case of "inch output" and "IS-B".) #include #include #include void example( void ) { struct
  • Page 389Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.32 Read relative position. ------------------------------------------------------------------------------ [Name] cnc_relative [Syntax] #include #in
  • Page 390Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays "RELATIVE 4: 900051" while the relative position data of the 4th axis(rotation axis) is 90.0051. (in case of "IS-C".) #include #include #include void example( void ) { struct iod
  • Page 391Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.33 Read distance to go. ------------------------------------------------------------------------------ [Name] cnc_distance [Syntax] #include #inclu
  • Page 392Fanuc C-Executer Operating Manual B-62443EN-3/03E The unit of the amount of distance to go is as follows. IS-B IS-C -----------------------+---------------+--------------- Linear axis [1] 0.0005 [mm] 0.00005 [mm] (mm input) [2] 0.001 [mm] 0.0001 [mm] Linear axis [1] 0.00005 [inch] 0.000005 [inch] (i
  • Page 393Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.34 Read skipped position. ------------------------------------------------------------------------------ [Name] cnc_skip [Syntax] #include #include
  • Page 394Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays the skipped position of the 1st and 2nd axes. #include #include #include void example( void ) { struct iodbaxis buf ; unsigned int idx ; cnc_skip( 1, 4+4*1, &buf ) ; printf( "SKI
  • Page 395Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.35 Read servo delay amount. ------------------------------------------------------------------------------ [Name] cnc_srvdelay [Syntax] #include #i
  • Page 396Fanuc C-Executer Operating Manual B-62443EN-3/03E for ( idx = 0 ; idx < MAX ; idx++ ) printf( "%u:%8ld\n", idx, buf.data[idx] ) ; } - 395 -
  • Page 397Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.36 Read acceleration/deceleration delay amount. ------------------------------------------------------------------------------ [Name] cnc_accdecdly [Syntax]
  • Page 398Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays the acceleration/deceleration delay amount of all axes (amount of axes = MAX). #include #include #include void example( void ) { struct iodbaxis buf ; unsigned int idx ; cnc_accd
  • Page 399Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.37 Read dynamic data. ------------------------------------------------------------------------------ [Name] cnc_rddynamic [Syntax] #include #includ
  • Page 400Fanuc C-Executer Operating Manual B-62443EN-3/03E [Arguments] axis Axis number ( =(1,..,amount of controlled axes), or -1 ). (This is effective to only data who have axis attribute.) length Data block length ( =22+4*4*(amount of axes to be read) ). buf Buffer in which the dynamic data are stored. [R
  • Page 401Fanuc C-Executer Operating Manual B-62443EN-3/03E cnc_rddynamic( -1, sizeof(buf), &buf ) ; printf( "Current program = %d Main program = %d\n", buf.prgnum, buf.prgmnum ) ; printf( "Sequence number = %ld\n", buf.seqnum ) ; printf( "actf = %ld acts = %ld\n", buf.actf, buf.acts ) ; printf( "Alarm status
  • Page 402Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.38 Read CNC status information. ------------------------------------------------------------------------------ [Name] cnc_statinfo [Syntax] #include
  • Page 403Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) Status of automatic operation (run) Value Display Meaning -------+-------+----------------------------------- 0 **** Reset state 1 STOP Automatic operation stop state 2 HOLD Feed hold state 3 STRT Cycle start state (3) Status of axis motion and d
  • Page 404Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The function "disp_status", which displays the CNC status on the screen with the same format as CNC's screen using this function, is included in "dispstat.c" file of the sample application. It is shown as below. #include #include
  • Page 405Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.39 Read alarm status. ------------------------------------------------------------------------------ [Name] cnc_alarm [Syntax] #include #include
  • Page 406Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays the kinds of alarms currently arising. #include #include #include void example( void ) { char *almmsg[] = { "P/S 100 ALARM","P/S 000 ALARM", "P/S 101 ALARM","P/S ALARM (1-255)",
  • Page 407Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.40 Read alarm information. ------------------------------------------------------------------------------ [Name] cnc_rdalminfo [Syntax] #include #i
  • Page 408Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the detail informations of currently arising CNC alarms. This function is used for displaying the alarm numbers or messages of the currently arising alarms by the application program, etc. Specify the kind of alarm to be read in "
  • Page 409Fanuc C-Executer Operating Manual B-62443EN-3/03E - type = 1 +-----------------------+ | Axis information 1 | <-- buf.u.alm2.alm[0].axis |-----------------------| | Alarm number 1 | <-- buf.u.alm2.alm[0].alm_no |-----------------------| | Message length 1 | <-- buf.u.alm2.alm[0].msg_len |-----------
  • Page 410Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays messages of all alarms which are currently arising in CNC. #include #include #include #include #include #define MAX_ALM 40 #define MAX_AXIS 8 char axis_name
  • Page 411Fanuc C-Executer Operating Manual B-62443EN-3/03E void example( void ) { struct odbapb alarm ; struct alminfo *alarm_buf ; char *temp_str, *ptr_axch, axch ; int type, idx ; get_axisname() ; alarm_buf = (struct alminfo *)malloc( 2+38*MAX_ALM ) ; temp_str = (char *)malloc( sizeof( alarm_buf->u.alm2.al
  • Page 412Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.41 Read tool offset amount. ------------------------------------------------------------------------------ [Name] cnc_rdtofs [Syntax] #include #inc
  • Page 413Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the tool offset amount stored in the CNC. Tool wear/geometry offset amounts and cutter radius/tool length offset amounts, etc. can be read. This function is used for the automatic programming function by the application program, f
  • Page 414Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program reads the wear offset amounts of specified tool number for each axes and displays them. (for T Series) #include #include #include /* tidx is tool index. */ void example( int tidx ) { stru
  • Page 415Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.42 Write tool offset amount. ------------------------------------------------------------------------------ [Name] cnc_wrtofs [Syntax] #include #in
  • Page 416Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Alters the tool offset amount stored in the CNC. Tool wear/geometry offset amounts and cutter radius/tool length offset amounts, etc. can be written in. This function is used for the preparation of machining or the tool offset measureme
  • Page 417Fanuc C-Executer Operating Manual B-62443EN-3/03E } - 416 -
  • Page 418Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.43 Read tool offset amount (range specified). ------------------------------------------------------------------------------ [Name] cnc_rdtofsr [Syntax] #in
  • Page 419Fanuc C-Executer Operating Manual B-62443EN-3/03E [Return] 0 Successful. 2 Incorrect data block length "length". 3 Incorrect offset number "s_number" or "e_number". (This return code is returned in case that any value except 1,..,(maximum number of offset) was specified in offset number "s_number" o
  • Page 420Fanuc C-Executer Operating Manual B-62443EN-3/03E Lathe Series/Tool offset Memory A type length Attribute Offset type Member to be stored in -------+-------+---------------+-----------------------+---------------------- 0 6+2*N individual Direction of imaginary buf.u.t_tip[i] tool nose 1 6+4*N indiv
  • Page 421Fanuc C-Executer Operating Manual B-62443EN-3/03E The unit of offset amount is as follows. ` IS-B IS-C -----------------------+---------------+--------------- Linear axis(mm input) 0.001 [mm] 0.0001 [mm] Linear axis(inch input) 0.0001 [inch] 0.00001 [inch] Rotation axis 0.001 [deg] 0.0001 [deg] [Exa
  • Page 422Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.44 Write tool offset amount (range specified). ------------------------------------------------------------------------------ [Name] cnc_wrtofsr [Syntax] #i
  • Page 423Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Alters the tool offset amount stored in the CNC within the specified range. Specify the start offset number in "buf.datano_s" and the end one in "buf.datano_e". Specify the kind of offset amount to be read in "type". The combinations of
  • Page 424Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.45 Read work origin offset. ------------------------------------------------------------------------------ [Name] cnc_rdzofs [Syntax] #include #inc
  • Page 425Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the work origin offset amount stored in the CNC. The work origin offset amounts are provided for all controlled axes (the 1st axis,..,the 8th axis) of the CNC. It is possible to read one offset amount for each axis or the whole fo
  • Page 426Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.46 Write work origin offset. ------------------------------------------------------------------------------ [Name] cnc_wrzofs [Syntax] #include #in
  • Page 427Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Alters the work origin offset amount stored in the CNC. The work origin offset amounts are provided for all controlled axes (the 1st axis,..,the 8th axis) of the CNC. It is possible to alter one offset amount for each axis or the whole
  • Page 428Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program alters the work origin offset amount of the specified offset number and axis number. #include #include /* ofs is offset number to be altered. */ /* axis is the axis number, offset is new offset val
  • Page 429Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.47 Read work origin offset (range specified). ------------------------------------------------------------------------------ [Name] cnc_rdzofsr [Syntax] #in
  • Page 430Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the work origin offset amount stored in the CNC within the specified range. The work origin offset amounts are provided for all controlled axes (the 1st axis,..,the 8th axis) of the CNC. It is possible to read one offset amount fo
  • Page 431Fanuc C-Executer Operating Manual B-62443EN-3/03E N is the amount of axis and M is the number of offset to be read. In case that the amount of controlled axes is less than 8, no data are stored in the members corresponding with the axes No. (amount of controlled axes + 1),..,8. The unit of the work
  • Page 432Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.48 Write work origin offset (range specified). ------------------------------------------------------------------------------ [Name] cnc_wrzofsr [Syntax] #i
  • Page 433Fanuc C-Executer Operating Manual B-62443EN-3/03E Specify one of following value as start/end offset number in "buf.datano_s"/"buf.datano_e". datano Kind of work origin offset amount -------+-------------------------------------------- 0 External work origin offset amount 1,..,6 Work origin offset a
  • Page 434Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program alters the work origin offset amount of G54 through G59 for the specified axis. #include #include #include /* axis is axis index to be altered. */ /* offset is array of new offset value.
  • Page 435Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.49 Read parameter. ------------------------------------------------------------------------------ [Name] cnc_rdparam [Syntax] #include #include
  • Page 436Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the parameter data stored in the CNC. This function is used for reading the various settings of CNC to execute any processes which are equivalent to CNC's by the application program, etc. Data types of CNC parameter are as follows
  • Page 437Fanuc C-Executer Operating Manual B-62443EN-3/03E printf( "%c\n", buf.u.cdatas[idx] ) ; } } - 436 -
  • Page 438Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.50 Write parameter. ------------------------------------------------------------------------------ [Name] cnc_wrparam [Syntax] #include #include
  • Page 439Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Alters the parameter data stored in the CNC. This function is used for changing the various settings of CNC by the application program, etc. Even if "PARAMETER WRITE" is "DISABLE" in setting data, it is possible to alter CNC's parameter
  • Page 440Fanuc C-Executer Operating Manual B-62443EN-3/03E The paramter stored in the CNC is changed immediately by execution of this function. But changed parameter value is not noticed to the automatic operation procedure of CNC while automatic operattion is being executed (i.e., while STL signal is "1").
  • Page 441Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.51 Read parameters (range specified). ------------------------------------------------------------------------------ [Name] cnc_rdparar [Syntax] #include
  • Page 442Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the parameter data stored in the CNC within the specified range. Data types of CNC parameter are as follows. The data types of parameter are different for every parameters number. Parameter type Use Byte size ---------------------
  • Page 443Fanuc C-Executer Operating Manual B-62443EN-3/03E The read parameters are stored in "buf" in following order. +-----------------------+ | Parameter number 1 | <-- buf[0].datano |-----------------------| | Type 1 | <-- buf[0].type |-----------------------| | Data 1 | <-- buf[0].u.cdata/idata/ldata/ |
  • Page 444Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program reads the parameter data within the specified number range and axis and displays them. #include #include #include #include /* start/end are start/end number to be read, axis is
  • Page 445Fanuc C-Executer Operating Manual B-62443EN-3/03E default : printf( " #%d:", ptr->type & 0xff ) ; case 0 : switch ( ptr->type >> 8 ) { case 0: printf( " 0x%02X\n", (unsigned char)(ptr->u.cdata) ) ; inc = 1+1 ; break ; case 1: printf( " %d\n", ptr->u.cdata ) ; inc = 1+1 ; break ; case 2: printf( " %d
  • Page 446Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.52 Write parameters (multiple output). ------------------------------------------------------------------------------ [Name] cnc_wrparas [Syntax] #include <
  • Page 447Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Alters the multiple parameter data stored in the CNC. Even if "PARAMETER WRITE" is "DISABLE" in setting data, it is possible to alter CNC's parameter data. Data types of CNC parameter are as follows. The data types of parameter are diff
  • Page 448Fanuc C-Executer Operating Manual B-62443EN-3/03E Store the parameter number in "Parameter number i"(buf[i].datano) with binary format. Store the parameter type in the upper byte of "Data i"(buf[i].type) and the axis type in the lower byte. Type (upper byte) Parameter type -----------------------+--
  • Page 449Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program writes M codes for macro call in No.6080,..,No.6089. #include #include #include /* mcode is 10 M-code values to be set. */ int example( int *mcode ) { struct iodbpsdr *buf, *ptr ; int re
  • Page 450Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.53 Read setting parameter. ------------------------------------------------------------------------------ [Name] cnc_rdset [Syntax] #include #inclu
  • Page 451Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the setting parameter stored in the CNC. This function is used for getting the information of I/O device from the setting parameter to input/output via Reader/Puncher interface of CNC by the application program, etc. Data types of
  • Page 452Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.54 Write setting parameter. ------------------------------------------------------------------------------ [Name] cnc_wrset [Syntax] #include #incl
  • Page 453Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Alters the setting parameter stored in the CNC. Even if "PARAMETER WRITE" is "DISABLE" in setting parameter, it is possible to alter CNC's setting parameter. This function is used for changing the setting of I/O device by the applicatio
  • Page 454Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] See example of "Read setting parameter(cnc_rdset)". - 453 -
  • Page 455Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.55 Read setting parameters (range specified). ------------------------------------------------------------------------------ [Name] cnc_rdsetr [Syntax] #inc
  • Page 456Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the setting parameter data stored in the CNC within the specified range. Data types of CNC setting parameter are as follows. The data types of setting parameter are different for every setting parameters number. Parameter type Use
  • Page 457Fanuc C-Executer Operating Manual B-62443EN-3/03E The read setting parameters are stored in "buf" in following order. +-----------------------+ |Setting param. Number 1| <-- buf[0].datano |-----------------------| | Type 1 | <-- buf[0].type |-----------------------| | Data 1 | <-- buf[0].u.cdata/ida
  • Page 458Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.56 Write setting parameters (multiple output). ------------------------------------------------------------------------------ [Name] cnc_wrsets [Syntax] #in
  • Page 459Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Alters the multiple setting parameter data stored in the CNC. Even if "PARAMETER WRITE" is "DISABLE" in setting data, it is possible to alter CNC's setting parameter data. Data types of CNC setting parameter are as follows. The data typ
  • Page 460Fanuc C-Executer Operating Manual B-62443EN-3/03E Store the setting parameter number in "Setting param. Number i" (buf[i].datano) with binary format. Store the setting parameter type in the upper byte of "Data i" (buf[i].type) and the axis type in the lower byte. Type (upper byte) Parameter type ---
  • Page 461Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.57 Read pitch error compensation data (range specified). ------------------------------------------------------------------------------ [Name] cnc_rdpitchr
  • Page 462Fanuc C-Executer Operating Manual B-62443EN-3/03E free( buf ) ; return ( ret ) ; } - 461 -
  • Page 463Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.58 Write pitch error compensation data (range specified). ------------------------------------------------------------------------------ [Name] cnc_wrpitchr
  • Page 464Fanuc C-Executer Operating Manual B-62443EN-3/03E free( buf ) ; return ( ret ) ; } - 463 -
  • Page 465Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.59 Read custom macro variable. ------------------------------------------------------------------------------ [Name] cnc_rdmacro [Syntax] #include
  • Page 466Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the custom macro variable data stored in the CNC. This function is used for controlling flow of the machining program of CNC by the application program exchanging data between the custom macro program in CNC and the application pr
  • Page 467Fanuc C-Executer Operating Manual B-62443EN-3/03E The standard value of "dec_val" is as follows. CNC system setting dec_val -----------------------+-------- IS-B and mm input 3 IS-C or inch input 4 [Example] The following program reads the custom macro variable data of specified number and displays
  • Page 468Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.60 Write custom macro variable. ------------------------------------------------------------------------------ [Name] cnc_wrmacro [Syntax] #include
  • Page 469Fanuc C-Executer Operating Manual B-62443EN-3/03E Refer "OPERATOR'S MANUAL" of CNC for details of custom macro variables. Specify the custom macro variable number to be written in "number" with binary format. Specify variable data to be written in both "mcr_val" and "dec_val". mcr_val 4-byte singed
  • Page 470Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.61 Read custom macro variables (range specified). ------------------------------------------------------------------------------ [Name] cnc_rdmacror [Syntax
  • Page 471Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the custom macro variable data stored in the CNC within the specified range. Types of custom macro variable are as follows. (1) Local variables ( #1,..,#33 ) Not readable. (Use cnc_rdmacro function.) (2) Common variables ( #100,..
  • Page 472Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.62 Write custom macro variables (range specified). ------------------------------------------------------------------------------ [Name] cnc_wrmacror [Synta
  • Page 473Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Writes the custom macro variable data stored in the CNC within the specified range. Types of custom macro variable are as follows. (1) Local variables ( #1,..,#33 ) Not writable. (Use cnc_wrmacro function.) (2) Common variables ( #100,.
  • Page 474Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.63 Read P-code macro variable. ------------------------------------------------------------------------------ [Name] cnc_rdpmacro [Syntax] #include
  • Page 475Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the macro executor variable (P-code macro variable) data of specified number. This function is used for controlling flow of the machining program of CNC or interactive macro function by the application program exchanging data betw
  • Page 476Fanuc C-Executer Operating Manual B-62443EN-3/03E "u.p2.mcr_val" and "u.p2.dec_val", members of the structure "odbpm", are definition for compatibility with the past specification. These are not used now. [Example] The following program reads the P-code macro variable of the specified number and dis
  • Page 477Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.64 Write P-code macro variable. ------------------------------------------------------------------------------ [Name] cnc_wrpmacro [Syntax] #include
  • Page 478Fanuc C-Executer Operating Manual B-62443EN-3/03E The following values are stored concretely. (These are same as format of cnc_rdpmacro() function.) Value to be written mcr_val dec_val ---------------+---------------+-------- void 0 -1 0.000 0 3 0.0000001 1 7 0000.0001 1 4 00000.100 100 3 00001.000
  • Page 479Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.65 Read P-code macro variables (range specified). ------------------------------------------------------------------------------ [Name] cnc_rdpmacror [Synta
  • Page 480Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the macro executor variable (P-code macro variable) data within the specified range. Specify the start P-code macro variable number in "s_number" and the end one in "e_number" with binary format. The variable data is stored in bot
  • Page 481Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.66 Write P-code macro variables (range specified). ------------------------------------------------------------------------------ [Name] cnc_wrpmacror [Synt
  • Page 482Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Writes the macro executor variable (P-code macro variable) data within the specified range. Specify the start custom macro variable number in "buf.datano_s" and the end one in "buf.datano_e" with binary format. Store the variable data t
  • Page 483Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.67 Read modal data. ------------------------------------------------------------------------------ [Name] cnc_modal [Syntax] #include #include
  • Page 484Fanuc C-Executer Operating Manual B-62443EN-3/03E (1) Reading modal G code. Specify 0,..,20 of G code group number in "type". M Series T Series -------+---------------+------------------------------ G code Type Gcode g_data A B C g_data -------+-------+-------+-------+-------+-------+------ 0 G00 0
  • Page 485Fanuc C-Executer Operating Manual B-62443EN-3/03E M Series T Series -------+---------------+------------------------------ G code Type Gcode g_data A B C g_data -------+-------+-------+-------+-------+-------+------ 8 G73 10 G22 G22 G22 1 G74 11 G23 G23 G23 0 G76 12 G80 0 G81 1 G82 2 G83 3 G84 4 G85
  • Page 486Fanuc C-Executer Operating Manual B-62443EN-3/03E M Series T Series -------+---------------+------------------------------ G code Type Gcode g_data A B C g_data -------+-------+-------+-------+-------+-------+------ 16 G15 0 G16 1 -------+-------+-------+-------+-------+-------+------ 17 G40.1 1 G41
  • Page 487Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) Reading modal data other than G code. type Address -------+-------------------------------- 100 B (2nd auxiliary function) 101 D 102 - (reserved) 103 F 104 H [M] 105 L 106 M 107 S 108 T 109 R [M] 110 P [M] 111 Q [M] 112 M (2nd M code) 113 M (3rd
  • Page 488Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The function "disp_modal", which displays the modal data on the screen using this function, is included in "position.c" file of the sample application. It is shown as below. (This function displays on only 14-inch display.) #include
  • Page 489Fanuc C-Executer Operating Manual B-62443EN-3/03E /* --- display modal data --- */ void disp_modal( void ) { unsigned int modal_m_00[] = { 00,01,02,03,33 } ; unsigned int modal_m_01[] = { 17,00,00,00,19,00,00,00,18 } ; unsigned int modal_m_02[] = { 90,91 } ; unsigned int modal_m_04[] = { 94,95 } ; u
  • Page 490Fanuc C-Executer Operating Manual B-62443EN-3/03E if ( nc_type == NC_T ) { /* When Lathe system */ disp_modal_g( 0, modal_t_00, 14, 3 ) ; disp_modal_g( 1, modal_t_01, 15, 3 ) ; disp_modal_g( 3, modal_t_03, 16, 3 ) ; disp_modal_g( 4, modal_t_04, 18, 3 ) ; disp_modal_g( 5, modal_t_05, 19, 3 ) ; disp_m
  • Page 491Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.68 Read diagnostics data. ------------------------------------------------------------------------------ [Name] cnc_diagnoss [Syntax] #include #inc
  • Page 492Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the contents of data displayed in the diagnostics screen of CNC. Data types of CNC diagnostics data are as follows. The data types of diagnostics data are different for every diagnostic number. Data type Use Byte size ------------
  • Page 493Fanuc C-Executer Operating Manual B-62443EN-3/03E 419 Word 420 2-Word - 492 -
  • Page 494Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program reads the status of automatic operation of CNC and displays them. #include #include #include void example( void ) { int dgn_no[] = { 0,1,2,3,4,5,6,10,11,12,13,14,15 } ; char *dgn_msg[] =
  • Page 495Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.69 Read diagnostics data (range specified). ------------------------------------------------------------------------------ [Name] cnc_diagnosr [Syntax] #inc
  • Page 496Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the contents of data displayed in the diagnostics screen of CNC within the specified range. Data types of CNC diagnostics data are as follows. The data types of diagnostics data are different for every diagnostic number. Data type
  • Page 497Fanuc C-Executer Operating Manual B-62443EN-3/03E The read diagnostics data are stored in "buf" in following order. +-----------------------+ | Data number 1 | <-- buf[0].datano |-----------------------| | Type 1 | <-- buf[0].type |-----------------------| | Data 1 | <-- buf[0].u.cdata/idata/ldata/
  • Page 498Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program reads the diagnostics data within the specified number range and axis and displays them. #include #include #include #include /* start/end are start/end number to be read. */ /*
  • Page 499Fanuc C-Executer Operating Manual B-62443EN-3/03E putchar( '\n' ) ; ptr = (struct iodbpsdr *)(((char *)ptr)+4+8*inc) ; break ; default : printf( " #%d:", ptr->type & 0xff ) ; case 0: switch ( ptr->type >> 8 ) { case 0: printf( " %02X\n", ptr->u.cdata ) ; inc = 2 ; break ; case 1: printf( " %d\n", pt
  • Page 500Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.70 Read A/D conversion data. ------------------------------------------------------------------------------ [Name] cnc_adcnv [Syntax] #include #inc
  • Page 501Fanuc C-Executer Operating Manual B-62443EN-3/03E The A/D conversion data (0,..,255) which is converted from input voltage data is stored in "buf.data" with binary format. The digital data is linearly proportional to the input voltage as follows. Input voltage buf.data ---------------+----------- -1
  • Page 502Fanuc C-Executer Operating Manual B-62443EN-3/03E printf( "CHANNEL #%d %s [V]\n", idx+1, strbuf ) ; } } - 501 -
  • Page 503Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.71 Read operator's message. ------------------------------------------------------------------------------ [Name] cnc_rdopmsg [Syntax] #include #in
  • Page 504Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.72 Read tool life management data (tool group index). ------------------------------------------------------------------------------ [Name] cnc_rdgrpid [Syn
  • Page 505Fanuc C-Executer Operating Manual B-62443EN-3/03E } - 504 -
  • Page 506Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.73 Read tool life management data (tool group number). ------------------------------------------------------------------------------ [Name] cnc_rdngrp [Syn
  • Page 507Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.74 Read tool life management data (tool number). ------------------------------------------------------------------------------ [Name] cnc_rdntool [Syntax]
  • Page 508Fanuc C-Executer Operating Manual B-62443EN-3/03E return ( ret ) ; } - 507 -
  • Page 509Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.75 Read tool life management data (tool life). ------------------------------------------------------------------------------ [Name] cnc_rdlife [Syntax] #in
  • Page 510Fanuc C-Executer Operating Manual B-62443EN-3/03E } - 509 -
  • Page 511Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.76 Read tool life management data (tool life count). ------------------------------------------------------------------------------ [Name] cnc_rdcount [Synt
  • Page 512Fanuc C-Executer Operating Manual B-62443EN-3/03E return ( ret ) ; } - 511 -
  • Page 513Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.77 Read tool life management data (tool length compensation number 1). ------------------------------------------------------------------------------ [Name]
  • Page 514Fanuc C-Executer Operating Manual B-62443EN-3/03E printf( "ERROR!(%d)\n", ret ) ; return ( ret ) ; } - 513 -
  • Page 515Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.78 Read tool life management data (tool length compensation number 2). ------------------------------------------------------------------------------ [Name]
  • Page 516Fanuc C-Executer Operating Manual B-62443EN-3/03E printf( "ERROR!(%d)\n", ret ) ; return ( ret ) ; } - 515 -
  • Page 517Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.79 Read tool life management data (tool radius compensation number 1). ------------------------------------------------------------------------------ [Name]
  • Page 518Fanuc C-Executer Operating Manual B-62443EN-3/03E return ( ret ) ; } - 517 -
  • Page 519Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.80 Read tool life management data (tool radius compensation number 2). ------------------------------------------------------------------------------ [Name]
  • Page 520Fanuc C-Executer Operating Manual B-62443EN-3/03E return ( ret ) ; } - 519 -
  • Page 521Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.81 Read tool life management data (tool information 1). ------------------------------------------------------------------------------ [Name] cnc_t1info [Sy
  • Page 522Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program reads the tool information of the specified tool group and tool number, and displays it. #include #include #include /* grpno/toolno are GROUP/TOOL index number to be read. */ int example(
  • Page 523Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.82 Read tool life management data (tool information 2). ------------------------------------------------------------------------------ [Name] cnc_t2info [Sy
  • Page 524Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program reads the tool information of the specified tool group and tool use-order number, and displays it. #include #include #include /* grpno/useno are GROUP/USE-ORDER index number to be read. *
  • Page 525Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.83 Read tool life management data (tool number). ------------------------------------------------------------------------------ [Name] cnc_toolnum [Syntax]
  • Page 526Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program reads the tool number of the specified tool group and tool use-order number, and displays it. #include #include #include /* grpno/useno are GROUP/USE-ORDER index number to be read. */ int
  • Page 527Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.84 Read tool life management data (number,life,life counter)(range specified). -----------------------------------------------------------------------------
  • Page 528Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program reads the amount of tool, the tool life value and the tool life counter within the specified tool group range, and displays them. #include #include #include #include /* start/e
  • Page 529Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.85 Read tool life management data in group. ------------------------------------------------------------------------------ [Name] cnc_rdtoolgrp [Syntax] #in
  • Page 530Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the various tool informations of the specified tool group in the lump. Specify the tool group number in "grp_num" with binary format. The currently used tool group is referenced by specifying "0" in "grp_num". The following inform
  • Page 531Fanuc C-Executer Operating Manual B-62443EN-3/03E } - 530 -
  • Page 532Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.86 Write tool life management data (life count)(range specified). ------------------------------------------------------------------------------ [Name] cnc_
  • Page 533Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program alters the tool life counter within the specified tool group range. #include #include #include /* grpno is start GROUP index number to be written. */ /* num is number of group. */ /* cou
  • Page 534Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.87 Register tool life management data (tool group). ------------------------------------------------------------------------------ [Name] cnc_wrtoolgrp [Syn
  • Page 535Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Writes the tool number, the tool life value and the tool life counter type in the specified tool group. Specify the tool number, the tool group number, the tool life counter type and the tool life value in each "toolno", "buf.datano", "
  • Page 536Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.88 Write tool life management data (tool life). ------------------------------------------------------------------------------ [Name] cnc_wrlife [Syntax] #i
  • Page 537Fanuc C-Executer Operating Manual B-62443EN-3/03E return ( ret ) ; } - 536 -
  • Page 538Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.89 Write tool life management data (tool life counter). ------------------------------------------------------------------------------ [Name] cnc_wrcount [S
  • Page 539Fanuc C-Executer Operating Manual B-62443EN-3/03E return ( ret ) ; } - 538 -
  • Page 540Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.90 Write tool life management data (counter type). ------------------------------------------------------------------------------ [Name] cnc_wrcnttype [Synt
  • Page 541Fanuc C-Executer Operating Manual B-62443EN-3/03E printf( "ERROR!(%d)\n", ret ) ; return ( ret ) ; } - 540 -
  • Page 542Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.91 Write tool life management data (tool length compensation number 1). ------------------------------------------------------------------------------ [Name
  • Page 543Fanuc C-Executer Operating Manual B-62443EN-3/03E printf( "ERROR!(%d)\n", ret ) ; return ( ret ) ; } - 542 -
  • Page 544Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.92 Write tool life management data (tool length compensation number 2). ------------------------------------------------------------------------------ [Name
  • Page 545Fanuc C-Executer Operating Manual B-62443EN-3/03E } - 544 -
  • Page 546Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.93 Write tool life management data (tool radius compensation number 1). ------------------------------------------------------------------------------ [Name
  • Page 547Fanuc C-Executer Operating Manual B-62443EN-3/03E printf( "ERROR!(%d)\n", ret ) ; return ( ret ) ; } - 546 -
  • Page 548Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.94 Write tool life management data (tool radius compensation number 2). ------------------------------------------------------------------------------ [Name
  • Page 549Fanuc C-Executer Operating Manual B-62443EN-3/03E } - 548 -
  • Page 550Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.95 Write tool life management data (tool information 1). ------------------------------------------------------------------------------ [Name] cnc_wrt1info
  • Page 551Fanuc C-Executer Operating Manual B-62443EN-3/03E When the tool is set as cleared status or skipped status, the condition of tool changes as follows. Setting Before After ---------------+---------------+--------------- Skipped (#) Not used ( ) Cleared Skipped (#) Using (@) Used (*) Not used ( ) ----
  • Page 552Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.96 Write tool life management data (tool information 2). ------------------------------------------------------------------------------ [Name] cnc_wrt2info
  • Page 553Fanuc C-Executer Operating Manual B-62443EN-3/03E When the tool is set as cleared status or skipped status, the condition of tool changes as follows. Setting Before After ---------------+---------------+--------------- Skipped (#) Not used ( ) Cleared Skipped (#) Using (@) Used (*) Not used ( ) ----
  • Page 554Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.97 Write tool life management data (tool number). ------------------------------------------------------------------------------ [Name] cnc_wrtoolnum [Synta
  • Page 555Fanuc C-Executer Operating Manual B-62443EN-3/03E } - 554 -
  • Page 556Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.98 Set path index (multi-path system). ------------------------------------------------------------------------------ [Name] cnc_setpath [Syntax] #include <
  • Page 557Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.99 Get path index (multi-path system). ------------------------------------------------------------------------------ [Name] cnc_getpath [Syntax] #include <
  • Page 558Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.100 Read abnormal load torque data. ------------------------------------------------------------------------------ [Name] cnc_loadtorq [Syntax] #include
  • Page 559Fanuc C-Executer Operating Manual B-62443EN-3/03E The load torque data which is converted into digital value is stored in "buf.data" with binary format. The load torque data of the specified axis is stored in "buf.data[0]" in case of reading one axis's data. (1) Servo motor. The value between -7282
  • Page 560Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.101 Set calendar timer of CNC. ------------------------------------------------------------------------------ [Name] cnc_settimer [Syntax] #include
  • Page 561Fanuc C-Executer Operating Manual B-62443EN-3/03E Store the date value or time value in each member of "buf.data.date" or "buf.data.time" with binary format as follows. Member Setting data Range of value -----------------------+---------------+--------------- buf.data.date.year Year 1987 - 2037 buf.
  • Page 562Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.102 Read load information of serial spindle. ------------------------------------------------------------------------------ [Name] cnc_rdspload [Syntax] #in
  • Page 563Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program reads the load information of the 1st spindle and displays the load ratio on the screen. #include #include #include int example( void ) { struct iodbpsd prm ; struct odbspn buf ; int ret
  • Page 564Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.103 Read executing program. ------------------------------------------------------------------------------ [Name] cnc_rdexecprog [Syntax] #include
  • Page 565Fanuc C-Executer Operating Manual B-62443EN-3/03E * Executing NC program. O1234 ; N10 G0 X10. Y20. Z30. ; <-- This function is called when N20 G0 X20. Y30. Z40. ; this block is being executed. N30 G0 X30. Y40. Z50. ; N40 G0 X40. Y50. Z60. ; M30 ; % * String to be read. "N10G0X10.Y20.Z30.\n" "N20G0X2
  • Page 566Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays the executing NC program. #include #include #include #include #define BUFLEN 200 void example( void ) { int ret, blknum ; unsigned int length, idx, lcount, num1, num2 ;
  • Page 567Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.104 Read CNC system configuration information. ------------------------------------------------------------------------------ [Name] cnc_sysconfig [Syntax]
  • Page 568Fanuc C-Executer Operating Manual B-62443EN-3/03E int iopt; /* Number of DI/DO (I/O card). */ int hdiio; /* Existence of the high-speed skip LSI (I/O card). */ int frmsub; /* Memory size of the FROM module (SUB). */ int drmsub; /* Memory size of the DRAM module (SUB). */ int srmsub; /* Memory size o
  • Page 569Fanuc C-Executer Operating Manual B-62443EN-3/03E [Return] 0 Successful. [Description] Read the CNC's system configuration information. The each informations are stored in each members of "odbsysc". slot_no_p Physical slot number. The physical slot numbers of installed modules are stored in installi
  • Page 570Fanuc C-Executer Operating Manual B-62443EN-3/03E s_series Software series. The software series of installed board are stored in installing order with ASCII code format (4-byte + null-char.). s_version Software edition. The software editions of installed board are stored in installing order with ASC
  • Page 571Fanuc C-Executer Operating Manual B-62443EN-3/03E frmmin Memory size of the FROM module (MAIN). -1 : No module 10 : 6 (MB) 0 : Not used. 11 : 8 (MB) 1 : 2 (MB) 12 : 10 (MB) 2 : 4 (MB) 13 : 12 (MB) 3 : 6 (MB) 14 : 14 (MB) 4 : 8 (MB) 15 : 1 (MB) 5 : 10 (MB) 16 : 1 (MB) 6 : 12 (MB) 17 : Not used. 7 : 4
  • Page 572Fanuc C-Executer Operating Manual B-62443EN-3/03E pmcmrc Kind of the PMC module (PMC-RC). -1 : No module. 2 : PMP2+SLC 0 : BOC2 3 : BSI 1 : BSI+SLC 4 : PMP2 dmaarc Existence of the additional board for DMA (PMC-RC). -1 : Not installed. 0 : Installed. iopt Number of DI/DO (I/O card). -1 : No card. 2
  • Page 573Fanuc C-Executer Operating Manual B-62443EN-3/03E gm2gr1 Existence of the graphic engine 2. -1 : Not installed. 0 : Installed. crtgr2 Kind of the CRTC module (OPT-1). -1 : No module. 3 : Not used. 0 : 14" CRT 4 : 14" CRT GRPH 1 : 9" CRT 5 : 9" CRT GRPH 2 : VGA MAIN 6 : VGA GRPH gm1gr2 Existence of t
  • Page 574Fanuc C-Executer Operating Manual B-62443EN-3/03E iopio2 Number of DI/DO (I/O card #2). -1 : No card. 2 : 80/ 56 0 : 144/112 3 : 104/ 72 1 : 40/ 40 4 : 156/120 hdiio2 Existence of the high-speed skip LSI (I/O card #2). -1 : Not installed. 0 : Installed. cmmrb2 Existence of the communication module (
  • Page 575Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.105 Read series and edition of the CNC system softwares. ------------------------------------------------------------------------------ [Name] cnc_rdsyssoft
  • Page 576Fanuc C-Executer Operating Manual B-62443EN-3/03E char int_vga_ser[5]; /* Series of the VGA graphics internal firmware. */ char int_vga_ver[5]; /* Edition of the VGA graphics internal firmware. */ char out_vga_ser[5]; /* Series of the VGA graphics external firmware. */ char out_vga_ver[5]; /* Editio
  • Page 577Fanuc C-Executer Operating Manual B-62443EN-3/03E soft_id Software ID. The software IDs of installed modules are stored in installing order with binary format. This list is terminated by 0xFF. Any data after 0xFF are invalid. The following values are the principal software IDs. 0x40 : CNC 0x49 : CAP
  • Page 578Fanuc C-Executer Operating Manual B-62443EN-3/03E int_vga_ser Series of the VGA graphics internal firmware. int_vga_ver Edition of the VGA graphics internal firmware. out_vga_ser Series of the VGA graphics external firmware. out_vga_ver Edition of the VGA graphics external firmware. reserve_ser (res
  • Page 579Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.106 Read CNC module configuration information. ------------------------------------------------------------------------------ [Name] cnc_rdmdlconfig [Syntax
  • Page 580Fanuc C-Executer Operating Manual B-62443EN-3/03E short hanaxs; /* Existence of the high-speed skip & analog I/O (axis card). */ short romr64; /* Memory size of the system EPROM (64bitRISC). */ short srmr64; /* Memory size of the SRAM module (64bitRISC). */ short dr1r64; /* Memory size of the DRAM m
  • Page 581Fanuc C-Executer Operating Manual B-62443EN-3/03E from Memory size of the FROM module. -1 : No module. 10 : 6 (MB) 0 : Not used. 11 : 8 (MB) 1 : 2 (MB) 12 : 10 (MB) 2 : 4 (MB) 13 : 12 (MB) 3 : 6 (MB) 14 : 14 (MB) 4 : 8 (MB) 15 : 1 (MB) 5 : 10 (MB) 16 : 1 (MB) 6 : 12 (MB) 17 : Not used. 7 : 4 (MB) 18
  • Page 582Fanuc C-Executer Operating Manual B-62443EN-3/03E drmmrc Memory size of the extended DRAM for the system software (PMC-RC). -1 : Not installed. 0 : Installed. drmarc Memory size of the DRAM for the application (PMC-RC). -1 : No module. 2 : 512(KB) 0 : 2(MB) 3 : 1(MB) pmcmrc Kind of the PMC module (P
  • Page 583Fanuc C-Executer Operating Manual B-62443EN-3/03E romr64 Memory size of the system EPROM (64bitRISC). -1 : No module. 3 : 512 (KB) 0 : 4 (MB) 4 : 256 (KB) 1 : 2 (MB) 5 : 128 (KB) 2 : 1 (MB) 6 : 768 (KB) srmr64 Memory size of the SRAM module (64bitRISC). -1 : No module. 3 : 512 (KB) 0 : 4 (MB) 4 : 25
  • Page 584Fanuc C-Executer Operating Manual B-62443EN-3/03E pmcmre Kind of the PMC module (PMC-RE). -1 : No module. 2 : PMP2+SLC 0 : BOC2 3 : BSI 1 : BSI+SLC 4 : PMP2 dmaare Existence of the additional board for DMA (PMC-RE). -1 : Not installed. 0 : Installed. frmbgg Memory size of the extended DRAM for the s
  • Page 585Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays memory size of the installed FROM, DRAM and SRAM modules on the screen. #include #include #include void example( void ) { static int from_mdl[] = { 0,2,4,6,8,10,12,4,3,2,6,8,10,1
  • Page 586Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.107 Read manual handle override amount. ------------------------------------------------------------------------------ [Name] cnc_rdmovrlap [Syntax] #includ
  • Page 587Fanuc C-Executer Operating Manual B-62443EN-3/03E The unit of the manual handle override amount is as follows. data[0][0] - data[0][7] (Input unit) IS-B IS-C -----------------------+---------------+--------------- Linear axis(mm input) 0.001 [mm] 0.0001 [mm] Linear axis(inch input) 0.0001 [inch] 0.0
  • Page 588Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ [Supplement] Return codes of CNC windows ------------------------------------------------------------------------------ The CNC window routines included in the CNC softwar
  • Page 589Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. PMC window library ------------------------------------------------------------------------------ 2.1 Read arbitrary PMC data (range specified). ------------------------------------------------------------------------------ [Name] pmc
  • Page 590Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Reads the PMC data within the specified address range. This function is used for exchanging various data between the C application and the PMC ladder software. Specify the discrimination code corresponding to the PMC address to be read
  • Page 591Fanuc C-Executer Operating Manual B-62443EN-3/03E The referenceable range of PMC data of FANUC Series 16/18 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (A) PMC-RA1/RB Code Kind of PMC address Referenceable range ---------------+-----------------------+-------------------------------- 0
  • Page 592Fanuc C-Executer Operating Manual B-62443EN-3/03E (D) PMC-RB3/RB5/RC3 Code Kind of PMC address Referenceable range ---------------+-----------------------+-------------------------------- 0,'G' G (PMC->CNC) 0000-0255, 1000-1255 1,'F' F (CNC->PMC) 0000-0255, 1000-1255 2,'Y' Y (PMC->Machine) 0000-0127
  • Page 593Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.2 Write arbitrary PMC data (range specified). ------------------------------------------------------------------------------ [Name] pmc_wrpmcrng [Syntax] #i
  • Page 594Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Writes the PMC data within the specified address range. This function is used for exchanging various data between the C application and the PMC ladder software. Specify the discrimination code corresponding to the PMC address to be writ
  • Page 595Fanuc C-Executer Operating Manual B-62443EN-3/03E Example of arguments specification ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (1) Writing 250 to "D0100" (Word type data). buf.type_a 9 or 'D' buf.type_d 1 buf.datano_s 100 buf.datano_e 101 length 8+2*1 (=10) buf.u.idata[0] 250 (2) Writing 0 to every "R0200"
  • Page 596Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.3 Read data from extended keep memory. ------------------------------------------------------------------------------ [Name] pmc_rdkpm [Syntax] #include
  • Page 597Fanuc C-Executer Operating Manual B-62443EN-3/03E } - 596 -
  • Page 598Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.4 Write data to extended keep memory. ------------------------------------------------------------------------------ [Name] pmc_wrkpm [Syntax] #include
  • Page 599Fanuc C-Executer Operating Manual B-62443EN-3/03E } - 598 -
  • Page 600Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.5 Read maximum size of extended keep memory. ------------------------------------------------------------------------------ [Name] pmc_kpmsiz [Syntax] #incl
  • Page 601Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.6 Get pointer to extended keep memory. ------------------------------------------------------------------------------ [Name] pmc_kpmgetptr [Syntax] #include
  • Page 602Fanuc C-Executer Operating Manual B-62443EN-3/03E putchar( '\n' ) ; } - 601 -
  • Page 603Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.7 Read PMC message. ------------------------------------------------------------------------------ [Name] pmc_rdpcmsg [Syntax] #include #include
  • Page 604Fanuc C-Executer Operating Manual B-62443EN-3/03E } - 603 -
  • Page 605Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Super CAP M window library ------------------------------------------------------------------------------ 3.1 Read tool data file. ------------------------------------------------------------------------------ [Name] capm_rdtool [Synt
  • Page 606Fanuc C-Executer Operating Manual B-62443EN-3/03E that the setting value is "void". - 605 -
  • Page 607Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.2 Write tool data file. ------------------------------------------------------------------------------ [Name] capm_wrtool [Syntax] #include #includ
  • Page 608Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.3 Read pre-tool list. ------------------------------------------------------------------------------ [Name] capm_rdpretool [Syntax] #include #inclu
  • Page 609Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.4 Write pre-tool list. ------------------------------------------------------------------------------ [Name] capm_wrpretool [Syntax] #include #incl
  • Page 610Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.5 Read machining condition file. ------------------------------------------------------------------------------ [Name] capm_rdmcncond [Syntax] #include
  • Page 611Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.6 Write machining condition file. ------------------------------------------------------------------------------ [Name] capm_wrmcncond [Syntax] #include
  • Page 612Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.7 Read default data file. ------------------------------------------------------------------------------ [Name] capm_rddef [Syntax] #include #inclu
  • Page 613Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.8 Write default data file. ------------------------------------------------------------------------------ [Name] capm_wrdef [Syntax] #include #incl
  • Page 614Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.9 Terminate back ground editing. ------------------------------------------------------------------------------ [Name] capm_closebge [Syntax] #include
  • Page 615Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. CNC window library for punch-press ------------------------------------------------------------------------------ 4.1 Read punch-press tool data. (by registration number) ---------------------------------------------------------------
  • Page 616Fanuc C-Executer Operating Manual B-62443EN-3/03E (a) Without tool data setting function Kind of data number attr Member Range -------------------------------+-------+-------+-------+----------- Used tool number 0 0 u2data 1 - 136 Turret index number 0 1 u2data 1 - 136 Tool number of origin 0 2 u2da
  • Page 617Fanuc C-Executer Operating Manual B-62443EN-3/03E (b) With tool data setting function Kind of data number attr Member -------------------------------+-------+-------+------------------ Used tool number 0 0 u2data Turret index number 0 1 u2data Tool number of origin 0 2 u2data/u4data (*) Turret movin
  • Page 618Fanuc C-Executer Operating Manual B-62443EN-3/03E o Tool size and angle for graphics Input unit IS-A IS-B ---------------+---------------+--------------- mm 0.01 [mm] 0.001 [mm] inch 0.001 [inch] 0.0001 [inch] deg 0.01 [deg] 0.001 [deg] o Small-tool indexing angle for Multi-tool Input unit IS-A IS-B
  • Page 619Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4.2 Read punch-press tool data. (by tool number) ------------------------------------------------------------------------------ [Name] cnc_rd2punchtl [Syntax]
  • Page 620Fanuc C-Executer Operating Manual B-62443EN-3/03E (a) Without tool data setting function Kind of data number attr Member Range -------------------------------+-------+-------+-------+----------- Tool registration number Nt 0 u2data 0 - 9999 Punch count Nt 1 u4data X-axis tool offset amount Nt 2 s4da
  • Page 621Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays punch count and total punch count of the specified tool by tool number. #include #include #include /*--- Convert 8-byte binary numeric value into numeric string ---*/ void put8b(
  • Page 622Fanuc C-Executer Operating Manual B-62443EN-3/03E else { temp0 -= tbl0 ; temp1 -= tbl1 + 1 ; } if ( temp1 > val[1] ) break ; val[0] = temp0 ; val[1] = temp1 ; digit++ ; lzero = 1 ; } if ( lzero ) *buf++ = '0' + digit ; } if ( !lzero ) *buf++ = '0' ; *buf = '\0' ; } /* tool_no is tool number. */ void
  • Page 623Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4.3 Write punch-press tool data. ------------------------------------------------------------------------------ [Name] cnc_wrpunchtl [Syntax] int cnc_wrpuncht
  • Page 624Fanuc C-Executer Operating Manual B-62443EN-3/03E (a) Without tool data setting function Kind of data number attr Member Range -------------------------------+-------+-------+-------+----------- Used tool number 0 0 u2data 1 - 136 Turret index number 0 1 u2data 1 - 136 Tool number of origin 0 2 u2da
  • Page 625Fanuc C-Executer Operating Manual B-62443EN-3/03E Kind of data number attr Member -------------------------------+-------+-------+------------------ Tool shape for graphics (C) Nr 7 u2data Tool size for graphics (I) Nr 8 u4data Tool size for graphics (J) Nr 9 u4data Tool angle for graphics (K) Nr 10
  • Page 626Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program sets the punch count of the specified tool by registration number as zero. #include #include #include /* tool_no is tool registration number. */ int example( unsigned int tool_no ) { stru
  • Page 627Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.5 MDI operation library ========================= Library outline ~~~~~~~~~~~~~~~ 1. Outline The KEY_BIOS of the C library processes key input from MDI key panel in FS16/18 with C Executor. The application program can
  • Page 628Fanuc C-Executer Operating Manual B-62443EN-3/03E The relationship of the MDI key bit matrix and the MDI key matrix is as follows. MDI key bit Function flag Key code matrix table table ---------------+---------------+------------- 0th byte 0th bit 0th byte 0th word 1st bit 1st byte 1st word : : : 7t
  • Page 629Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Uppercase/Lowercase There is no special key to select uppercase/lowercase of alphabetic character on MDI panel of CNC. Usually, all alphabetic characters are input as uppercase characters. Lowercase characters can be input by the following operat
  • Page 630Fanuc C-Executer Operating Manual B-62443EN-3/03E aux_mdi_control( MDI_LOK_PNL ) Disable key input from the MDI panel. aux_mdi_control( MDI_ULK_PNL ) Enable key input from the MDI panel. Only RESET key is accepted during being inhibited key input from the MDI panel. 4. MDI key control in case that b
  • Page 631Fanuc C-Executer Operating Manual B-62443EN-3/03E MDI operation library of C Library can handle only key information input to C User application. C User application can execute all MDI operation library functions. However, only operations for the key inputting to the user application is effective. I
  • Page 632Fanuc C-Executer Operating Manual B-62443EN-3/03E Lists of Functions ~~~~~~~~~~~~~~~~~~ ---------------------------------------------------------------------- Name Function ---------------------------------------------------------------------- 1. aux_mdi_getmatrix Get MDI key matrix. 2. aux_mdi_putm
  • Page 633Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ 1. Get MDI key matrix. ------------------------------------------------------------------------------ [Name] aux_mdi_get
  • Page 634Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Put MDI key matrix. ------------------------------------------------------------------------------ [Name] aux_mdi_putmatrix [Syntax] #include int
  • Page 635Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3. Reset MDI key matrix. ------------------------------------------------------------------------------ [Name] aux_mdi_rstmatrix [Syntax] #include in
  • Page 636Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4. Alter MDI key matrix. ------------------------------------------------------------------------------ [Name] aux_mdi_altmatrix [Syntax] #include in
  • Page 637Fanuc C-Executer Operating Manual B-62443EN-3/03E Specify updating specification of key in "update". upper byte of "update" <- current code lower byte of "update" <- new code The specified key is set as "invalid key" by specifying "NULL(0x00)" as new code. It is impossible to alter the RESET key. (2
  • Page 638Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 5. Put one character to key input buffer. ------------------------------------------------------------------------------ [Name] aux_mdi_putc [Syntax] #include
  • Page 639Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6. Write block data to key input buffer. ------------------------------------------------------------------------------ [Name] aux_mdi_write [Syntax] #include
  • Page 640Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7. Test or control key input buffer. ------------------------------------------------------------------------------ [Name] aux_mdi_control [Syntax] #include <
  • Page 641Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8. Set key repeating interval time. ------------------------------------------------------------------------------ [Name] aux_mdi_repeat [Syntax] #include
  • Page 642Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9. Read inputting status of MDI key. ------------------------------------------------------------------------------ [Name] aux_mdi_getstat [Syntax] #include <
  • Page 643Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program reads a line of alpha-numeric characters from the MDI panel. Inputting operation is completed by inputting [INPUT] key. It displays one of '_' (in normal state) and '^' as cursor. #include #include #
  • Page 644Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 10. Clear input buffer of MDI key. ------------------------------------------------------------------------------ [Name] aux_mdi_clrbuf [Syntax] #include
  • Page 645Fanuc C-Executer Operating Manual B-62443EN-3/03E Key code table ~~~~~~~~~~~~~~ The following are the key code table of various keyboard which are supported by C Executor. Lines and columns of "Key bit matrix", "Key function flag table" and "Key code table" are correspond each other in every keyboar
  • Page 646Fanuc C-Executer Operating Manual B-62443EN-3/03E 1. Machining system's full key (10-SOFT key type) Key bit matrix bit= 0 1 2 3 4 5 6 7 +------+------+------+------+------+------+------+------+ 0 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +------+------+------+------+------+------+------+------+ 1 | 8 | 9 |
  • Page 647Fanuc C-Executer Operating Manual B-62443EN-3/03E Key function flag table for C application +0 +1 +2 +3 +4 +5 +6 +7 ----+------+------+------+------+------+------+------+------ 00 | 10 10 10 10 10 10 10 10 08 | 10 10 10 10 0F 10 10 10 10 | 0D 10 10 10 10 0B 10 10 18 | 10 10 10 10 10 10 10 09 20 | 10
  • Page 648Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Machining system's full key (5-SOFT key type) Key bit matrix bit= 0 1 2 3 4 5 6 7 +------+------+------+------+------+------+------+------+ 0 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +------+------+------+------+------+------+------+------+ 1 | 8 | 9 | -
  • Page 649Fanuc C-Executer Operating Manual B-62443EN-3/03E Key function flag table for C application +0 +1 +2 +3 +4 +5 +6 +7 ----+------+------+------+------+------+------+------+------ 00 | 10 10 10 10 10 10 10 10 08 | 10 10 10 10 0F 10 10 10 10 | 0D 10 10 10 10 0B 10 10 18 | 10 10 10 10 10 10 10 09 20 | 10
  • Page 650Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Machining system's small key (5-SOFT key type) Key bit matrix bit= 0 1 2 3 4 5 6 7 +------+------+------+------+------+------+------+------+ 0 | 0 * | 1 , | 2 # | 3 = | 4 [ | 5 ] | 6 SP| 7 A | +------+------+------+------+------+------+------+----
  • Page 651Fanuc C-Executer Operating Manual B-62443EN-3/03E Key function flag table for C application +0 +1 +2 +3 +4 +5 +6 +7 ----+------+------+------+------+------+------+------+------ 00 | 10 10 10 10 10 10 10 10 08 | 10 10 10 10 0F 0F 10 10 10 | 0D 10 10 10 10 0B 10 10 18 | 10 10 10 10 10 10 0F 0F 20 | 10
  • Page 652Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. Turning system's full key (10-SOFT key type) Key bit matrix bit= 0 1 2 3 4 5 6 7 +------+------+------+------+------+------+------+------+ 0 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +------+------+------+------+------+------+------+------+ 1 | 8 | 9 | -
  • Page 653Fanuc C-Executer Operating Manual B-62443EN-3/03E Key function flag table for C application +0 +1 +2 +3 +4 +5 +6 +7 ----+------+------+------+------+------+------+------+------ 00 | 10 10 10 10 10 10 10 10 08 | 10 10 10 10 0F 10 10 10 10 | 0D 10 10 10 10 0B 10 10 18 | 10 10 10 10 10 10 10 09 20 | 10
  • Page 654Fanuc C-Executer Operating Manual B-62443EN-3/03E 5. Turning system's full key (5-SOFT key type) Key bit matrix bit= 0 1 2 3 4 5 6 7 +------+------+------+------+------+------+------+------+ 0 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +------+------+------+------+------+------+------+------+ 1 | 8 | 9 | - |
  • Page 655Fanuc C-Executer Operating Manual B-62443EN-3/03E Key function flag table for C application +0 +1 +2 +3 +4 +5 +6 +7 ----+------+------+------+------+------+------+------+------ 00 | 10 10 10 10 10 10 10 10 08 | 10 10 10 10 0F 10 10 10 10 | 0D 10 10 10 10 0B 10 10 18 | 10 10 10 10 10 10 10 09 20 | 10
  • Page 656Fanuc C-Executer Operating Manual B-62443EN-3/03E 6. Turning system's small key (5-SOFT key type) Key bit matrix bit= 0 1 2 3 4 5 6 7 +------+------+------+------+------+------+------+------+ 0 | 0 * | 1 , | 2 # | 3 = | 4 [ | 5 ] | 6 SP| 7 A | +------+------+------+------+------+------+------+------
  • Page 657Fanuc C-Executer Operating Manual B-62443EN-3/03E Key function flag table for C application +0 +1 +2 +3 +4 +5 +6 +7 ----+------+------+------+------+------+------+------+------ 00 | 10 10 10 10 10 10 10 10 08 | 10 10 10 10 0F 0F 10 10 10 | 0D 10 10 10 10 0B 10 10 18 | 10 10 10 10 10 10 0F 0F 20 | 10
  • Page 658Fanuc C-Executer Operating Manual B-62443EN-3/03E 7. Turning system's FAPT key (NOT supported) Key bit matrix bit= 0 1 2 3 4 5 6 7 +------+------+------+------+------+------+------+------+ 0 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +------+------+------+------+------+------+------+------+ 1 | 8 | 9 | , | .
  • Page 659Fanuc C-Executer Operating Manual B-62443EN-3/03E Key function flag table for C application +0 +1 +2 +3 +4 +5 +6 +7 ----+------+------+------+------+------+------+------+------ 00 | 10 10 10 10 10 10 10 10 08 | 10 10 10 10 0F 10 10 10 10 | 0D 10 10 10 10 0B 10 10 18 | 10 10 10 10 10 10 10 09 20 | 10
  • Page 660Fanuc C-Executer Operating Manual B-62443EN-3/03E Extended MDI key reading ~~~~~~~~~~~~~~~~~~~~~~~~ KEY_BIOS of C Executor scans the extended part of MDI key by setting of the CNC parameter No.8650#2 EKY as "1". The user application program can read keys which are assigned in the extended part by se
  • Page 661Fanuc C-Executer Operating Manual B-62443EN-3/03E The application program can read '\' (or '@' in case of "[SHIFT]+") by pushing this key after above setting. The extended key can be read also on the CNC screen by similar setting to the CNC's matrix ( specifying MAIN_MDI_MATRIX). However, the CNC so
  • Page 662Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.6 CRT operation library ========================= Supported display device ~~~~~~~~~~~~~~~~~~~~~~~~ C Executor supports the following display devices. (1) CRTC Display These are the display devices that are equipped wi
  • Page 663Fanuc C-Executer Operating Manual B-62443EN-3/03E for also VGA Display. - 662 -
  • Page 664Fanuc C-Executer Operating Manual B-62443EN-3/03E A. 9-inch type. Character 40-column x 16-line/half-size (20-column x 16-line/ full-size) x 8-color. (40x19-line also available) Dot matrix (HxV): 16x25 dots(half-size). Display device 7.2-inch monochrome LCD, 8.4-inch color LCD, 9-inch monochrome CRT
  • Page 665Fanuc C-Executer Operating Manual B-62443EN-3/03E All display devices have 7 (9-inch type) or 12 (14-inch type) softkeys under its screen. (Touch-panel works like softkeys on "LCD with touch-panel" device. This is equivalent to 12(10+2)-softkey type.) A. 9-inch type. +-----------------------+ | 40-c
  • Page 666Fanuc C-Executer Operating Manual B-62443EN-3/03E Lists of Functions ~~~~~~~~~~~~~~~~~~ 1. CRT operation library -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 1.1 crt_getcurscrn Get
  • Page 667Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.14 win_setfrm Set window frame line character. 2.15 win_getstat Get window display status. -------------------------------------------------------------------------- - 666 -
  • Page 668Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. User definition character library -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 3.1 crt_reguserchar Register user character. 3.2
  • Page 669Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ 1. CRT operation library ------------------------------------------------------------------------------ 1.1 Get current screen index. -----------------------------------------------------------------
  • Page 670Fanuc C-Executer Operating Manual B-62443EN-3/03E (1) Screen index number of FS16-M/T Symbol Index number Screen ---------------+---------------+------------------------------- CRT_POS_ABS 0x0000 ABSOLUTE CRT_POS_REL 0x0100 RELATIVE CRT_POS_ALL 0x0200 ALL CRT_POS_HNDL 0x0300 HANDLE INTERR
  • Page 671Fanuc C-Executer Operating Manual B-62443EN-3/03E (continued) CRT_SYS_OHIS 0x0b03 OPERATION HISTORY CRT_SYS_ALIO 0x0c03 ALL I/O CRT_SYS_NMAP 0x0d03 MAP CRT_SYS_COPR 0x0d03 [i] C-OPER CRT_SYS_DSSET 0x0e03 [i] DATA SERVER SETTING CRT_SYS_DSMNT 0x0f03 [i] DATA SERVER MAINTENANCE CRT_SYS_DSMOD 0x1003 [i
  • Page 672Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) Screen index number of FS16/18-P Symbol Index number Screen ---------------+---------------+------------------------------- CRT_POS_ABS 0x0000 ABSOLUTE CRT_POS_REL 0x0100 RELATIVE CRT_POS_ALL 0x0200 ALL CRT_POS_HNDL 0x0300 HANDLE INTER
  • Page 673Fanuc C-Executer Operating Manual B-62443EN-3/03E (continued) CRT_SYS_TPNL 0x1703 [i] TOUCH PANEL CALIBRATION DISP. CRT_SYS_FSSB 0x1803 [i] FSSB SETTING DISPLAY CRT_SYS_CEXE 0x1903 [i] C Executor CRT_MSG_ALM 0x0004 ALARM CRT_MSG_EMSG 0x0104 EXTERNAL MESSAGE CRT_MSG_AHIS 0x0204 ALARM HISTOR
  • Page 674Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.2 Register user screen index.
    ------------------------------------------------------------------------------ [Name] crt_setuserscrn [Syntax] #include int
  • Page 675Fanuc C-Executer Operating Manual B-62443EN-3/03E This function doesn't check integrity of the screen index numbers to be registered. Re-registration of the user screen index numbers by calling of this function again is allowable. In this case, this function must be called under condition that any s
  • Page 676Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.3 Test screen switching status. ------------------------------------------------------------------------------ [Name] crt_isnewscrn [Syntax] #include
  • Page 677Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.4 Get CRT information. ------------------------------------------------------------------------------ [Name] crt_gettype [Syntax] #include unsigned
  • Page 678Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays information of the current display equipment. #include #include void example( void ) { unsigned int crt ; crt = crt_gettype() ; printf( "Current screen mode is %s on %sinchCRT with%s " "Graph
  • Page 679Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.5 Set CRT screen mode. ------------------------------------------------------------------------------ [Name] crt_setmode [Syntax] #include int crt_s
  • Page 680Fanuc C-Executer Operating Manual B-62443EN-3/03E "Upper blank:n" in VGA Display is, +---------------------------------+ +- | Blank of n lines | | |---------------------------------| | |Start line ^ | -+ | | | | | | | | | | 30 lines | | | | | (19 lines)| | | Display region | | 25 lines | | | | |(16
  • Page 681Fanuc C-Executer Operating Manual B-62443EN-3/03E (continued) CRT_MODE_V30 80x30, color CRT_MODE_V30 + CRT_MODE_MONO 80x30, monochrome (40x19 and 80x30 are not allowed for 9-inch CRT.) * 14 inch VGA CRT_MODE_V25_0 80x25(UB:0), color CRT_MODE_V25_0 + CRT_MODE_MONO 80x25(UB:0), monochrome CRT_MODE_V25
  • Page 682Fanuc C-Executer Operating Manual B-62443EN-3/03E On 80-column x 25-line (or 80 x 30-line) mode of 9 inch CRT, the displayable characters are limited. Only 128 characters whose codes are 0x20-0x5F and 0xA0-0xDF can be displayed. Lowercase characters are converted into uppercase characters on the scr
  • Page 683Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.6 Switch to CNC screen. ------------------------------------------------------------------------------ [Name] crt_cncscrn [Syntax] #include int crt_
  • Page 684Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program changes into "PROGRAM CHECK" screen if the current mode is "MEM". #include #include #include void example( void ) { struct odbst stat ; cnc_statinfo( &stat ) ; if ( stat.aut == 1 ) crt_cncs
  • Page 685Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.7 Output character by FANUC character code.
    ------------------------------------------------------------------------------ [Name] crt_fchar [Syntax] #include
  • Page 686Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.8 Customize softkey on CNC screen.
    ------------------------------------------------------------------------------ [Name] crt_setuserskey [Syntax] #include
  • Page 687Fanuc C-Executer Operating Manual B-62443EN-3/03E Softkey index number is the sequential number for each softkey tables. For example, the following sequential numbers are assigned to the softkeys on the POSITION screen. Key Softkey index number ---------------+--------------------- [ ABS ] 1 [ REL ]
  • Page 688Fanuc C-Executer Operating Manual B-62443EN-3/03E CNC original softkey table ~~~~~~~~~~~~~~~~~~~~~~~~~~ The following list includes the original softkey display items of FS16/18-MB/TB. Softkeys shown in the left side are defined for screen selection in each screens (and each modes). The numbers show
  • Page 689Fanuc C-Executer Operating Manual B-62443EN-3/03E POSITION [ ABS ][ REL ][ ALL ][ HNDL ] [ 00 ][ 01 ][ 02 ][ 03 ] [ MONI ][ ][ ][ ] [ 04 ][ ][ ][ ] OFFSET/SETTING[M] [OFFSET][SETING][ WORK ][CAP-TL] [ 00 ][ 01 ][ 02 ][ -- ] [MACRO ][ MENU ][ OPR ][TOOLLF] [ 03 ][ 04 ][ 05 ][ 06 ] [ CHOP ][MEA-TL][ ]
  • Page 690Fanuc C-Executer Operating Manual B-62443EN-3/03E PROGRAM( TJOG) PROGRAM(THNDL) [PRGRM ][ DIR ][ ][ ] [ 01 ][ 02 ][ ][ ] [ TIME ][DS-DIR][ ][ CEXE ] [ 10 ][ 11 ][ ][ 13 ] PROGRAM(BG-EDT) [PRGRM ][ DIR ][CAP-2 ][C.A.P.] [ 01 ][ 02 ][ -- ][ 08 ] [ ][ ][FLOPPY][ ] [ ][ ][ 07 ][ ] [ TIME ][DS-DIR][ ][ C
  • Page 691Fanuc C-Executer Operating Manual B-62443EN-3/03E PROGRAM( EDIT) [PRGRM ][ LIB ][ ][ ] [ 01 ][ 02 ][ ][ ] [ ][ ][FLOPPY][ ] [ ][ ][ 07 ][ ] PROGRAM( HNDL) PROGRAM( JOG) [PRGRM ][ ][CURRNT][ NEXT ] [ 01 ][ ][ 03 ][ 04 ] [ ][ ][ ][ ] [ ][ ][ ][ ] PROGRAM( TJOG) PROGRAM(THNDL) [PRGRM ][ LIB ][ ][ ] [ 0
  • Page 692Fanuc C-Executer Operating Manual B-62443EN-3/03E PROGRAM( HNDL) PROGRAM( JOG) [PRGRM ][ JOG ][CURRNT][ NEXT ] [ 01 ][ 12 ][ 03 ][ 04 ] [ ][ DIR ][ ][ ] [ ][ 02 ][ ][ ] [ TIME ][DS-DIR][ ][ CEXE ] [ 10 ][ 11 ][ ][ 13 ] PROGRAM( TJOG) PROGRAM(THNDL) [PRGRM ][ DIR ][ ][ ] [ 01 ][ 02 ][ ][ ] [ TIME ][D
  • Page 693Fanuc C-Executer Operating Manual B-62443EN-3/03E How to define display string of the softkey ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The display string of the softkey must be defined by FANUC code when softkey item is customized using this function. (1) Define array of "int" type(or "unsigned i
  • Page 694Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] This is procedure to customize the softkey of POSITION screen as follows. Original [ ABS ][ REL ][ ALL ][ ] After customizing [ USER ][ ABS ][ ][ ] 1. Define a string " USER " by FANUC character code. unsigned int skey_str[] = { 0x0020,0x00
  • Page 695Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.9 Set switching method between CNC's screen and user's. ------------------------------------------------------------------------------ [Name] crt_setswt [Sy
  • Page 696Fanuc C-Executer Operating Manual B-62443EN-3/03E bit5 The automatic graphic beam ON when the screen is switched from the CNC to the user's is 0: not executed. 1: executed. (only when the graphic beam is enabled on the previous user's screen.) (CRT_SWT_GRON) bit6 For VGA Display, the contents of the
  • Page 697Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.10 Set scroll area.
    ------------------------------------------------------------------------------ [Name] crt_setscrlarea [Syntax] #include int crt_setscr
  • Page 698Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.11 Open graphic display.
    ------------------------------------------------------------------------------ [Name] crt_opengr [Syntax] #include int crt_opengr
  • Page 699Fanuc C-Executer Operating Manual B-62443EN-3/03E When screen is switched from the user screen to the CNC screen while displaying application graphics, graphic display to the CRT is disabled (BEAM OFF). However, the graphics drawn by the user application program is retained as is, provided no graphi
  • Page 700Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.12 Close graphic display.
    ------------------------------------------------------------------------------ [Name] crt_closegr [Syntax] #include void crt_clo
  • Page 701Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.13 Enable or disable graphic display. ------------------------------------------------------------------------------ [Name] crt_graphic [Syntax] #include
  • Page 702Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] Following program tests the current screen, and turns the "GRAPHIC BEAM" on if it is POSITION display screen. Turns the "GRAPHIC BEAM" off if else. #include void example( void ) { int scrn ; scrn = crt_getcurscrn() ; if ( ( scrn & 0
  • Page 703Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.14 Read the status of function keys. ------------------------------------------------------------------------------ [Name] crt_readfkey [Syntax] #include
  • Page 704Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] Following is a sample program which, when a function key is pressed, switches the screen to the corresponding CNC screen.(Execute as auxiliary task) #include #include void main( void ) { unsigned int idx, fkey, newscrn, c
  • Page 705Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.15 Display the secondary cursor.
    ------------------------------------------------------------------------------ [Name] crt_2ndcursor [Syntax] #include int
  • Page 706Fanuc C-Executer Operating Manual B-62443EN-3/03E position Specify cursor position. To display cursor on the Mth column of the Nth line, specify as (N-1)*(columns per line)+(M-1). (Both line number and column number starts from "1" which corresponds to the top line and the left-most column. Columns
  • Page 707Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.16 Set accessing method to Super CAP M. ------------------------------------------------------------------------------ [Name] crt_capmaccess [Syntax] #inclu
  • Page 708Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.17 Switch to Super CAP M screen. ------------------------------------------------------------------------------ [Name] crt_capmscrn [Syntax] #include
  • Page 709Fanuc C-Executer Operating Manual B-62443EN-3/03E Specify one of the following for the "mode". CRT_CAPM_FORE foreground editing mode CRT_CAPM_BACK background editing mode CRT_CAPM_EXIT exit from Super CAP M screens Select "CRT_CAPM_FORE" or "CRT_CAPM_BACK" for the "mode", depending on what to do on
  • Page 710Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.18 Set attribute of characters on VRAM.
    ------------------------------------------------------------------------------ [Name] crt_settextattr [Syntax] #include
  • Page 711Fanuc C-Executer Operating Manual B-62443EN-3/03E +-----------------------------------+ |(1,1) Whole screen| | | | +-------------------+ | | |(y1,x1) | | | | | | | | | | | | (y2,x2)| | | +-------------------+ | | Attribute setting region | | | | (ymax,xmax)| +-----------------------------------+ 9-i
  • Page 712Fanuc C-Executer Operating Manual B-62443EN-3/03E (Note) The attributes mentioned here are for the current display device o FS16/18 (CRTC-II). Any attribute bits will be added for the VGA display device in the future. (Note) The attributes mentioned above are for the current display device of FS16/1
  • Page 713Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.19 Get attribute of character on VRAM.
    ------------------------------------------------------------------------------ [Name] crt_gettextattr [Syntax] #include
  • Page 714Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.20 Set color palette of VGA characters.
    ------------------------------------------------------------------------------ [Name] crt_setpalette [Syntax] #include
  • Page 715Fanuc C-Executer Operating Manual B-62443EN-3/03E Palette ESC sequence index Color value Displayed color Char Back -------+---------------+---------------+-------------------- 0 0x00000000 Black 30 40 1 0x0000003F Red 31 41 2 0x00003F00 Green 32 42 3 0x00003F3F Yellow 33 43 4 0x003F0000 Blue 34 44 5
  • Page 716Fanuc C-Executer Operating Manual B-62443EN-3/03E The color values set by the C application program are effective to only the C user screen. The other screens such as the CNC's screen are not affected by this setting. Similarly, the color setting in the other screens are not effective to the C user
  • Page 717Fanuc C-Executer Operating Manual B-62443EN-3/03E It is possible to specify "Normal" or "Reverse" display for the monochrome LCD by specifying "_PAL_RVS" in "index". In this case, specify "Normal"/"Reverse" in "color". color Setting Display(Standard) ---------------+-----------------------+---------
  • Page 718Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.21 Set all color palette of VGA characters.
    ------------------------------------------------------------------------------ [Name] crt_setallpalette [Syntax] #incl
  • Page 719Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.22 Get color palette of CNC screen.
    ------------------------------------------------------------------------------ [Name] crt_getcncpalette [Syntax] #include
  • Page 720Fanuc C-Executer Operating Manual B-62443EN-3/03E This function doesn't exchange the color palette index when it copies color palette value. Take care of palette index handling when VGA window screen is overlapped on any CNC screen by the window task. The color palette index for character of the CNC
  • Page 721Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Multiple window display library ------------------------------------------------------------------------------ 2.1 Open window.
    ------------------------------------------------------------------------------ [Name] win_open [Syntax] #include
  • Page 722Fanuc C-Executer Operating Manual B-62443EN-3/03E Values set for each member of the structure "spec" are as follows.. posl line number of the upper left corner of the window ( >=2) (top line of the screen being "1") posc column number of the upper left corner of the window ( >=2) (left-most column o
  • Page 723Fanuc C-Executer Operating Manual B-62443EN-3/03E WIN_F_FRM2 Frame line style: White space (When using this mode, specify reverse attribute for frame color by win_col() function.) WIN_F_FRM3 Frame line style: User defined line (define line style by win_setfrm() function) WIN_F_NOFRM Frame-less windo
  • Page 724Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.2 Close window.
    ------------------------------------------------------------------------------ [Name] win_close [Syntax] #include int win_close( void ) ;
  • Page 725Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.3 Select window.
    ------------------------------------------------------------------------------ [Name] win_select [Syntax] #include int win_select( whandl
  • Page 726Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.4 Activate window.
    ------------------------------------------------------------------------------ [Name] win_activate [Syntax] #include int win_activate(
  • Page 727Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.5 Move window.
    ------------------------------------------------------------------------------ [Name] win_move [Syntax] #include int win_move( int dy, int
  • Page 728Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.6 Alter window size.
    ------------------------------------------------------------------------------ [Name] win_size [Syntax] #include int win_size( int dy
  • Page 729Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.7 Let active window be full screen size.
    ------------------------------------------------------------------------------ [Name] win_full [Syntax] #include
  • Page 730Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.8 Let active window be window size.
    ------------------------------------------------------------------------------ [Name] win_window [Syntax] #include int
  • Page 731Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.9 Get window information.
    ------------------------------------------------------------------------------ [Name] win_info [Syntax] #include int win_info( w
  • Page 732Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.10 Set color of window frame and title string.
    ------------------------------------------------------------------------------ [Name] win_col [Syntax] #include
  • Page 733Fanuc C-Executer Operating Manual B-62443EN-3/03E (Note) The attributes mentioned above are for the current display device of FS16/18 (CRTC-II). For VGA display device, the following attributes are added. 15 8 7 0 +------------------------+------------------------+ | 0 0 0 Ib Bb Gb Rb I | B G R r b
  • Page 734Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.11 Hide window.
    ------------------------------------------------------------------------------ [Name] win_hide [Syntax] #include int win_hide( whandle han
  • Page 735Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.12 Show window.
    ------------------------------------------------------------------------------ [Name] win_show [Syntax] #include int win_show( whandle han
  • Page 736Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.13 Set window title string.
    ------------------------------------------------------------------------------ [Name] win_setttl [Syntax] #include int win_set
  • Page 737Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.14 Set window frame line character.
    ------------------------------------------------------------------------------ [Name] win_setfrm [Syntax] #include voi
  • Page 738Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.15 Get window display status.
    ------------------------------------------------------------------------------ [Name] win_getstat [Syntax] #include void win
  • Page 739Fanuc C-Executer Operating Manual B-62443EN-3/03E For example, three windows are opened now as below. This function returns the following result. +[1]-------------+ |Selected | +[2]---| | | | | | | +[3]-------------+ | | |Active | | +------| | | | | | | | +-------------| | +----------------+ stat.se
  • Page 740Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. User defined character library 3-1. scope User defined character is a character which is defined by machine tool builders. (usually referred to as extended character) C Executor allows the user application program to define and use extended charac
  • Page 741Fanuc C-Executer Operating Manual B-62443EN-3/03E * Binary notation Horizontally aligned 8 bits(dots) are represented by one byte data. Single byte character 2-byte character bit order-> #7 #0 #7 #0 #7 #0 +----------+ +-------------------+ | byte 1 | | byte 1 | byte 17 | | | | | | | | | | | | | | |
  • Page 742Fanuc C-Executer Operating Manual B-62443EN-3/03E - 2-byte character ("KAN" of Japanese KANJI character) pattern ................ .......#...#.... .##..#########.. ...#...#...#.... ......#######... .##...#..#..#... ...#..#######... .........#...... ...#..#######... ...#.....#...... ...#.#########..
  • Page 743Fanuc C-Executer Operating Manual B-62443EN-3/03E * Binary notation Horizontally aligned 8 bits(dots) are represented by one byte data. single byte character 2-byte character bit order-> #7 #0 #7 #0 #7 #0 #7 #0 #7 #0 #7 #0 +-------------+ +-----------------------+ | 1 | 26 | | 1 | 26 | 51 | 76 | | |
  • Page 744Fanuc C-Executer Operating Manual B-62443EN-3/03E - 2-byte character ("KAN" of Japanese KANJI character) pattern .......##.....###.###........... ........##.....##..##...##...... ........##.################..... ...............##..##........... ...............##..##........... ..........#.#.........
  • Page 745Fanuc C-Executer Operating Manual B-62443EN-3/03E 3-3. Character code (1) FANUC code Character codes from 0x4100 to 0x41FF in FANUC code set are reserved for user defined characters and automatically assigned to the user defined character in the order of its registration. In case of 2-byte character
  • Page 746Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) Binary notation of the user defined character After making dot patterns for all user defined characters, describe them in binary notation and store in an unsigned character string. (Example) unsigned char char_pattern[] = { 0x00, 0x03, .... } ; W
  • Page 747Fanuc C-Executer Operating Manual B-62443EN-3/03E (Example) printf( "\x93\xC8\x96\xD8" ) ; (This is Japanese string "TOCHI-GI".) If the dot pattern of the character "TOCHI" is registered as an user defined character and the code 0x93C8, which is the shift JIS code for the standard JIS character "TOC
  • Page 748Fanuc C-Executer Operating Manual B-62443EN-3/03E Function reference ~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ 3.1 Register user character.
    ------------------------------------------------------------------------------ [Name] crt_reguser
  • Page 749Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.2 Map user character.
    ------------------------------------------------------------------------------ [Name] crt_mapuch [Syntax] #include int crt_mapuch( u
  • Page 750Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3.3 Get CG pattern.
    ------------------------------------------------------------------------------ [Name] crt_getcgpttn [Syntax] #include int crt_getcgpttn(
  • Page 751Fanuc C-Executer Operating Manual B-62443EN-3/03E 3-6. Sample application program (for 14inch CRT) #define UCH_NUM 10 /* number of defined characters( single byte equivalent) */ /* Character pattern */ unsigned char pattern[ UCH_NUM * CHAR_SIZE_14 ] = { 0x00,0x3F,0x02,0x02,0x02,0x3F,0x22,0x22, /* 0x
  • Page 752Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. VGA window display library Outline of VGA window display ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "VGA window" is an overlapping window provided by VGA display device. This VGA window has the following features. * Overlapping on any arbitrary screen such as
  • Page 753Fanuc C-Executer Operating Manual B-62443EN-3/03E VGA window has the following restrictions. * Color palettes are common with the base screen. So, if any color palette is changed in the base screen or the VGA window, the corresponding color palette of the other screen is changed. * The control of gr
  • Page 754Fanuc C-Executer Operating Manual B-62443EN-3/03E displays. - 753 -
  • Page 755Fanuc C-Executer Operating Manual B-62443EN-3/03E Don't execute both character and graphics output before calling "vwin_open()" function and after calling "vwin_close()" function. Color palettes are common with the base screen. Changing color palette in the VGA window makes changing the same color p
  • Page 756Fanuc C-Executer Operating Manual B-62443EN-3/03E How to operate VGA window ~~~~~~~~~~~~~~~~~~~~~~~~~ (1) How to resize VGA window. It is impossible to resize the opened VGA window. Close the VGA window by "vwin_close()" function first, then open with new size specification again. (Redrawing is requ
  • Page 757Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ 4.1 Open VGA window. ------------------------------------------------------------------------------ [Name] vwin_open [Synt
  • Page 758Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4.2 Close VGA window. ------------------------------------------------------------------------------ [Name] vwin_close [Syntax] #include int vwin_close(
  • Page 759Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4.3 Select VGA window. ------------------------------------------------------------------------------ [Name] vwin_select [Syntax] #include int vwin_sele
  • Page 760Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4.4 Show VGA window. ------------------------------------------------------------------------------ [Name] vwin_show [Syntax] #include int vwin_show( un
  • Page 761Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4.5 Hide VGA window. ------------------------------------------------------------------------------ [Name] vwin_hide [Syntax] #include int vwin_hide( un
  • Page 762Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4.6 Get VGA window information. ------------------------------------------------------------------------------ [Name] vwin_info [Syntax] #include int vw
  • Page 763Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.7 File Operation Library ========================== Using Memory Card ~~~~~~~~~~~~~~~~~ The application program can access a memory card which is inserted in the card slot equipped on the CRT/MDI panel of FS16i/18i as
  • Page 764Fanuc C-Executer Operating Manual B-62443EN-3/03E [Note] * The drive name to aceess a memory card is "B:". It is fixed. * The C application program can't access the memory card while the other software (CNC software, etc.) is accessing it. * The C application program may fail to access the memory ca
  • Page 765Fanuc C-Executer Operating Manual B-62443EN-3/03E Lists of Functions ~~~~~~~~~~~~~~~~~~ -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 1. aux_file_format Format specified drive 2. aux
  • Page 766Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Mount memory card. ------------------------------------------------------------------------------ [Name] aux_file_mount [Syntax] #include
  • Page 767Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program reads character by character from "TESTFILE.DAT" in the memory card and writes them to the stdout. #include #include int example( void ) { FILE *fp ; signed char ch ; int ret ; unsigned int stat ;
  • Page 768Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3. Unmount memory card. ------------------------------------------------------------------------------ [Name] aux_file_unmount [Syntax] #include
  • Page 769Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4. Get memory card information. ------------------------------------------------------------------------------ [Name] aux_file_memcinfo [Syntax] #include
  • Page 770Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.8 Serial Library ================== Library outline ~~~~~~~~~~~~~ 1. Outline Serial Library is a set of general functions which are used to send/receive data to/from devices via RS-232C communication interface. Charact
  • Page 771Fanuc C-Executer Operating Manual B-62443EN-3/03E [3] Authorization to access communication channel Each communication channels have authorization control mechanism independent of each other. Application program has to get authorization to use a channel by calling rs_open() function, before using th
  • Page 772Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) Receiving handshake DC code is used to request the source device to stop or restart sending data according to the state of receiving buffer. Send DC1 : request to restart sending data Send DC3 : request to stop sending data These DC1 or DC3 codes
  • Page 773Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Interface [1] Connection CNC Serial device ----------+ +------------ | | SD ------------------------------------------------> RD RD <------------------------------------------------ SD | | RS ------------------------------------------------> CS CS
  • Page 774Fanuc C-Executer Operating Manual B-62443EN-3/03E [2] Signal state Only difference between "hardware flow ctrl" and "no hardware flow ctrl" is that signals CS and DR are deemed always ON if "no hardware flow ctrl" is selected. (1) After channel is open hardware flow ctrl no hardware flow ctrl ------
  • Page 775Fanuc C-Executer Operating Manual B-62443EN-3/03E (4) After channel is closed hardware flow ctrl no hardware flow ctrl -------+-----------------------+--------------------- SD RD RS OFF <- CS ER OFF <- DR CD List of functions ~~~~~~~~~~~~~~~~~ --------------------------------------------------------
  • Page 776Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ 1. Initialize communication channel ------------------------------------------------------------------------------
  • Page 777Fanuc C-Executer Operating Manual B-62443EN-3/03E Specify communication conditions in the structure "param". param->baud baud rate -----------------------+------------------------ BAUD_0600 600 bits/sec BAUD_1200 1200 bits/sec BAUD_2400 2400 bits/sec BAUD_4800 4800 bits/sec BAUD_9600 9600 bits/sec p
  • Page 778Fanuc C-Executer Operating Manual B-62443EN-3/03E param->dc1_code define DC1 code (usually 0x11 ) param->dc2_code define DC2 code (usually 0x12 ) param->dc3_code define DC3 code (usually 0x13; to be compatible with CNC, 0x93 ) param->dc4_code define DC4 code (usually 0x14 ) Specify open mode of the
  • Page 779Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Close communication channel ------------------------------------------------------------------------------ [Name] rs_close [Syntax] #include
  • Page 780Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3. Get one byte data from receive buffer ------------------------------------------------------------------------------ [Name] rs_getc [Syntax] #include
  • Page 781Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4. Put one byte data into transmit buffer ------------------------------------------------------------------------------ [Name] rs_putc [Syntax] #include
  • Page 782Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 5. Get block of data from receive buffer ------------------------------------------------------------------------------ [Name] rs_read [Syntax] #include
  • Page 783Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6. Put block of data into transmit buffer ------------------------------------------------------------------------------ [Name] rs_write [Syntax] #includ
  • Page 784Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7. Test or clear transmit/receive buffer ------------------------------------------------------------------------------ [Name] rs_buffer [Syntax] #includ
  • Page 785Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8. Get status of communication buffer and interface ------------------------------------------------------------------------------ [Name] rs_status [Synt
  • Page 786Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9. Wait for communication interface event ------------------------------------------------------------------------------ [Name] rs_wait [Syntax] #include
  • Page 787Fanuc C-Executer Operating Manual B-62443EN-3/03E mode param ---------------+------------------------------------------ rtx_size number of data characters in the receive buffer trx_size number of data characters in the transmit buffer rtx_code character code The maximum wait time is specified by the
  • Page 788Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Wait for specified character ret = rs_wait( channel, param, rtx_code, time_out ) ; This function call waits for the character specified by "param" to arrive. This function is used for the case to know the arrival of the data packet which ends wit
  • Page 789Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 10. Select DMA transmission channel. ------------------------------------------------------------------------------ [Name] rs_dma [Syntax] #include
  • Page 790Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.9 Task management library =========================== Library outline ~~~~~~~~~~~~~~~ Following functions are provided to control execution of the application programs or to manage execution of multiple tasks. 1. Time
  • Page 791Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Synchronization of tasks (semaphore management) The semaphore is used to synchronize or arbitrate execution of tasks. The semaphore consists of semaphore counter and semaphore queue. Suspended tasks which are waiting for the semaphore to be signal
  • Page 792Fanuc C-Executer Operating Manual B-62443EN-3/03E Waiting for signal ~~~~~~~~~~~~~~~~~~ * os_wait_sem() decrements the semaphore counter, and suspends the execution of the calling task if the value of the semaphore counter is negative. sem-- ==> decrement semaphore counter if( sem < 0 ) ==> if negat
  • Page 793Fanuc C-Executer Operating Manual B-62443EN-3/03E [ Example of task arbitration ] As an example, here it is assumed that there are three sets of resources which are shared between five tasks. The following example shows a method to manage assignment of these resources among tasks. (Note) The maximum
  • Page 794Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example of task synchronization] This is a sample case that a task is waiting for another task to complete, and assumes that TASK-A waits for TASK-B and TASK-B waits for TASK-C. This task synchronization can be achieved by using two semaphores. * Pr
  • Page 795Fanuc C-Executer Operating Manual B-62443EN-3/03E [ Example of inter task communication ] A method of sending or receiving data between tasks by means of ring buffer ( or circulating buffer) is considered in the following example. Assume that the TASK-A writes a data into the buffer and the TASK-B r
  • Page 796Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Synchronizing tasks ( Event flag) Event flag is used to synchronize execution of tasks. The event flags relating to the specific operation are grouped and it forms an event group. (For example, consider a case that a task detects a signal and noti
  • Page 797Fanuc C-Executer Operating Manual B-62443EN-3/03E Following functions are used for event flag management. Name Function ---------------+---------------------------------------------- os_make_flg create event flag os_delt_flg delete event flag os_sign_flg signal event flag ( modal type) os_puls_flg s
  • Page 798Fanuc C-Executer Operating Manual B-62443EN-3/03E Operation ~~~~~~~~~ if( wait message & image == 0 ) Wait ==> wait until "wait massage" is satisfied image wait message 0..0000XXX 0..0000111 | | +-------> AND <-------+ | | !=0 0..0XXX -----> NO wait | | ==0 V wait for signal (b) AND wait The executi
  • Page 799Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Signaling the event flag Functions os_sign_flg() or os_puls_flg() signals the event flag. For example, to signal the event flag 1,2 and 3 to become ON, specify 0x00000007 for the parameter of os_sign_flg(). (This parameter is referred to as "sign
  • Page 800Fanuc C-Executer Operating Manual B-62443EN-3/03E (b) Signaling the "AND waiting" task operation ~~~~~~~~~ wait message = ~signal message & wait message if( wait message == 0 ) Ready ===> waked signal message wait message 0..0000XXX 0..0000111 NOT | | 1..1111XXX -> AND <------+ | | ==0 0..0XXX -----
  • Page 801Fanuc C-Executer Operating Manual B-62443EN-3/03E [Transition of flags to be waited and event flag image by signals] Following example explains the state transition of the flags to be waited and the event flag image when they are signaled by modal type and pulse type signaling functions. Parameter f
  • Page 802Fanuc C-Executer Operating Manual B-62443EN-3/03E Lists of Functions ~~~~~~~~~~~~~~~~~~ -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 1. os_show_tim read timer 2. os_set_tim set time
  • Page 803Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ 1. Read timer ------------------------------------------------------------------------------ [Name] os_show_tim [Sy
  • Page 804Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Set timer ------------------------------------------------------------------------------ [Name] os_set_tim [Syntax] #include void os_set_ti
  • Page 805Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3. Suspend execution of task until specified time of timer ------------------------------------------------------------------------------ [Name] os_sync_
  • Page 806Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4. Suspend execution of task for specified time period ------------------------------------------------------------------------------ [Name] os_wait_tim
  • Page 807Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 5. Create event flag ------------------------------------------------------------------------------ [Name] os_make_flg [Syntax] #include unsig
  • Page 808Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6. Delete event flag ------------------------------------------------------------------------------ [Name] os_delt_flg [Syntax] #include unsig
  • Page 809Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7. Signal event flag ------------------------------------------------------------------------------ [Name] os_sign_flg [Syntax] #include unsig
  • Page 810Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8. Wait for being signaled ------------------------------------------------------------------------------ [Name] os_wait_flg [Syntax] #include
  • Page 811Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9. Clear event flag ------------------------------------------------------------------------------ [Name] os_clar_flg [Syntax] #include unsign
  • Page 812Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 10. Signal event flag (pulse type) ------------------------------------------------------------------------------ [Name] os_puls_flg [Syntax] #include
  • Page 813Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 11. Create semaphore ------------------------------------------------------------------------------ [Name] os_make_sem [Syntax] #include unsig
  • Page 814Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 12. Delete semaphore ------------------------------------------------------------------------------ [Name] os_delt_sem [Syntax] #include unsig
  • Page 815Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 13. Signal semaphore ------------------------------------------------------------------------------ [Name] os_sign_sem [Syntax] #include unsig
  • Page 816Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 14. Wait until semaphore is signaled ------------------------------------------------------------------------------ [Name] os_wait_sem [Syntax] #include
  • Page 817Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 15. set CPU time for user task and CNC task ------------------------------------------------------------------------------ [Name] os_chng_duty [Syntax] #
  • Page 818Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] Time to down load a part program of 18 bytes x 200 blocks by using cnc_cdownload() function. setting down load time [sec] -----------------------+-------------- os_chng_duty( 4, 1 ) 28.8 os_chng_duty( 3, 1 ) 23.0 os_chng_duty( 2, 1 ) 17.4 o
  • Page 819Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 16. Allocate new memory block ------------------------------------------------------------------------------ [Name] os_new_mem [Syntax] #include
  • Page 820Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 17. Deallocate memory block ------------------------------------------------------------------------------ [Name] os_disp_mem [Syntax] #include
  • Page 821Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 18. Start window task
    ------------------------------------------------------------------------------ [Name] os_strt_wtsk [Syntax] #include unsigned short
  • Page 822Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 19. Change CPU time of window task ------------------------------------------------------------------------------ [Name] os_chng_wdty [Syntax] #include
  • Page 823Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.10 FCA Library ================ Library outline ~~~~~~~~~~~~~~~ 1. Outline FCA(FANUC CASSETTE ADAPTOR) Library is a library of functions which are used to send or receive data between CNC and FANUC's peripheral devices
  • Page 824Fanuc C-Executer Operating Manual B-62443EN-3/03E [3] How it works +-----------------------------------------+ | | | Application | | | +-------------------+---------------------+ | +-------------------+---------------------+ | | | FCA Library | | | +-------------------+---------------------+ | +----
  • Page 825Fanuc C-Executer Operating Manual B-62443EN-3/03E +----------------+ +------------------+ | | | +--------------+ | | | | | | | | -----fca_setparam()------> | | | | | | FCA mode | | | <-------fca_bye()--------- | | | | | | | | | Idle state | | +--------------+ | | | | | | --------rs_open()--------> |
  • Page 826Fanuc C-Executer Operating Manual B-62443EN-3/03E List of Functions ~~~~~~~~~~~~~~~~~ -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 1. fca_setparam Initialize communication line. 2.
  • Page 827Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ 1. Initialize communication line. ------------------------------------------------------------------------------ [N
  • Page 828Fanuc C-Executer Operating Manual B-62443EN-3/03E While in FCA mode, other FCA Library Functions, fca_xxx(), can be called. If they are called prior to the fca_setparam() function, the operation of those functions are not guaranteed. By calling fca_bye(), the serial port is returned to the idle stat
  • Page 829Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Close communication line. ------------------------------------------------------------------------------ [Name] fca_bye [Syntax] #include int
  • Page 830Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3. Open a binary file on FCA device. ------------------------------------------------------------------------------ [Name] fca_open [Syntax] #include
  • Page 831Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4. Close a binary file. ------------------------------------------------------------------------------ [Name] fca_close [Syntax] #include int fc
  • Page 832Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 5. Read binary data from the file. ------------------------------------------------------------------------------ [Name] fca_read [Syntax] #include
  • Page 833Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] Following sample program displays the specified file in the FCA device connected to the first channel in binary dump format. #include #include #include #include #define BUFSIZE 256 int example( void ) { s
  • Page 834Fanuc C-Executer Operating Manual B-62443EN-3/03E for( i = 0 ; i < ret ; i++ ) { c = buffer[ i ] ; c &= 0x00ff ; printf( "%02X", c ) ; count++ ; } if ( ret < bytes ) { printf( "\n" ) ; printf( "ret = %d\n", ret ) ; printf( "bytes = %d\n", bytes ) ; printf( "ret < bytes\n", ret ) ; break ; } } printf
  • Page 835Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6. Write binary data to the file. ------------------------------------------------------------------------------ [Name] fca_write [Syntax] #include
  • Page 836Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] Following sample program writes the NC part program of specified program number into the device connected to the first channel as a file with specified name. #include #include #include #include #define BU
  • Page 837Fanuc C-Executer Operating Manual B-62443EN-3/03E for (;;) { number = BUFSIZE - 1 ; ret = cnc_upload( (struct odbup *)(&buf), &number ) ; if ( ret ) { printf( "error in cnc_upload\n" ) ; cnc_upend() ; fca_close() ; fca_bye( 1 ) ; return ( ret ) ; } ret = fca_write( &buf[4], number ) ; if ( ret == -1
  • Page 838Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7. Open a text file on FCA device. ------------------------------------------------------------------------------ [Name] fca_fopen [Syntax] #include
  • Page 839Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8. Close a text device. ------------------------------------------------------------------------------ [Name] fca_fclose [Syntax] #include int f
  • Page 840Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9. Read a character from the text file. ------------------------------------------------------------------------------ [Name] fca_getc [Syntax] #include
  • Page 841Fanuc C-Executer Operating Manual B-62443EN-3/03E #include #include #include #include int example( void ) { ser_t r_para ; int ret ; char name[ 18 ], mode = 'r', c ; r_para.baud = BAUD_4800 ; r_para.stop_bit = STOP_2 ; r_para.parity = PARITY_N ; r_para.data_bit =
  • Page 842Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 10. Write a character to the text file. ------------------------------------------------------------------------------ [Name] fca_putc [Syntax] #include
  • Page 843Fanuc C-Executer Operating Manual B-62443EN-3/03E scanf( "%d", &o_num ) ; ret = fca_fopen( name, &mode ) ; if ( ret ) { printf( "error in fca_fopen\n" ) ; fca_bye( 1 ) ; return ( ret ) ; } ret = cnc_upstart( o_num ) ; if ( ret ) { printf( "error in cnc_upstart\n" ) ; fca_fclose() ; fca_bye( 1 ) ; re
  • Page 844Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 11. Delete a file on FCA device. ------------------------------------------------------------------------------ [Name] fca_delete [Syntax] #include
  • Page 845Fanuc C-Executer Operating Manual B-62443EN-3/03E r_para.baud = BAUD_4800 ; r_para.stop_bit = STOP_2 ; r_para.parity = PARITY_N ; r_para.data_bit = DATA_8 ; r_para.hardflow = 2 ; r_para.dc_enable = 3 ; r_para.dc_put = 0 ; r_para.dc1_code = 0x11 ; r_para.dc2_code = 0x12 ; r_para.dc3_code = 0x93 ; r_p
  • Page 846Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 12. Change name of a file on FCA device. ------------------------------------------------------------------------------ [Name] fca_rename [Syntax] #inclu
  • Page 847Fanuc C-Executer Operating Manual B-62443EN-3/03E ret = fca_setparam( 1, &r_para ) ; if ( ret ) { printf( "error in fca_setparam\n" ) ; return ( ret ) ; } printf( "old name?(max 17 )\n" ) ; ret = scanf( "%s", &oldname ) ; printf( "new name?(max 17 )\n" ) ; ret = scanf( "%s", &newname ) ; ret = fca_r
  • Page 848Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 13. Read directory information of FCA device. ------------------------------------------------------------------------------ [Name] fca_readdir [Syntax]
  • Page 849Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) The number of directory information from the "ndir"th file to the last file is given as the return value. Allocate memory area sufficient to store above directory information and specify the pointer to this memory area as the argument "buffer". (
  • Page 850Fanuc C-Executer Operating Manual B-62443EN-3/03E for ( i = 0 ; i < n ; i++ ) { ret = fca_readdir( &buf[0], i + 1, 1 ) ; if ( ret == -1 ) { printf( "error in fca_readdir 2\n" ) ; fca_bye( 1 ) ; return ( ret ) ; } else{ printf( " %02d %-17s %-8s %c %c %-2s %c\n" , i+1 , buf[0].file_name , buf[0].file
  • Page 851Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 14. Read status information of FCA device. ------------------------------------------------------------------------------ [Name] fca_status [Syntax] #inc
  • Page 852Fanuc C-Executer Operating Manual B-62443EN-3/03E (Note) It can happen that "ERROR CODE" does not indicate correct error code. ERROR CODE TABLE ERROR CODE CAUSE ---------------+----------------------------------- 00000(= 0) no error 00001(= 1) file search error 00010(= 2) (not used) 00011(= 3) (not
  • Page 853Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 15. Read free space size of a floppy disk. ------------------------------------------------------------------------------ [Name] fca_remains [Syntax] #in
  • Page 854Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] Following sample program reads and displays the amount of remaining free Tsapce in the Floppy Disk connected to the first channel. #include #include #include #include int example( void ) { int ret ; ser_t
  • Page 855Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.11 F-ROM Library ================== Library outline ~~~~~~~~~~~~~~~ Included in the F-ROM Library are the functions which are used to read the data files for the C Executor that are stored in the Flush ROM Module for F
  • Page 856Fanuc C-Executer Operating Manual B-62443EN-3/03E A C Executor application program is compiled and converted to the memory card format file by executing "omf2mem.com". Then, Data files are combined to the C Executor program file by executing "dat2mem.com". When power is applied to the CNC, only prog
  • Page 857Fanuc C-Executer Operating Manual B-62443EN-3/03E List of functions ~~~~~~~~~~~~~~~~~ -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 1. aux_from_open Open the specified F-ROM file. 2.
  • Page 858Fanuc C-Executer Operating Manual B-62443EN-3/03E Function reference ~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ 1. Open the specified F-ROM file. ------------------------------------------------------------------------------ [N
  • Page 859Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Close the F-ROM file. ------------------------------------------------------------------------------ [Name] aux_from_close [Syntax] #include
  • Page 860Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3. Select data in the F-ROM file. ------------------------------------------------------------------------------ [Name] aux_from_select [Syntax] #include
  • Page 861Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4. Move read pointer. ------------------------------------------------------------------------------ [Name] aux_from_moveptr [Syntax] #include i
  • Page 862Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 5. Read data from the F-ROM file. ------------------------------------------------------------------------------ [Name] aux_from_read [Syntax] #include <
  • Page 863Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6. Read directory information of a F-ROM file. ------------------------------------------------------------------------------ [Name] aux_from_getdir [Syn
  • Page 864Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7. Read F-ROM file information. ------------------------------------------------------------------------------ [Name] aux_from_getinfo [Syntax] #include
  • Page 865Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8. Read a character from the F-ROM file. ------------------------------------------------------------------------------ [Name] aux_from_getc [Syntax] #in
  • Page 866Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9. Read a line from the F-ROM file. ------------------------------------------------------------------------------ [Name] aux_from_gets [Syntax] #include
  • Page 867Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example 1] /* Select a file, TEST02.DAT, read and display 10 bytes of data from the beginning of the file. Then move read pointer 50 bytes ahead of current position, and read and display 50 bytes of data. Used functions : aux_from_open , aux_from_cl
  • Page 868Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example 2] /* Open F-ROM file of combined C Executor program file and C Executor data file and display directory list. Used functions : aux_from_open , aux_from_close , aux_from_getdir */ void sample2() { int dir_num, ret , i ; typedef infodir *dira
  • Page 869Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example 3] /* Get information of F-ROM file CEX 1.0M, and display. Used function : aux_from_getinfo */ void sample3() { int file_type ; printf( "Showing F-ROM file information\n" ) ; file_type = aux_from_getinfo( "CEX 1.0M" ) ; switch ( file_type )
  • Page 870Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 3.12 Touch-panel library ======================== Overview of library ~~~~~~~~~~~~~~~~~~~ 1. Overview In case that the display device is "10.4-inch LCD with touch-panel", the C application can read status of the touch-pa
  • Page 871Fanuc C-Executer Operating Manual B-62443EN-3/03E The whole coordinate range is (X,Y)=(0,0) - (639,479). This coordi- nate corresponds with the C Executor screen as below. +-----------------------------------+ ----- |(0,0) | ^ +-----------------------------------+ -- | |(0,48) | ^ | | | | | | | | |
  • Page 872Fanuc C-Executer Operating Manual B-62443EN-3/03E List of Functions ~~~~~~~~~~~~~~~~~ ---------------------------------------------------------------------- Name Function ---------------------------------------------------------------------- 1. aux_tpl_read Read the status and (X,Y) coordinate of th
  • Page 873Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ 1. Read the status and (X,Y) coordinate of the touch-panel. -------------------------------------------------------
  • Page 874Fanuc C-Executer Operating Manual B-62443EN-3/03E The status of touch-panel is not buffered. The status at calling this function by the application program is just returned. So, HEAD, BODY, TAIL are not exactly read as this order according to timing of calling by the application program. Usually it
  • Page 875Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program wait until touch-panel is pushed, and displays coordinate of the pushed point. #include #include void example( void ) { struct tpl_xy_coord buf ; int ret ; while ( !( ret = aux_tpl_read( &buf ) ) ) ;
  • Page 876Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 4.1 Keycode, screen control code ================================ 4.1.1 Keycode +----+------+------+------+------+------+------+------+------+ | | 0x | 1x | 2x | 3x | 4x | 5x | 6x | 7x | |----+------+------+------+------
  • Page 877Fanuc C-Executer Operating Manual B-62443EN-3/03E 4.1.2 Keycode of special keys on MDI panel (1) Cursor key, Page key Key Symbol Code ---------------+---------------+------ CursorRight MDIKEY_CURRIGHT 0x88 CursorLeft MDIKEY_CURLEFT 0x89 CursorDown MDIKEY_CURDOWN 0x8A CursorUp MDIKEY_CURUP 0x8B PageD
  • Page 878Fanuc C-Executer Operating Manual B-62443EN-3/03E * In case of 5 soft keys type [FL] [F0][F1][F2][F3][F4] [FR] Key Symbol Code ---------------+---------------+------ [F0] MDIKEY_9_F0 0xF5 [F1] MDIKEY_9_F1 0xF6 [F2] MDIKEY_9_F2 0xF7 [F3] MDIKEY_9_F3 0xF8 [F4] MDIKEY_9_F4 0xF9 [FR] MDIKEY_FR 0xFE [FL]
  • Page 879Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) Deleting Escape sequence Function ---------------+------------------------------------------------------- ESC [K Delete from current cursor position to end of line. ESC [0K Same as above. ESC [1K Delete from current cursor position to beginning o
  • Page 880Fanuc C-Executer Operating Manual B-62443EN-3/03E (5) Character attribute Escape sequence Function ---------------+------------------------------------------------------- ESC [0m Restore default attribute. (White, no blinking, no reverse video) ESC [5m Turn on blinking. ESC [7m Turn on reverse video
  • Page 881Fanuc C-Executer Operating Manual B-62443EN-3/03E (6) Selecting character set Escape sequence Function ---------------+------------------------------------------------------- ESC (1 Select special characters and fragment set of 6x magnified numeric characters. ESC (2 Select fragment set of 6x magnif
  • Page 882Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 4.2 Displayable characters ========================== 4.2.1 Single byte characters (1) Displayable characters The characters, 20-7F, A0-DF, shown in the following table can be displayed on the screen. | 0123456789ABCDEF
  • Page 883Fanuc C-Executer Operating Manual B-62443EN-3/03E 4.2.2 2-byte characters (1) JIS 1st level character set Following KANJI characters of JIS 1st level character set are available in C Executor. The characters in parentheses cannot be displayed. If these characters are output, double width space is di
  • Page 884Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) FANUC special marks The FANUC special marks which are assigned to JIS 1st level character set code are shown below. No. SJIS [JIS ] FANUC Character -------+---------------+-------+---------------------------- 01 885F [2F40] 0752 right arrow 02 88
  • Page 885Fanuc C-Executer Operating Manual B-62443EN-3/03E 4.2.3 Display code for single byte characters In the following tables, the code of the FANUC characters in each character set selected by the escape sequences, "ESC (x", are shown. . If , for example, 0x20 (space) is output in the "ESC (1" mode, FANU
  • Page 886Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) "ESC (3" Graphic characters +----+------+------+------+------+------+------+------+------+------+------+ | | 2x | 3x | 4x | 5x | 6x | 7x | Ax | Bx | Cx | Dx | |----+------+------+------+------+------+------+------+------+------+------| | x0 | 1D5
  • Page 887Fanuc C-Executer Operating Manual B-62443EN-3/03E (5) "ESC (5" Shrunk characters (9 inch CRT only) +----+------+------+------+------+------+------+------+------+------+------+ | | 2x | 3x | 4x | 5x | 6x | 7x | Ax | Bx | Cx | Dx | |----+------+------+------+------+------+------+------+------+------+-
  • Page 888Fanuc C-Executer Operating Manual B-62443EN-3/03E (7) "ESC (7" European character set (umlaut , etc.) +----+------+------+------+------+------+------+------+------+------+------+ | | 2x | 3x | 4x | 5x | 6x | 7x | Ax | Bx | Cx | Dx | |----+------+------+------+------+------+------+------+------+-----
  • Page 889Fanuc C-Executer Operating Manual B-62443EN-3/03E (9) "ESC (4" Standard character set for 80 columns x 25 lines 9 inch CRT +----+------+------+------+------+------+------+------+------+------+------+ | | 2x | 3x | 4x | 5x | 6x | 7x | Ax | Bx | Cx | Dx | |----+------+------+------+------+------+-----
  • Page 890Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 5.1 Multitasking ================ 5.1.1 Program structure 5.1.1.1 Task classes Application programs are composed of three independent task classes. +- User application program -----------------+ | +======================
  • Page 891Fanuc C-Executer Operating Manual B-62443EN-3/03E (supplement) Each task class corresponds to the macro-program of the Macro Executor as follows. Macro Executor C Executor -----------------------+--------------------------- Conversational Macro Main task Auxiliary Macro Alarm task , Communication ta
  • Page 892Fanuc C-Executer Operating Manual B-62443EN-3/03E Auxiliary tasks are executed by interrupting the main task. Task switching from the auxiliary task to the task of lower priority is accomplished by calling functions which wait for certain events to happen. There are following functions which are use
  • Page 893Fanuc C-Executer Operating Manual B-62443EN-3/03E (Supplement) The memory address space of the CNC control software and the kernel of the C Executor is logically separated from that of the user application program. So, there is no chance for the user application program to accidentally destroy the m
  • Page 894Fanuc C-Executer Operating Manual B-62443EN-3/03E 5.1.2 Task Management 5.1.2.1 Kind of tasks (1) CNC task * CNC interruption tasks Automatic or manual operation, servo control, spindle control, I/O transfer of PMC and execution of the ladder, MDI control, program editing, etc. are realized by these
  • Page 895Fanuc C-Executer Operating Manual B-62443EN-3/03E interruption tasks. (For example, the execution is stopped because the task can't get the CPU time, the beginning of the execution by the event is delayed, etc.) - 894 -
  • Page 896Fanuc C-Executer Operating Manual B-62443EN-3/03E 5.1.2.3 When are each tasks executed ? (1) CNC interruption tasks They are waked and executed by timer interruptions without relation to the currently displayed screen. (2) CNC display task It is executed while any CNC screens are being displayed. Ev
  • Page 897Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) While CNC screens are being displayed. (with user background tasks) CNC INT |******| |******| |******| | | | | | | | | | | | | User BACK |+++| | | |++| |+| | |+++| | | | | | (A) | | (B) | | | | | | | | | CNC DISP //----| |--| |----| |-----| |-//
  • Page 898Fanuc C-Executer Operating Manual B-62443EN-3/03E (4) While user screens are being displayed. (with user background tasks) CNC INT |***| |***| |***| |***| |***| | | | | | | | | | | | | | | | | | | | | User BACK | | |++| | | | |+| |+| | |++| | | | | | | |(A) | | (B) | | | | | | | | | | | CNC DISP //-
  • Page 899Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) Switch to the user background tasks Responses of the user background task are as follows for each events which start the tasks. * Timer The task starts from the event within 8 msec while the user main task is being executing or within 16 msec whi
  • Page 900Fanuc C-Executer Operating Manual B-62443EN-3/03E 5.1.2.7 User event while the CNC screen is being displayed If the event which wake any user task occurs while the CNC screen is being displayed, the target user task is waked if that task is the background task. But the event is ignored if the target
  • Page 901Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 5.2 File system =============== The File system compatible with MS-DOS is included in C Executor library. (1) File definition The entire format is as follows. This supports the layered directories. [drive name:][\][direc
  • Page 902Fanuc C-Executer Operating Manual B-62443EN-3/03E The following names can not be used. AUX..AUX4, COMx, PRN, LPTx, CLOCK, CLOCK$ (5) Wild card The following Wild card characters can be used for the File name and extension. ? The meaning of any one character * The meaning of any plural characters (co
  • Page 903Fanuc C-Executer Operating Manual B-62443EN-3/03E (8) Practicable number of files for opening simultaneously The number of files which the application can open simultaneously is fixed 60 as a whole. I/O Control buffers which are used by High level input/output functions(fopen,fclose,fprintf,...) are
  • Page 904Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 5.3 Power-on procedure ====================== 5.3.1 Key operation at power on On FS16/18 with C Executor, the special procedure is executed when the power is turned on with pushing the definite MDI keys. Key pushed at po
  • Page 905Fanuc C-Executer Operating Manual B-62443EN-3/03E In the case that the display language of CNC is not Japanese (English language display) +------------------------------------------+ | Mon Sep 1 14:10:00 1994 | | | | ---------------------------------------- | | C Executor SYSTEM Application | | ----
  • Page 906Fanuc C-Executer Operating Manual B-62443EN-3/03E [6-2] "S-RAM broken" The S-RAM for C Executor is not initialized correctly. The content of S-RAM is initialized after the SYSTEM application is launched. [6-3] "No data in F-ROM" The application programs are not loaded to a F-ROM correctly. [6-4] "No
  • Page 907Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 5.4 Setting parameters for CNC ============================= Parameters related to C Executor Descriptions of parameters Data Data number #7 #6 #5 #4 #3 #2 #1 #0 +--------+ +------+------+------+------+------+------+----
  • Page 908Fanuc C-Executer Operating Manual B-62443EN-3/03E Data number Data +--------+ +-------------------------------------------------------+ | 8661 | | Size of variable areas | +--------+ +-------------------------------------------------------+ Data format : word type Data unit : KByte Data range : 0 th
  • Page 909Fanuc C-Executer Operating Manual B-62443EN-3/03E Data number Data +--------+ +-------------------------------------------------------+ | 8781 | | DRAM size used in C Executor | +--------+ +-------------------------------------------------------+ Data format : Byte type Data unit : 64 KBytes Data ra
  • Page 910Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 5.5 Explanation of omf2mem ========================== ------------------------------------------------------------------ Utility of file convertor from OMF files to a memory card file ------------------------------------
  • Page 911Fanuc C-Executer Operating Manual B-62443EN-3/03E (1) File specification name Describe it with a ASCII character string lower than 8 characters enclosed by double quotations. In the case of C Executor "CEX 1.0M" with 1MB option "CEX 2.0M" with 2MB option "CEX 3.0M" with 3MB option "CEX 4.0M" with 4M
  • Page 912Fanuc C-Executer Operating Manual B-62443EN-3/03E (9) File name of OMF file for read Specify the name of OMF file to be read (generally *.omf). Add the drive name and the directory name if necessary. (10) The offset value added to the address described in OMF It is possible to add an offset to the a
  • Page 913Fanuc C-Executer Operating Manual B-62443EN-3/03E (5) Error message The following error messages might be displayed. "insufficient memory" The memory for execution could not be reserved. "file open error xxx (??H)" The file xxx could not be opened. "file create error xxx (??H)" The file xxx could no
  • Page 914Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 5.6 dat2mem utility manual ========================== ---------------------------------------------------- Data file to Memory_Card file conversion utility ---------------------------------------------------- The "dat2me
  • Page 915Fanuc C-Executer Operating Manual B-62443EN-3/03E Multiple MS-DOS data files are combined in this file. F-ROM file identification name for this type of file is "CEXnxxxx" where 'n' is a number from 0 to 9 and "xxxx" is any combination of max. 4 alpha- numeric characters. Ten C Executor data files (
  • Page 916Fanuc C-Executer Operating Manual B-62443EN-3/03E The size of this type of file is calculated by size of existing C Executor program file + directory entry size (16 + number of data file * 32 bytes) + total size of all data files and the F-ROM memory blocks of 128KB unit is allocated to the file. Th
  • Page 917Fanuc C-Executer Operating Manual B-62443EN-3/03E (1) Name of the Memory_Card file being created Specify the name( usually *.mem) of the Memory_Card file to be created. The format of the file name part should be "CEXnxxxx", where 'n' is a number from 0 to 9 and "xxxx" is any combination of max. 4 al
  • Page 918Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example 1] Command file which combines all "*.dat" files in the directory "a:\data" and creates "CEX1PARM.MEM". --<< from the next line >>---------------------------------------------------- ;================================ ; DAT2MEM Specification
  • Page 919Fanuc C-Executer Operating Manual B-62443EN-3/03E (5) Error messages It can happen that following error messages are displayed. "insufficient memory" Cannot allocate enough memory to execute the program. "file open error xxx (??H)" Cannot open the file xxx. "file create error xxx (??H)" Cannot creat
  • Page 920Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 5.7 Conforming CNC window library to "O8-digits program number" option ====================================================================== 5.7.1 Outline This document describes the changes which is necessary to use C
  • Page 921Fanuc C-Executer Operating Manual B-62443EN-3/03E (4) Read program directory (cnc_rdprogdir) int cnc_rdprogdir( int type, int datano_s, int datano_e, int length, struct prgdir *buf ) ; | v int cnc_rdprogdir( int type, long datano_s, long datano_e, int length, struct prgdir *buf ) ; No chage is neces
  • Page 922Fanuc C-Executer Operating Manual B-62443EN-3/03E (6) Read dynamic data (cnc_rddynamic) int cnc_rddynamic( int axis, int length, struct odbdy *buf ) ; Definition of the structure odbdy is changed. struct odbdy { int dummy ; /* Not used */ int axis ; /* Axis number */ int alarm ; /* Alarm status */ i
  • Page 923Fanuc C-Executer Operating Manual B-62443EN-3/03E | v struct odbdy { int dummy ; int axis ; int alarm ; long prgnum ; /* <- changed */ long prgmnum ; /* <- changed */ long seqnum ; long actf ; long acts ; union { struct { long absolute[8] ; long machine[8] ; long relative[8] ; long distance[8] ; } f
  • Page 924Fanuc C-Executer Operating Manual B-62443EN-3/03E #ifdef ONO8D int cnc_upstart( long ) ; #else int cnc_upstart( int ) ; #endif So, define "ONO8D" when you compile O8-digit application. To define the constant "ONO8D", following methods are also available other than defining by "#define" statement in
  • Page 925Fanuc C-Executer Operating Manual B-62443EN-3/03E According to the item (2) above, memory size allocated to the variables increases. In addition, processing of "long" numbers causes increased object code size, because MS-C is a compiler which generates 16 bits object code. So, memory consumption of
  • Page 926Fanuc C-Executer Operating Manual B-62443EN-3/03E As this flag is defined in accordance with the definition of the constant ONO8D, ONO8D must be correctly defined when compiling "version.c". If "app_flag1" is not defined in "version.c", it is the same as unsigned char app_flag1 = '\x00' ; is defined
  • Page 927Fanuc C-Executer Operating Manual B-62443EN-3/03E 5.7.6.2 Identification data from CNC to application Use following function for application programs to know whether current CNC software is O4-digit CNC or O8-digit CNC. [Name] cnc_information() [Function] Read CNC interface information Refer to the
  • Page 928Fanuc C-Executer Operating Manual B-62443EN-3/03E Next code (3) conforms to both O4-digit and O8-digit application. (3) Conforming to both O4-digit and O8-digit #include #include #include void main( main ) { struct odbpro buf ; printf( "\033(6" ) ; for (;;) { cnc_rdprg
  • Page 929Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 5.8 Using Microsoft C/C++ Ver.8 =============================== 5.8.1 Supported Compilers. C Executor supports the following C compiler. Microsoft (R) C Optimizing Compiler Version 6.x Microsoft (R) C/C++ Optimizing Comp
  • Page 930Fanuc C-Executer Operating Manual B-62443EN-3/03E (4) "Type of Computer" dialogue-box appears. Select your PC type (used to build the application), click [Continue] button. (This selection is for the application building environment, not effective to the C Executor application executing file itself.
  • Page 931Fanuc C-Executer Operating Manual B-62443EN-3/03E (9) Click [Continue] button after specifying files and libraries to be installed and the destination directory as mentioned above. (10) The selected files are copied. Then, the program group is created. (11) "Configuration Files" dialogue-box appears
  • Page 932Fanuc C-Executer Operating Manual B-62443EN-3/03E 5.8.3 Installing the C Executor developing environment (C Library). You don't need to care especially for installing C Library in case of MS-C Ver.8. Run "INSTALL.BAT" in C Library disk normally, and run "XLIBMAK7.BAT", which is the batch command for
  • Page 933Fanuc C-Executer Operating Manual B-62443EN-3/03E #------------------------------------------------------------------------------ # End of task definition block #------------------------------------------------------------------------------ Define the compiling options to the variable MSCOPT. For MS
  • Page 934Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 5.9 Window task =============== 5.9.1 Overview C Executor system is composed of 3 tasks, Main task, Alarm task and Communi- cation task. The Window task is fourth additional task to these 3 tasks. +----------------------
  • Page 935Fanuc C-Executer Operating Manual B-62443EN-3/03E Tasks window other window other |==========|----------|==========|----------|... Time [msec] N*8 M*8 N*8 M*8 window : The window task. other : The main task, the auxiliary tasks of C-EXE, the displaying task of CNC, etc. N:M = 1:4 (default value) The
  • Page 936Fanuc C-Executer Operating Manual B-62443EN-3/03E (1) Start The window task starts from "main()" function by calling "os_strt_wtsk()" in the main task. (2) Initialize General initialization such as variable setting,etc. (3) Wait the trigger to display The application program checks whether it should
  • Page 937Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Graphic library All functions which are available for the main task are available. The target screen to display is not the ordinary screen but VGA window. (4) CNC/PMC window library All functions which are available for the main task are availabl
  • Page 938Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Definition modules of window task in makefile. Define object module names of the window task in the module definition line "TASK4 = " in makefile. (Example) TASK4 = winmain.obj wintsk1.obj wintsk2.obj And more, define DGROUP segment size for the
  • Page 939Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 5.10 Programming technique ========================== 5.10.1 Various techniques (1) Making application program faster There is considerable over-head in calling library function of C Executor. (in comparison with persona
  • Page 940Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) How to control switching CNC screen by C Application For FS16/18, usually the CNC system software manages all screen switching including C user screen. The C application program can control this screen switching by function keys. The required pro
  • Page 941Fanuc C-Executer Operating Manual B-62443EN-3/03E If you want customize screen switching (such as "don't switch specific screen", etc.), check whether screen should be switched or not before calling the function ([*] part). And more, add switching process to NC's alarm screen when the alarm state ri
  • Page 942Fanuc C-Executer Operating Manual B-62443EN-3/03E For multitask application, inter-task common variables, which are allocated on common memory area, is used to share information with the other tasks. There are two memory area for inter-task common variable on S-RAM and D-RAM. The variables which are
  • Page 943Fanuc C-Executer Operating Manual B-62443EN-3/03E 5.10.2 Known problems There are known problems on C Executor as follows. Please take case of these problems and keep your application program from them. (1) When any function which takes task switching is called in the main task while the screen swit
  • Page 944Fanuc C-Executer Operating Manual B-62443EN-3/03E [Supplement] Functions such as "os_xxx()" or "getch()" which wait something switches to less priority task while waiting. For example, "os_wait_tim()" function is called in the alarm task, execution switches to the communication task or the main task
  • Page 945Fanuc C-Executer Operating Manual B-62443EN-3/03E 5.10.3 Applying C Executor to machine (1) Machine maintenance Machine Tool Builders(MTB) can make their own custom man-machine interface, such as screen display and operation method, on CNC device made by FANUC using C Executor. This is better for MT
  • Page 946Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18 C Executor 5.11 Using C Executor on FS16i/18i ================================== There are two individual libraries for each FS16/18-B/C and FS16i/18i in the previous version of C library. These libraries are unified into a single
  • Page 947Fanuc C-Executer Operating Manual B-62443EN-3/03E [Note] The future version of CNC softwares have new procedure which reports the CNC model spec to C Executor. The current version of C library can receive this report and execute suitable process for each CNC model automatically. Therefore, it is pos
  • Page 948Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1999.6.23 FANUC LTD. Supporting new MDI keyboard ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. Overview C Executor now supports "New MDI keyboard" (called "61 full-key") for FS16i/18i. 61 full-key has all alphabetic charact
  • Page 949Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. Key code table Key code table of "61 full-key" which is common for both M and T series. (1) 61 full-key (10-SOFT key type) M and T series Key bit matrix bit= 0 1 2 3 4 5 6 7 +------+------+------+------+------+------+------+------+ 0 | 0 = | 1 | 2
  • Page 950Fanuc C-Executer Operating Manual B-62443EN-3/03E Key code table for CNC +0 +2 +4 +6 +8 +A +C +E ----+------+------+------+------+------+------+------+------ 60 | 30 3D 31 31 32 32 33 33 34 34 35 35 36 36 37 37 70 | 38 38 39 39 2D 2B 2E 2C 00 00 00 00 0A 0A 86 86 80 | 96 96 94 94 95 95 98 98 9A 9A 8
  • Page 951Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) 61 full-key (5-SOFT key type) M and T series Key bit matrix bit= 0 1 2 3 4 5 6 7 +------+------+------+------+------+------+------+------+ 0 | 0 = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +------+------+------+------+------+------+------+------+ 1 | 8 | 9 |
  • Page 952Fanuc C-Executer Operating Manual B-62443EN-3/03E Key code table for CNC +0 +2 +4 +6 +8 +A +C +E ----+------+------+------+------+------+------+------+------ 60 | 30 3D 31 31 32 32 33 33 34 34 35 35 36 36 37 37 70 | 38 38 39 39 2D 2B 2E 2C 00 00 00 00 0A 0A 86 86 80 | 96 96 94 94 95 95 98 98 9A 9A 8
  • Page 953Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1997.09.09 FANUC LTD. Character-card display device ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ VGA display device is equipped for FANUC Series 16i/18i-A (FS16i/18i) as its standard display device. Now "Character-card" dis
  • Page 954Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Specification The specification differences between Character-card, VGA and CRTC used on FS16/18-B/C are below. ( Specifications about VGA and CRTC are described in "3.6 CRT operation library" of the programming manual.) Legends: [14"] Generic nam
  • Page 955Fanuc C-Executer Operating Manual B-62443EN-3/03E Number of user definition character [14"] 256 256 256 [ 9"](standard) 256 71 71 [ 9"](small) 256 71 71 (*7) (*1) "VGA 9-inch mono CRT" is available only for FS16/18-C. (*2) 40x19 and 80x30 are not available on 9" mono CRT. (*3) Man-readable grayscale
  • Page 956Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.2 Display function availabilities [CRT operation functions] CRTC VGA Character-card -----------------------+---------------+---------------+---------------- crt_getcurscrn Yes Yes Yes crt_setuserscrn Yes Yes Yes crt_isnewscrn Yes Yes Yes crt_gettyp
  • Page 957Fanuc C-Executer Operating Manual B-62443EN-3/03E [Multiple window display functions] CRTC VGA Character-card -----------------------+---------------+---------------+---------------- win_open Yes Yes Yes win_close Yes Yes Yes win_select Yes Yes Yes win_activate Yes Yes Yes win_move Yes Yes Yes win_s
  • Page 958Fanuc C-Executer Operating Manual B-62443EN-3/03E [MS-C compatible graphic functions] CRTC VGA Character-card -----------------------+---------------+---------------+---------------- _arc Yes Yes No _clearscreen Yes Yes No _ellipse Yes Yes No _floodfill Yes Yes No _getactivepage No Yes No _getarcinf
  • Page 959Fanuc C-Executer Operating Manual B-62443EN-3/03E _unregisterfonts No Yes No _wrapon Yes Yes No [Original graphic functions] CRTC VGA Character-card -----------------------+---------------+---------------+---------------- gr_displaychar No Yes No gr_displayfourlarge No Yes No gr_displaysixlarge No Y
  • Page 960Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Application programming Attentions about application programming are described below. 3.1 Discrimination of display device Do the following procedure in your program to discriminate the current display device. #include unsigned int type ;
  • Page 961Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1998.10.01 FANUC LTD. Screen switching with Background graphics ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Note the following point when C Executor application program switches the screen on FS16i/18i-MA with
  • Page 962Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1998.12.22 FANUC LTD. Display device connected via CRT LINK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The stand-alone type FANUC Series 16i/18i/21i-A (FS16i/18i/21i) can connect monochrome LCD display unit using
  • Page 963Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Specification Specifications of display units including CRT LINK LCD are listed in this section. ( Specifications about VGA and CRTC are described in "3.6 CRT operation library" of the programming manual, and about Character-card in "man\ccard.txt
  • Page 964Fanuc C-Executer Operating Manual B-62443EN-3/03E 2nd cursor Yes Yes No No display Displayable characters(*5) [14"] FANUC FANUC,JIS FANUC,JIS No [ 9"](std) FANUC FANUC FANUC FANUC [ 9"](sml) FANUC FANUC,JIS(*6) FANUC FANUC Number of user definition character [14"] 256 256 256 0 [ 9"](std) 256 71 71
  • Page 965Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.2 Display function availabilities [CRT operation functions] CRTC VGA C.CARD CRT.LINK -----------------------+-------+-------+-------+-------- crt_getcurscrn Yes Yes Yes Yes crt_setuserscrn Yes Yes Yes Yes crt_isnewscrn Yes Yes Yes Yes crt_gettype Y
  • Page 966Fanuc C-Executer Operating Manual B-62443EN-3/03E [User definition character functions] CRTC VGA C.CARD CRT.LINK -----------------------+-------+-------+-------+-------- crt_reguserchar Yes Yes Yes No(*10) crt_mapuch Yes Yes Yes No(*10) crt_getcgpttn Yes No Yes No(*10) (*10) Returns "3" as return va
  • Page 967Fanuc C-Executer Operating Manual B-62443EN-3/03E _registerfonts No Yes No No _remapallpalette Yes Yes No No _remappalette Yes Yes No No _setactivepage No Yes No No _setbkcolor Yes Yes No No _setcliprgn Yes Yes No No _setcolor Yes Yes No No _setfillmask Yes Yes No No _setfont No Yes No No _setgtextv
  • Page 968Fanuc C-Executer Operating Manual B-62443EN-3/03E [Original graphic functions] CRTC VGA C.CARD CRT.LINK -----------------------+-------+-------+-------+-------- gr_displaychar No Yes No No gr_displayfourlarge No Yes No No gr_displaysixlarge No Yes No No _putpattern No Yes No No _getpattern No Yes No
  • Page 969Fanuc C-Executer Operating Manual B-62443EN-3/03E [Display mode setting] CRTC VGA C.CARD CRT.LINK -----------------------+-------+-------+-------+-------- ESC [7h Yes Yes Yes Yes ESC [?7h Yes Yes Yes Yes ESC [7l Yes Yes Yes Yes ESC [?7l Yes Yes Yes Yes ESC [>5l Yes Yes Yes Yes ESC [>5h Yes Yes Yes Y
  • Page 970Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.4 Supplement about text attributes The relationship of text color setting by escape sequence and real text color on the screen is listed below. [Normal mode] Escape CRTC/VGA CRTC/VGA/C.CARD sequence color CRT/LCD mono CRT/LCD CRT LINK LCD ---------
  • Page 971Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.5 Restriction about MDI key The following feature about MDI key handling is not allowed when CRT LINK LCD is used. (1) It is impossible to read the extended part of MDI key (10th,11st and 12th lines). 3. Application programming Attentions about app
  • Page 972Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1998.2.17 FANUC LTD. Using C Executor on FS160i/180i ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. Overview It is possible to run C Executor on the following equipments on which "CNC screen display" application. * FS160
  • Page 973Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. How do application program run on each equipment In this section, how each task of the application program runs is described. 2.1 FS160i/180i with PC Status of NC & PC Status of C-EXE application -------------------- ------------------------------
  • Page 974Fanuc C-Executer Operating Manual B-62443EN-3/03E [5] The window task must close already opened VGA windows when "CNCscrnAPP" is terminated. "CNCscrnApp" can't close itself while any VGA windows keep opening. It is possible to test whether "CNCscrnApp" is going closed or not by "crt_pcinfo()" functi
  • Page 975Fanuc C-Executer Operating Manual B-62443EN-3/03E [4] When "CNCscrnApp" starts on PC, the main task goes sleeping once. Because CNC's screen must be selected for changing the screen between CNC side and PC side. After starting PC display, by changing the screen to C-EXE the main task runs again and
  • Page 976Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Restrictions on specification In this section, differences from C Executor on the ordinary FS16i/18i are described. You can regard the specifications which are not listed below as same as on the ordinary FS16i/18i with VGA display device. The foll
  • Page 977Fanuc C-Executer Operating Manual B-62443EN-3/03E (7) Customizing of MDI key for CNC's screen is unavailable. [*] "aux_mdi_putmatrix()" or "aux_mdi_altmatrix()" functions take no effect to CNC side key matrix. (8) It is impossible to turn ON and OFF back-light of LCD screen by "ESC [>9l" and "ESC [>
  • Page 978Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. Making application program 4.1 Alterations It is required for the already existing application program to modify the source codes as it avoids specification restrictions if you want to run the program on FS160i/180i. You should take care of the fo
  • Page 979Fanuc C-Executer Operating Manual B-62443EN-3/03E (8),(9) To control LCD display (turning ON/OFF the back-light, reversing the screen), use the ordinary screen control feature of PC. (10) While the application program is displaying VGA windows, call "crt_pcinfo()" function periodically and close all
  • Page 980Fanuc C-Executer Operating Manual B-62443EN-3/03E 5. Additional functions List of additional functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 1. c
  • Page 981Fanuc C-Executer Operating Manual B-62443EN-3/03E (1) CNC system type This is 1-byte value which indicates if CNC is 160i/180i with PC function. CRT_CNC_16I 0x00 Not FS160i/180i with PC (ordinary FS16i/18i, FS160i/180i with HSSB or FS160i/180i with Ethernet) CRT_CNC_160I 0x01 FS160i/180i with built-
  • Page 982Fanuc C-Executer Operating Manual B-62443EN-3/03E #include void example( void ) { unsigned short pcinfo ; pcinfo = crt_pcinfo() ; /* Is CNC 160i/180i ? */ if ( pcinfo & CRT_PC_ENB ) { /* Has PC app closed or been down ? */ if ( pcinfo & ( CRT_PC_END + CRT_PC_DWN ) ) { vwin_close( 0 ) ; vwin_
  • Page 983Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1998.6.17 FANUC LTD. Displaying 4x magnified characters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. Overview The existing C Executor can display half-size, double-size and 6x magnified (limited characters only) cha
  • Page 984Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.2 Graphic function The following new original graphic functions draw 4x magnified characters (9-inch font). -------------------------------------------------------------------------- Name Function ---------------------------------------------------
  • Page 985Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Draw 9-inch font character string.
    ------------------------------------------------------------------------------ [Name] gr_disp9ifstr G [Syntax] #include
  • Page 986Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1999.5.31 FANUC LTD. FANUC additional graphic functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "FANUC additional graphic functions" are library functions which are compatible with "FANUC MMC-III"'s graphic functi
  • Page 987Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ 1. 2-dimension graphic function ------------------------------------------------------------------------------ 1.1 Draw a line between specified two points.
    ------------------------------------------------
  • Page 988Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.2 Draw a polyline.
    ------------------------------------------------------------------------------ [Name] mmc_polyline [Syntax] #include void mmc_polyli
  • Page 989Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.3 Draw a circle.
    ------------------------------------------------------------------------------ [Name] mmc_circle_b [Syntax] #include short mmc_circle_
  • Page 990Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.4 Draw an ellipse.
    ------------------------------------------------------------------------------ [Name] mmc_ellipse_b [Syntax] #include short mmc_elli
  • Page 991Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.5 Draw a pie figure.
    ------------------------------------------------------------------------------ [Name] mmc_pie_b [Syntax] #include short mmc_pie_b(
  • Page 992Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 1.6 Draw an arc.
    ------------------------------------------------------------------------------ [Name] mmc_arc_b [Syntax] #include short mmc_arc_b( short
  • Page 993Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Character function ------------------------------------------------------------------------------ 2.1 Get character in the specified area.
    ------------------------------------------------------------------------------ [Name] mmc_gettext [Sy
  • Page 994Fanuc C-Executer Operating Manual B-62443EN-3/03E +---------------------------------+ |(1,1) | | | | screen | | | specified area | +---------------------------+ | |(x1,y1) |//////////| | | |//////////| | | |//////////| | | (80,30)|//////////| +----------------|----------------+//////////| |/////////
  • Page 995Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.2 Put character data on memory to text screen.
    ------------------------------------------------------------------------------ [Name] mmc_puttext [Syntax] #include
  • Page 996Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2.3 Get required byte size for getting character.
    ------------------------------------------------------------------------------ [Name] mmc_textsize [Syntax] #inclu
  • Page 997Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor List of additional functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -------------------------------------------------------------------------- Name Function -------------------------------------------------------------
  • Page 998Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ 1. Output character string by FANUC character code.
    --------------------------------------------------------------------------
  • Page 999Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Get text data from VRAM.
    ------------------------------------------------------------------------------ [Name] crt_gettextimg [Syntax] #include int crt_g
  • Page 1000Fanuc C-Executer Operating Manual B-62443EN-3/03E All character codes and their attributes, included the rectangular area that is enclosed by (y1,x1)-(y2,x2),can be got. (The characters which are enclosed in above area)*4 bytes area must be reserved as "BUF". The data form, stored in "BUF", is as fo
  • Page 1001Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3. Put text data into VRAM.
    ------------------------------------------------------------------------------ [Name] crt_puttextimg [Syntax] #include int crt_p
  • Page 1002Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program makes the characters and attributes that are displayed on the specified area to move to right by 3 digit. #include #include #include void example( unsigned int y1, unsigned int x1, unsigned
  • Page 1003Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4. Call CNC window. ------------------------------------------------------------------------------ [Name] cnc_windowma [Syntax] #include int cnc_w
  • Page 1004Fanuc C-Executer Operating Manual B-62443EN-3/03E Generally the structure of Input/Output data area is as follows. (1) Case that function code l.e. 255, iodata[0] Function code iodata[1] Return code iodata[2] Data length iodata[3] Data number iodata[4] Data attribute iodata[5] and later Data area (2
  • Page 1005Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 5. Select graphic page to use.
    ------------------------------------------------------------------------------ [Name] crt_setgraphpage [Syntax] #include int
  • Page 1006Fanuc C-Executer Operating Manual B-62443EN-3/03E * Supplement - Using graphic page #2 In addition to the above page #0 and #1, graphic page #2 is available for VGA graphic. This page #2 shares graphic memory with the VGA window's graphic plane. Therefore, while the VGA window opens on the screen, t
  • Page 1007Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 6. Draw a quad size string.
    ------------------------------------------------------------------------------ [Name] gr_disp4str [Syntax] #include void gr_di
  • Page 1008Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 7. Draw a small size character.
    ------------------------------------------------------------------------------ [Name] gr_displaysmlchar [Syntax] #include
  • Page 1009Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 8. Draw a small size string.
    ------------------------------------------------------------------------------ [Name] gr_dispsstr [Syntax] #include void gr_d
  • Page 1010Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 9. Draw a FANUC character.
    ------------------------------------------------------------------------------ [Name] gr_displayfchar [Syntax] #include void gr
  • Page 1011Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 10. Draw a FANUC character string.
    ------------------------------------------------------------------------------ [Name] gr_dispfstr [Syntax] #include voi
  • Page 1012Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 11. Get result of serial library function. ------------------------------------------------------------------------------ [Name] rs_error [Syntax] #inclu
  • Page 1013Fanuc C-Executer Operating Manual B-62443EN-3/03E The result of this function is unstable when any serial library function has been never executed. The information returned by this function is common to all tasks. For example, when this function is called in the main task just after any serial libra
  • Page 1014Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 12. Redraw windows.
    ------------------------------------------------------------------------------ [Name] win_redraw [Syntax] #include void win_redraw( void
  • Page 1015Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 13. Select drawing method of 6x sized character.
    ------------------------------------------------------------------------------ [Name] crt_set6chmode [Syntax] #incl
  • Page 1016Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 14. Select saving method of graphic contents.
    ------------------------------------------------------------------------------ [Name] crt_setgsvmode [Syntax] #include
  • Page 1017Fanuc C-Executer Operating Manual B-62443EN-3/03E The following memory is required to save contents of graphic page. 16-color mode Approx. 150KB per page. 256-color mode Approx. 300KB per page. Required memory is allocated when "Save graphic contents" is specified by this function. Memory area is pr
  • Page 1018Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 15. Write parameter. (immediate writing) ------------------------------------------------------------------------------ [Name] cnc_wrparam2 [Syntax] #include
  • Page 1019Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Alters the parameter data stored in the CNC. This function is almost same as "cnc_wrparam()" function. There are the following differences. * Servo parameters and Spindle parameters are immediately effective after execution of this func
  • Page 1020Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 16. Write setting parameter. (immediate writing) ------------------------------------------------------------------------------ [Name] cnc_wrset2 [Syntax] #in
  • Page 1021Fanuc C-Executer Operating Manual B-62443EN-3/03E [Description] Alters the setting parameter stored in the CNC. This function is almost same as "cnc_wrset()" function. There are the following differences. * Servo parameters and Spindle parameters are immediately effective after execution of this fun
  • Page 1022Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 17. Copy image data. (interpage)
    ------------------------------------------------------------------------------ [Name] gr_bitblt2 [Syntax] #include void g
  • Page 1023Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1997.09.09 FANUC LTD. Using user definition characters in small character mode on 9- inch type display device ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ User definition character
  • Page 1024Fanuc C-Executer Operating Manual B-62443EN-3/03E --................ | ................ | ................ | ................ | ................ | ................ | ................ | ................ | ................ v ................-- |<------------>| (2) 16 dots (1) Dots to be displayed. (2)
  • Page 1025Fanuc C-Executer Operating Manual B-62443EN-3/03E (3) Registering character pattern To register character pattern, use "crt_reguserchar()" function. Arguments to the function are same as the ordinary case. Also "crt_mapuch()" function is available to map the character code. (4) Notice * Storage memo
  • Page 1026Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1998.11.18 FANUC LTD. C Executor diagnostics information ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Descriptions of diagnosis Data number Data +--------+ +-------------------------------------------------------+ | 00
  • Page 1027Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1998.8.11 FANUC LTD. Applying to 2-path CNC system ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. Overview It is able for the existing C Executor to customize only screens of path-1 on 2-path CNC system. Customizing of scr
  • Page 1028Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Specification 2.1 Added specifications The following specifications have been added to C Executor which applyies to 2-path system. (1) It is available to register user screens on path-2 side. So far, it is possible to replace CNC screens on path-1
  • Page 1029Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.3 Required softwares 2-path system functions of C Executor require the following softwares. CNC system software FS16i-MA B0F1-20 or later FS16i-TA B1F1-19 or later FS18i-MA BDF1-20 or later FS18i-TA BEF1-19 or later C Executor library BY01-2.2F or
  • Page 1030Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Application programming Some processes must be added to program for 1-path system to make C Executor application program for 2-path system. (1) Registering user screens To register user screens on path-2 side, use "crt_setuserscrn2()" function. If
  • Page 1031Fanuc C-Executer Operating Manual B-62443EN-3/03E (4) Refreshing contents of screen Application program generally refreshes contents of screen when any screen switching has occurred while the user's screen is displaying. This "any screen switching" is, for example, one of user's screen --> CNC scree
  • Page 1032Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. Additional functions List of additional functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -------------------------------------------------------------------------- Name Function -------------------------------------------------------------------------- 1. c
  • Page 1033Fanuc C-Executer Operating Manual B-62443EN-3/03E Function Reference ~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ 1. Get current path number and screen index. (for multi-path) ----------------------------------------------------------
  • Page 1034Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program displays the currently selected path number and the screen index number. #include #include void example( void ) { int path, scrn ; crt_getcurscrn2( &path, &scrn ) ; printf( "Selected path is %d\n", pa
  • Page 1035Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Register user screen index. (for multi-path)
    ------------------------------------------------------------------------------ [Name] crt_setuserscrn2 [Syntax] #inc
  • Page 1036Fanuc C-Executer Operating Manual B-62443EN-3/03E [Example] The following program registers The following program registers all position screens ([ABS]/[REL]/[ALL]) of both path-1 and path-2 as user's screen. #include void example( void ) { int crt_table[] = { CRT_POS_ABS, /* POSITION/ABSOLU
  • Page 1037Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3. Customize softkey on CNC screen. (for multi-path)
    ------------------------------------------------------------------------------ [Name] crt_setuserskey2 [Syntax]
  • Page 1038Fanuc C-Executer Operating Manual B-62443EN-3/03E Store multiple customizing data in "skey". The customizing data includes the following items. index Softkey index number to be customized. op Operation code. submode Small classification of the user's screen. string User specified display string. It
  • Page 1039Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1997.10.27 FANUC LTD. High-Level Task ~~~~~~~~~~~~~~~ 1. Overview of High-Level Task High-Level Task is the independent task of C Executor ordinary tasks (Main Task, Auxiliary Tasks and Window Task) and is ca
  • Page 1040Fanuc C-Executer Operating Manual B-62443EN-3/03E (2) Available variable types and operators The following variable types are available in High-Level task. Type char, unsigned char, int, unsigned int, long, unsigned long, array of these types and pointers to these type variables. Kind auto variable,
  • Page 1041Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Task execution rule High-Level Task is called after CNC task in the periodical interrupt procedure at 8msec intervals. <---- 8msec ---> <---- 8msec ---> <---- 8msec ---> |----------------|----------------|----------------| |--->|==>| |--->|==>| |-
  • Page 1042Fanuc C-Executer Operating Manual B-62443EN-3/03E High-Level Task has priority over the other CNC tasks such as preparing task. If High-Level task runs long time, CPU time for CNC preparing task, etc. may be reduced. (In this case, any harmful effect, such as machining time by CNC's automatic operat
  • Page 1043Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. Application programming The following sections mention development process of application including High-Level Task. (1) Source module(s) The structure of High-Level Task's source modules is same as the other tasks. That is, it has one or more sou
  • Page 1044Fanuc C-Executer Operating Manual B-62443EN-3/03E 5. Function reference ------------------------------------------------------------------------------ 1. Interrupt execution of High-Level Task ------------------------------------------------------------------------------ [Name] rettask [Synt
  • Page 1045Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 2. Call CNC window ------------------------------------------------------------------------------ [Name] cnc_window [Syntax] int cnc_window( unsigned int *iodata )
  • Page 1046Fanuc C-Executer Operating Manual B-62443EN-3/03E High-Level application program can not call all CNC window functions. Only following functions are available. (1) Read program number in executing. (2) Read sequence number in executing. (3) Read actual feed rate of controlled axes. (4) Read actual s
  • Page 1047Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 3. Get pointer to PMC data ------------------------------------------------------------------------------ [Name] pmc_getioptr [Syntax] #include void *pmc
  • Page 1048Fanuc C-Executer Operating Manual B-62443EN-3/03E PMC-SB5 I.D. code(id) Kind of PMC address Referenceable range(offset_addr) ---------------+-----------------------+-------------------------------- 0 G (PMC->CNC) 0000-0255, 1000-1255 1 F (CNC->PMC) 0000-0255, 1000-1255 2 Y (PMC->Machine) 0000-0127,
  • Page 1049Fanuc C-Executer Operating Manual B-62443EN-3/03E (*1) It is inhibited to write to the all data of address 'F' and 'X', "R9000",..,"R9199" and "K0017",..,"K0019". (*2) Address "G1xxx" and "F1xxx" are I/O area for the path#2, and "G2xxx" and "F2xxx" for the path#3. (*3) Exclusion control to PMC ladde
  • Page 1050Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ 4. Convert pointer to linear address ------------------------------------------------------------------------------ [Name] ptrtoadd [Syntax] #inclu
  • Page 1051Fanuc C-Executer Operating Manual B-62443EN-3/03E 6. Detail of CNC window function's input/output data The general structure of CNC window' input/output data is as follows. (1) Case of function code is equal to or less than 255. iodata[0] Function code iodata[1] Return code iodata[2] Data length iod
  • Page 1052Fanuc C-Executer Operating Manual B-62443EN-3/03E * Detail of input/output data area for individual function ------------------------------------------------------------------------------ (1) Read program number in executing ---------------------------------------------------------------------------
  • Page 1053Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ (3) Read actual feed rate of controlled axes ------------------------------------------------------------------------------ Equivalence to "cnc_actf()" function. [Input] F
  • Page 1054Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ (4) Read actual spindle speed ------------------------------------------------------------------------------ Equivalence to "cnc_acts()" function. [Input] Function code io
  • Page 1055Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ (5) Read absolute position ------------------------------------------------------------------------------ Equivalence to "cnc_absolute()" function. [Input] Function code i
  • Page 1056Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ (7) Read relative position ------------------------------------------------------------------------------ Equivalence to "cnc_relative()" function. [Input] Function code i
  • Page 1057Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ (9) Read skipped position ------------------------------------------------------------------------------ Equivalence to "cnc_skip()" function. [Input] Function code iodata
  • Page 1058Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ (11) Read acceleration/deceleration delay amount ------------------------------------------------------------------------------ Equivalence to "cnc_accdecdly()" function.
  • Page 1059Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ (13) Read abnormal load torque data ------------------------------------------------------------------------------ Equivalence to "cnc_loadtorq()" function. [Input] Functi
  • Page 1060Fanuc C-Executer Operating Manual B-62443EN-3/03E ------------------------------------------------------------------------------ (15) Read A/D conversion data (Read load data of servo axis) ------------------------------------------------------------------------------ Equivalence to "cnc_adcnv()" fu
  • Page 1061Fanuc C-Executer Operating Manual B-62443EN-3/03E 8. High-Level task execution management data "High-Level task execution management data" are variables in where how High- Level task runs is stored. The following structure is defined. struct HL_MNGDATA { unsigned long HL_COUNT ; unsigned int HL_STIM
  • Page 1062Fanuc C-Executer Operating Manual B-62443EN-3/03E HL_MAXPROCTIME Maximum value of (HL_ETIME - HL_STIME) This is the maximum execution time of High-Level task. The following operation converts this value to [micro-sec]. (long)( 0x1000 - HL_MAXPROCTIME ) * 8000 / 4096 HL_TIMEOVER Total counts that exe
  • Page 1063Fanuc C-Executer Operating Manual B-62443EN-3/03E Data format stored in buffer memory is as follows. Byte offset from the top of buffer Stored data -------------------+--------------- +0000 HL_STIME (0) +0002 HL_ETIME (0) +0004 HL_STIME (1) +0006 HL_ETIME (1) : : Contents of stored data are counter
  • Page 1064Fanuc C-Executer Operating Manual B-62443EN-3/03E 9. Notes High-Level task requires the following CNC software. Series-Edition of CNC type CNC software ---------------+-------------------- FS16i-MA B0F1-15 or later FS16i-TA B1F1-14 or later FS18i-MA BDF1-15 or later FS18i-TA BEF1-14 or later or equi
  • Page 1065Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1998.6.16 FANUC LTD. Using of Watcom C/C++ Compiler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. Supported Compilers. C Executor supports the following C compiler. Microsoft (R) C Optimizing Compiler Version 6.x Microso
  • Page 1066Fanuc C-Executer Operating Manual B-62443EN-3/03E 2.1 For developing on DOS Followings are the ways to install Watcom 11.0. If you use Watcom 10.5, install by the same way as Watcom 11.0. (1) Set Watcom C/C++ CD-ROM in the PC, and execute SETUP.EXE, DOSSETUP.EXE (for IBM compatible PC) or 98SETUP.EX
  • Page 1067Fanuc C-Executer Operating Manual B-62443EN-3/03E (4-b) 32-bit option --- This option is not used for developing C Executor application. +----------------------------------------------------------+ | [ ] 32-bit MFC 4.1 support: MFC Support...... | | | | Select the 32-bit calling conventions you wish
  • Page 1068Fanuc C-Executer Operating Manual B-62443EN-3/03E (6) Environment variables for Watcom C are registered. The way either to rewrite AUTOEXEC.BAT or to edit it later manually can be selected. Here, one of them can be selected. +---------------------------------------------------------+ | DOSSETUP need
  • Page 1069Fanuc C-Executer Operating Manual B-62443EN-3/03E (4) Type following command to compile test program. wcl /ml /fp3 hello.c Confirm that the displayed compiler version is one of following. WATCOM C/C++16 Compile and Link Utility Version 10.5 or Watcom C/C++16 Compile and Link Utility Version 11.0. Al
  • Page 1070Fanuc C-Executer Operating Manual B-62443EN-3/03E The detail options necessary for developing C Executor application are shown below. It is also possible to select options which is not necessary to develop C Executor application. (4-a) 16-bit option --- Large model must be selected as Memory model.
  • Page 1071Fanuc C-Executer Operating Manual B-62443EN-3/03E (4-e) Other components --- Any options which are selected optionally. No one required for C Executor. Help file can be placed either on hard disk drive or CD-ROM drive. +--------------------------------------------+ | Select other options: | | | | [
  • Page 1072Fanuc C-Executer Operating Manual B-62443EN-3/03E (7) Finally the dialog box for completion of installation is displayed. Then, reboot PC to register environment variables correctly. +--------------------------------------------------+ | SETUP32 has completed installing the software. | | | | You sho
  • Page 1073Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Installing C Executor library To install C Executor library; The xlink386 must be installed before installing C Executor library. The environment variable (PATH) must be set for executing "xlink386.exe" and "xlib386.exe". Under above conditions, C
  • Page 1074Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. Making applications 4.1 The restrictions Following MS-C expanded library functions can not be used on the Watcom C compiler. btom chkctype jstradv jstrchr jstrcmp jstrcspn jstricmp jstrlen jstrlwr jstrmatch jstrncat jstrncmp jstrncpy jstrnicmp jst
  • Page 1075Fanuc C-Executer Operating Manual B-62443EN-3/03E (4) The way to discriminate if using compiler is Watcom C is as follows. The Watcom C compiler defines the macro " __WATCOMC__", in which the version number of the Watcom C is set.(Ex. Ver.10.5 --> __WATCOMC__=1050 ) By referring this macro, it can b
  • Page 1076Fanuc C-Executer Operating Manual B-62443EN-3/03E #------------------------------------------------------------------------------ # Task definition block. Modify here for your application. #------------------------------------------------------------------------------ TASK1 = ==> #TASK2 = ==> #TASK3
  • Page 1077Fanuc C-Executer Operating Manual B-62443EN-3/03E Define the variable corresponding to each task by removing comment mark. Store all object file names (*.obj) that are included in each tasks into corresponding variables. Keep the variable corresponding to unused tasks undefined state by being commen
  • Page 1078Fanuc C-Executer Operating Manual B-62443EN-3/03E (F) Specifying DGROUP segment size of each tasks. The DGROUP segment size of each task is defined in this section. Usually it is not necessary to change the default setting. If you want to decrease DGROUP segment size, change this setting. (Ex.) To c
  • Page 1079Fanuc C-Executer Operating Manual B-62443EN-3/03E FANUC Series 16/18/16i/18i/21i C Executor 1999.2.16 FANUC LTD. About Linker ~~~~~~~~~~~~ 1. Linker used with C Executor Linker "xlink386" which is included in the following software products is used for development the application program of C Execut
  • Page 1080Fanuc C-Executer Operating Manual B-62443EN-3/03E xlink386 Required files for version OS C-EXE app development ---------------+-----------------------+----------------------- ver.1.2 DOS bin\xlink386.exe bin\xlib386.exe ver.1.5 DOS bin\xlink386.exe bin\xlib386.exe bin\dos4gw.exe ver.2.0/2.2 DOS bin\
  • Page 1081Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. About xlink386 version Now we have confirmed that the following versions of "xlink386" work correctly with C Executor or not work. * Available version (These versions and compatibles work correctly) Link & Locate 386, xlink386 ver. 1.2b Link & Loc
  • Page 1082Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Function Reference ===================== The function specifications that C library provides with are described in this function reference with following format. [Example] > -------------------------------------------------------------------------
  • Page 1083Fanuc C-Executer Operating Manual B-62443EN-3/03E [ End of 30fref.man ] - 1082 -
  • Page 1084Fanuc C-Executer Operating Manual B-62443EN-3/03E Appendix A Self Debug Funktion ========================= +---------------------------------------------------------------------+ | | | FANUC Series 16/18 Model B/C | | FANUC 16/18/21 i Series Model A | | | | | | Self debugger function | | | | | +----
  • Page 1085Fanuc C-Executer Operating Manual B-62443EN-3/03E 1. Outline of Function This debug function can be executed by setting the parameter. The debugging by ice does not execute normally because this function uses debug register of Intel CPU. Please stop this debug function when debugging by ice. +------
  • Page 1086Fanuc C-Executer Operating Manual B-62443EN-3/03E 2. Detail of function a) Standard mode (the parameter No.8980#7=0 and #6=1) The four trigger point of the parameter No.8981,8982,8983 and 8984 are specified under the trigger condition specified by the parameter No.8980#0,#1,#2,#3 and #4. The trigger
  • Page 1087Fanuc C-Executer Operating Manual B-62443EN-3/03E b) Multi function mode (the parameter No.8980#6=1 and #7=1) One trigger point of the parameter No.8981 is specified under the trigger condition specified by the parameter No.8980#0,#1,#2,#3 and #4. The trigger condition is the same as a standard mode
  • Page 1088Fanuc C-Executer Operating Manual B-62443EN-3/03E Example: The trigger breaks on at the address 803456H when the data of1234H(byte) is equal to 12H. No.8980 = 11010000 : Instruction trigger. No.8981 = 8402006 : Trigger address 803456H No.8982 = 987700 : Data address 0F1234H No.8983 = 18 : Data 12H N
  • Page 1089Fanuc C-Executer Operating Manual B-62443EN-3/03E 3. Others If you execute trigger again, please set the above relational parameter again or please set 0 in an irrelevant parameter. In case of power on, if this function is enable, you can execute trigger at once. The trigger address and break on con
  • Page 1090Fanuc C-Executer Operating Manual B-62443EN-3/03E 4. Parameter 7 6 5 4 3 2 1 0 8980 0 1 DBCONT DBEXC DBLN1 DBLN0 DBRW1 DBRW0 DBSPCI: Special Debug Function. DBEXEC: Debug Function Execute. DBCONT: Continue Mode. DBEXC : Trap Exactry (Global) DBLN1/0: Trigger Length 0 0: 1 byte 0 1: 2 byte 1 1: 4 byt
  • Page 1091Fanuc C-Executer Operating Manual B-62443EN-3/03E Appendix B Index character handling cnc_machine, 374 isalnum, 113 cnc_modal, 464 isalpha, 114 cnc_rd1length, 488 iscntrl, 115 cnc_rd1punchtl, 572 isdigit, 116 cnc_rd1radius, 490 isgraph, 117 cnc_rd2length, 489 islower, 118 cnc_rd2punchtl, 576 isprint
  • Page 1092Fanuc C-Executer Operating Manual B-62443EN-3/03E cnc_t1info, 492 crt_graphic, 656 cnc_t2info, 494 crt_isnewscrn, 631 cnc_toolnum, 496 crt_opengr, 653 cnc_upend, 357 crt_pcinfo, 933 cnc_upload, 353 crt_readfkey, 658 cnc_upstart, 352 crt_setallpalette, 673 cnc_verify, 338 crt_setmode, 634 cnc_vrfend,
  • Page 1093Fanuc C-Executer Operating Manual B-62443EN-3/03E File Operation Library getgtextvector, 260 aux_file_format, 719 getimage, 261 aux_file_memcinfo, 723 getkanji, 262 aux_file_mount, 720 getlinestyle, 264 aux_file_unmount, 722 getpattern, 318 F-ROM library getphyscoord, 265 aux_from_close, 813 getpixe
  • Page 1094Fanuc C-Executer Operating Manual B-62443EN-3/03E setgtextvector, 294 getchar, 178 setlinestyle, 295 gets, 179 setpixel, 296 perror, 194 settextpoition, 297 printf, 164 settextrows, 298 putc, 180 settextwindow, 299 putchar, 181 setvideomode, 300 puts, 182 setvideomoderows, 303 remove, 153 setvieworg
  • Page 1095Fanuc C-Executer Operating Manual B-62443EN-3/03E setjmp, 148 os_clar_flg, 765 Serial Library os_delt_flg, 762 rs_buffer, 738 os_delt_sem, 768 rs_dma, 743 os_disp_mem, 774 rs_error, 965 os_make_flg, 761 rs_getc, 734 os_make_sem, 767 rs_open, 730, 733 os_new_mem, 773 rs_putc, 735 os_puls_flg, 766 rs_
  • Page 1096Fanuc C-Executer Operating Manual B-62443EN-3/03E Appendix C Character Sets FANUC Series 16/18 C Executor Half-size (single byte) character code table (for 9 inch CRT) -------------------------------------------------------------- (1) Graphic character set #l (2) Graphic character set #2 (3) Graphic
  • Page 109700000000 00000000 PY~~mo)bbNo 00000000 -3 < ,II
  • Page 109800000000 00000000 X+Wcr)lbNO : ~000000
  • Page 1099(5) Small character set -- ESC (5 DO 02 04 06 08 OA OC OE 10 12 14 16 18 1A 1C 1E 0000 I. )( # $ % 8c ’ c > * + I - . /0123456789:;<=>? 0020 0040 @~BCDEFGHIJKLMNOPQRSTUUWXYZCVl"_ 0060 0080 OOAO ooco OOEO (6) European character set -- ESC (7 0000 0020 0040 0060 0080 OOAO ooco OOEO
  • Page 1100(7) Large character set -- ESC (6 00 01 02 03 04 OS 06 07 08 09 OPr 08 OC OD OE OF 0000 0010 0020 0030 0123456789 -* 0040 ABCDEFGHIJKLMNO 0050 PQRSTUVWXYZ 0060 0070 0080 0090 OOAO OOBO ooco OODO OOEO OOFO
  • Page 1101
  • Page 1102(8) Graphic character set #l (80x25) -- ESC (1 00 02 04 06 OS OA OC OE 10 12 14 16 18 1A 1C 1E 0000 0020 0040 0060 0080 OOAO ooco OOEO (9) Standard character set (80x25) -- ESC (4 00 02 04 06 08 OA OC OE 10 12 14 16 18 1A 1C 1E 0000 0020 ! @I# 3 % 8t ’ c > * + I - . /0123456789:;<=>? 0040 @flBCDEFGH
  • Page 1103(1) Graphic character set #l -- ESC (1 00 02 04 06 08 0A 0C OE 10 12 14 16 18 1A 1C 1E 0080 ( OOEO (2) Graphic character set #2 -- ESC (2 00 02 04 06 08 ofi0C OE 10 12 14 16 18 l/jlc 1E 0080 1 OOEO 1
  • Page 11040 0 0 0 0 0 0 0 0 0 000000 ~doQ)lhNO om~oooooo 0 m
  • Page 1105(5) Small character set -- ESC (5 00 02 04 06 OS OA OC OE 10 12 14 16 18 1A 1C 1E 0000 0020 !“#8~~‘4>*+r-..0123456789:;<=>? 0040 ~~BCDEFGHIJKLMNOP~R~TU~~XYZL~l~_ 0060 0080 OOAO ooco OOEO (6) European character set -- ESC (7 0000 0020 0040 0060 0080 OOAO ooco OOEO
  • Page 1106(7) Large character set -- ESC (6 00 01 02 03 04 05 06 07 08 09 OA OB OC OD OE OF 0000 0010 0020 -* 0030 8123456789 0040 ABCDEFGHIJKLMNO 0050 PQRSTUUWXYZ 0060 0070 0080 0090 OOAO OOBO ooco OODO OOEO OOFO
  • Page 11077 -. CD cn iD 2
  • Page 1108
  • Page 1109a m 0 D ,- ;r; c- N c- D C m
  • Page 1110
  • Page 1111
  • Page 1112
  • Page 1113
  • Page 1114
  • Page 1115
  • Page 1116
  • Page 1117
  • Page 1118
  • Page 1119
  • Page 1120
  • Page 1121
  • Page 1122
  • Page 1123
  • Page 1124
  • Page 1125Printed at GE Fanuc Automation S.A. , Luxembourg September 200