+ All Categories
Home > Documents > C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library...

C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library...

Date post: 23-Mar-2018
Category:
Upload: buinhi
View: 261 times
Download: 8 times
Share this document with a friend
230
PROGRAMMING MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL A FANUC Series 31*/310*/310*s-MODEL A5 FANUC Series 31*/310*/310*s-MODEL A FANUC Series 32*/320*/320*s-MODEL A
Transcript
Page 1: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

PROGRAMMING MANUAL

B-64183EN/01

C Language Executor Library (For Conversion from PMC C Language Function)

FANUC Series 30*/300*/300*s-MODEL AFANUC Series 31*/310*/310*s-MODEL A5 FANUC Series 31*/310*/310*s-MODEL A FANUC Series 32*/320*/320*s-MODEL A

Page 2: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

� ������������������ ���������������������� �� �������

� ��������������� ��� ������ ������������������� ��������� �����

������������������������������������������������� ������������ �� ����������� ���

��������������������������������

� ������ �������������������������������������������������������������������

������� ������ ���������������������������������� �������� � ��������� �����

�� � ����������������������� ������������

�������� ���������������� ��������������������������������� ������ ������������

������������!��������!�

����� ������ �� ������������� �������������� ������������������ �� ��������

��� ���� ���������� ��������"�� ��� ���������� �� ����� ������� � ����� ����� ���� ��

������������������� ������ ������

Page 3: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B-64183EN/01 DEFINITION OF WARNING, CAUTION, AND NOTE

s-1

DEFINITION OF WARNING, CAUTION, AND NOTE This manual includes safety precautions for protecting the user and preventing damage to the machine. Precautions are classified into Warning and Caution according to their bearing on safety. Also, supplementary information is described as a Note. Read the Warning, Caution, and Note thoroughly before attempting to use the machine.

WARNING Applied when there is a danger of the user being

injured or when there is a danger of both the user being injured and the equipment being damaged if the approved procedure is not observed.

CAUTION

Applied when there is a danger of the equipment being damaged, if the approved procedure is not observed.

NOTE The Note is used to indicate supplementary

information other than Warning and Caution. • Read this manual carefully, and store it in a safe place.

Page 4: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL
Page 5: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B-64183EN/01 TABLE OF CONTENTS

c-1

TABLE OF CONTENTS

DEFINITION OF WARNING, CAUTION, AND NOTE .................................s-1 1 GETTING STARTED...............................................................................1

1.1 OVERVIEW ................................................................................................... 2 1.2 RELATED DRAWING NUMBER ................................................................... 3

2 HOW TO MAKE APPLICATION .............................................................4 2.1 INSTALLATION OF THE "C LIBRARY FOR CONVERSION" ON A

PERSONAL COMPUTER.............................................................................. 5 2.2 CNC HARDWARE ......................................................................................... 9 2.3 COMPATIBILITY WITH THE "C LIBRARY FOR C LANGUAGE BOARD" .. 10 2.4 CONVERSION POINTS .............................................................................. 13

3 FUNCTION REFERENCE .....................................................................18 3.1 FUNCTION LIST.......................................................................................... 19 3.2 SYSTEM CALL............................................................................................ 25

3.2.1 Read the Task Timer Value....................................................................................25 3.2.2 Set the Task Timer Value .......................................................................................26 3.2.3 Wait for the Timer Value .......................................................................................27 3.2.4 Wait for Time .........................................................................................................28 3.2.5 Create an Event Flag ..............................................................................................29 3.2.6 Delete the Event Flag .............................................................................................30 3.2.7 Set the Event Flag...................................................................................................31 3.2.8 Wait for the Event Flag ..........................................................................................32 3.2.9 Clear the Event Flag ...............................................................................................33 3.2.10 Set the Event Flag (Pulse type) ..............................................................................34 3.2.11 Create a Semaphore................................................................................................35 3.2.12 Delete the Semaphore.............................................................................................36 3.2.13 Set the Semaphore ..................................................................................................37 3.2.14 Wait for the Semaphore..........................................................................................38

3.3 SWITCH SCREEN....................................................................................... 39 3.3.1 Switch to the User Application Screen...................................................................39 3.3.2 Wait for Switching to the User Application Screen ...............................................40 3.3.3 Switch to the CNC Screen......................................................................................41

3.4 MDI KEYS ................................................................................................... 42 3.4.1 MDI Key Code Table .............................................................................................42

Page 6: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

TABLE OF CONTENTS B-64183EN/01

c-2

3.4.2 Read key.................................................................................................................44 3.4.3 Control a Key-in Line.............................................................................................46 3.4.4 Read Key Status .....................................................................................................49 3.4.5 Disable Function Keys ...........................................................................................50 3.4.6 Enable Function Keys ............................................................................................51 3.4.7 Read a Function Key ..............................................................................................52 3.4.8 Disable Custom Keys .............................................................................................53 3.4.9 Enable Custom Keys ..............................................................................................54

3.5 ACCESS TO THE PMC ADDRESS............................................................. 55 3.5.1 Read from the PMC Address (bit)..........................................................................56 3.5.2 Write to the PMC Address (bit) .............................................................................57 3.5.3 Read from the PMC Address (char) .......................................................................58 3.5.4 Read from the PMC Address (short) ......................................................................59 3.5.5 Read from the PMC Address (long).......................................................................60 3.5.6 Read from the PMC Address (unsigned char)........................................................61 3.5.7 Read from the PMC Address (unsigned short).......................................................62 3.5.8 Read from the PMC Address (unsigned long) .......................................................63 3.5.9 Write to the PMC Address (char)...........................................................................64 3.5.10 Write to the PMC Address (short)..........................................................................65 3.5.11 Write to the PMC Address (long)...........................................................................66 3.5.12 Write to the PMC Address (unsigned char) ...........................................................67 3.5.13 Write to the PMC Address (unsigned short) ..........................................................68 3.5.14 Write to the PMC Address (unsigned long) ...........................................................69

3.6 READ SYSTEM INFORMATION................................................................. 70 3.6.1 Read CNC Information ..........................................................................................70 3.6.2 Read Symbol and Comment in LADDER Program

(16 characters symbol is available) ........................................................................71 3.6.3 Read Symbol and Comment in LADDER Program...............................................73 3.6.4 Read a Message in LADDER Program ..................................................................75

3.7 ACCESS TO THE EXTENDED NONVOLATILE MEMORY ........................ 76 3.7.1 Read from the Extended Nonvolatile Memory ......................................................76 3.7.2 Write to the Extended Nonvolatile Memory ..........................................................77 3.7.3 Get Size of the Extended Nonvolatile Memory .....................................................78

3.8 CHARACTER DISPLAY .............................................................................. 79 3.8.1 Color Palette for the Character Display..................................................................79 3.8.2 Coordinates of the Character Screen ......................................................................80 3.8.3 Character Code .......................................................................................................81

Page 7: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B-64183EN/01 TABLE OF CONTENTS

c-3

3.8.4 Initialize the Character Screen (80 Columns x 30 Lines)......................................82 3.8.5 Initialize a Character Screen

(80 Columns x 25 Lines or 40 Columns x 16 Lines) .............................................83 3.8.6 Erase the Entire Screen...........................................................................................84 3.8.7 Clear Lines .............................................................................................................85 3.8.8 Clear Columns........................................................................................................86 3.8.9 Set a Display Position.............................................................................................87 3.8.10 Set a Display Attribute ...........................................................................................88 3.8.11 Change Attribute of the Characters Being Displayed ............................................89 3.8.12 Display ASCII Characters ......................................................................................90 3.8.13 Display Characters (Kanji, Hiragana and Special Characters) ..............................91 3.8.14 Display Hex Size Characters ..................................................................................93 3.8.15 Display Cursor........................................................................................................94 3.8.16 Display Characters (ASCII, Kanji and Hiragana) .................................................96 3.8.17 Save the Character Screen ......................................................................................98 3.8.18 Restore the Character Screen................................................................................100 3.8.19 Control the Screen ................................................................................................101 3.8.20 Set Background Color of the Character Screen....................................................102 3.8.21 Set Palette for Character Screen ...........................................................................103 3.8.22 Initialize the Character Screen (74 Columns x 27 Lines)....................................104 3.8.23 Initialize the Character Screen (74 Columns x 30 Lines)....................................105 3.8.24 Initialize printf() ...................................................................................................106

3.9 GRAPHIC DISPLAY .................................................................................. 107 3.9.1 Color Palette for Graphic Display ........................................................................107 3.9.2 Coordinates of the Graphic Screen.......................................................................108 3.9.3 Open the Graphic Screen......................................................................................109 3.9.4 Close the Graphic Screen .....................................................................................110 3.9.5 Clear the Graphic Screen......................................................................................111 3.9.6 Display or Hide the Graphic Screen.....................................................................112 3.9.7 Set a Graphic Line Type.......................................................................................113 3.9.8 Set a Graphic Color ..............................................................................................114 3.9.9 Draw Straight Lines..............................................................................................115 3.9.10 Draw an Arc .........................................................................................................116 3.9.11 Paint ....................................................................................................................118 3.9.12 Shift ....................................................................................................................119 3.9.13 Get Graphic Screen Status....................................................................................120 3.9.14 Erase the Square ...................................................................................................121

Page 8: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

TABLE OF CONTENTS B-64183EN/01

c-4

3.9.15 Set Palette for the Graphic Screen........................................................................122 3.10 READER / PUNCHER INTERFACE.......................................................... 123

3.10.1 Open the Reader / Puncher Interface....................................................................124 3.10.2 Close the Reader / Puncher Interface ...................................................................127 3.10.3 Read from the Reader / Puncher Interface............................................................128 3.10.4 Write to the Reader / Puncher Interface ...............................................................129 3.10.5 Open the Reader / Puncher Interface (for FANUC Handy File) ..........................130 3.10.6 Get the File Information .......................................................................................134 3.10.7 Delete the File ......................................................................................................136 3.10.8 Open the Reader / Puncher Interface....................................................................138 3.10.9 Close the Reader / Puncher Interface ...................................................................141 3.10.10 Read from the Reader / Puncher Interface............................................................142 3.10.11 Write to the Reader / Puncher Interface ...............................................................143 3.10.12 Open the Reader / Puncher Interface (for FANUC Handy File) ..........................144 3.10.13 Get the File Information .......................................................................................147 3.10.14 Delete the File ......................................................................................................148

3.11 CNC WINDOW .......................................................................................... 150 3.11.1 CNC Window Function (Read) ............................................................................150 3.11.2 CNC Window Function (Write) ...........................................................................152 3.11.3 External Data Input ..............................................................................................154

3.12 CNC PROGRAM ....................................................................................... 155 3.12.1 Start Registration of the CNC Program................................................................155 3.12.2 Register the CNC Program...................................................................................156 3.12.3 End Registration of the CNC Program.................................................................158 3.12.4 Start DNC running of the CNC Program .............................................................159 3.12.5 Run the CNC Program (DNC running) ................................................................161 3.12.6 End DNC Running of the CNC Program .............................................................163 3.12.7 Search the CNC Program (Supported 8 Digits Program Number).......................164 3.12.8 Search the CNC Program .....................................................................................165 3.12.9 Delete All CNC Programs ....................................................................................166 3.12.10 Delete the CNC Program (Supported 8 Digits Program Number) .......................167 3.12.11 Delete the CNC Program......................................................................................168 3.12.12 Start Reading of the CNC Program (Supported 8 Digits Program Number) .......169 3.12.13 Start Reading of the CNC Program......................................................................170 3.12.14 Read the CNC Program........................................................................................171 3.12.15 End Reading of the CNC Program .......................................................................173 3.12.16 Read the CNC Program Memory Information .....................................................174

Page 9: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B-64183EN/01 TABLE OF CONTENTS

c-5

3.12.17 Start Reading of the CNC Program List (Supported 8 Digits Program Number) 175 3.12.18 Start Reading of the CNC Program List...............................................................177 3.12.19 Read the CNC Program List.................................................................................178 3.12.20 End Reading of the Program List .........................................................................180 3.12.21 Start Registration of the CNC Program................................................................181 3.12.22 Register the CNC Program...................................................................................182 3.12.23 End Registration of the CNC Program.................................................................184 3.12.24 Start DNC running of the CNC Program .............................................................185 3.12.25 Run the CNC Program (DNC running) ................................................................186 3.12.26 End DNC Running of the CNC Program .............................................................188 3.12.27 Search the CNC Program (Supported 8 Digits Program Number).......................189 3.12.28 Search the CNC Program .....................................................................................190 3.12.29 Delete All CNC Programs ....................................................................................191 3.12.30 Delete the CNC Program (Supported 8 Digits Program Number) .......................192 3.12.31 Delete the CNC Program......................................................................................193 3.12.32 Start Reading of the CNC Program (Supported 8 Digits Program Number) .......194 3.12.33 Start Reading of the CNC Program......................................................................195 3.12.34 Read the CNC Program........................................................................................196 3.12.35 End Reading of the CNC Program .......................................................................198 3.12.36 Read the CNC Program Memory Information .....................................................199 3.12.37 Start Reading of the CNC Program List (Supported 8 Digits Program Number) 200 3.12.38 Start Reading of the CNC Program List...............................................................201 3.12.39 Read the CNC Program List.................................................................................202 3.12.40 End Reading of the Program List .........................................................................204

3.13 CHARACTER CODE CONVERSION ........................................................ 205 3.13.1 Convert Characters from ASCII to ISO Code ......................................................205 3.13.2 Convert Characters from ISO to ASCII Code ......................................................206

4 CHARACTER CODE (KANJI, HIRAGANA AND OTHERS)..............207

Page 10: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL
Page 11: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 1.GETTING STARTED

-1-

1 GETTING STARTED

Page 12: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

1.GETTING STARTED B- 64183EN/01

-2-

1.1 OVERVIEW The "C language executor library (for conversion from PMC C language)" is for the Series 30i/ 31i/ 32i and provides functions that are compatible with "Series 15i/ 150i/ 16i/ 160i/ 160is/ 18i/ 180i/ 180is/ 21i/ 210i/ 210is C-language library for C language board". If you use the "C language executor library (for conversion from PMC C language)" when you convert the C language application running on the "Series 15i/ 150i/ 16i/ 160i/ 160is/ 18i/ 180i/ 180is/ 21i/ 210i/ 210is C language board" to one running on the "Series 30i/ 31i/ 32i C language executor", there are following merits. ・ You can save your efforts to convert the calling of C library

functions in the C language program. In this manual, the function reference for the "C language executor library (for conversion from PMC C language)" is mainly described. About details of the "Series 30i/ 31i/ 32i C language executor", refer to the following manual.

Manual Drawing number Series 30i/ 300i/ 300is-MODEL A Series 31i/ 310i/ 310is-MODEL A Series 31i/ 310i/ 310is-MODEL A5 Series 32i/ 320i/ 320is-MODEL A C language executor operator's manual

B-63944EN-3

In this manual, following abbreviations will be used.

Item Abbreviation C language executor library (for conversion from PMC C language)

C library for conversion

Series 15i/ 150i/ 16i/ 160i/ 160is/ 18i/ 180i/ 180is/ 21i/ 210i/ 210is C language board

C language board

Series 15i/ 150i/ 16i/ 160i/ 160is/ 18i/ 180i/ 180is/ 21i/ 210i/ 210is C language library for C language board

C library for C language board

C language library (for C language executor) C library for C executor

Page 13: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 1.GETTING STARTED

-3-

1.2 RELATED DRAWING NUMBER The related drawing number is shown below.

Drawing number Name Contents A02B-0303-J734 Macro executor +

C language executor This is the execution option for C executor.

A02B-0303-J738#1M Custom software size 1 MB A02B-0303-J738#2M Custom software size 2 MB A02B-0303-J738#3M Custom software size 3 MB A02B-0303-J738#4M Custom software size 4 MB A02B-0303-J738#5M Custom software size 5 MB A02B-0303-J738#6M Custom software size 6 MB

This is the memory option for C executor. The system of C executor uses about 700 KB memories and the "C library for conversion" uses about 100 KB memories. Therefore, the memory size that you can use is smaller than the total memory size. [Memory size] = [Total memory size] – [about 800 KB]

A02B-0303-J736 C language executor additional SRAM This is the nonvolatile memory option. (Optional)You can use 192 KB of nonvolatile memory.

A02B-0303-J993#64K Nonvolatile memory expansion 64 KB A02B-0303-J993#256K Nonvolatile memory expansion 256 KB

This is the nonvolatile memory option. (Optional)You can use 64 KB or 256 KB of nonvolatile memory. To access this memory, you have to use the function pmc_rdkpm(), pmc_wrkpm(), pl_kpmrd() or pl_kpmwrt().

A08B-9010-J610#EN07 C language library (for C language executor)

This is the "C language library" for the C executor.

B-63944JA-3 Series 30i/ 300i/ 300is-MODEL A Series 31i/ 310i/ 310is-MODEL A Series 31i/ 310i/ 310is-MODEL A5 Series 32i/ 320i/ 320is-MODEL A C language executor operator's manual

This is the manual for the C executor.

A08B-9210-J719#ZZ11 C language executor library (for conversion from PMC C language)

This is the "C library for conversion". If you use this library, you can save efforts to convert the C language program running on a "C language board" to one running on a "30i/ 31i/ 32i C executor".

WindRiver Diab C/C++ Power-PC Compiler

This is the C/C++ compiler and linker.

Page 14: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

2.HOW TO MAKE APPLICATION B- 64183EN/01

-4-

2 HOW TO MAKE APPLICATION

Page 15: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 2.HOW TO MAKE APPLICATION

-5-

2.1 INSTALLATION OF THE "C LIBRARY FOR CONVERSION" ON A PERSONAL COMPUTER

The development environment of C executor

The "C library for conversion" has to be installed on the development environment of C executor on a personal computer. If a C compiler and the "C library for C executor" have not been installed on a personal computer, install them. About the installation of C compiler and the "C library for C executor", refer to the following manual. ・ "C language executor operator's manual B-63944EN-3"

C library for conversion The files and directories structure of the installation CD-ROM of the "C library for conversion" is shown below.

pmclib.h Header file clblib.o Library file The example of files and directories structure of the development environment of C executor is shown below. To install the "C library for conversion", (1) Copy the file "pmclib.h" into "inc" directory. (2) Copy the file "clblib.o" into "lib" directory.

Modification of "makefile" To use the "C library for conversion", you have to bind the "clblib.o" to the executable file when a linking process. To do this, you should apply modifications, that is to add the file "$(FCLIB)¥clblib.o" to the description of source files of linking command, in the "makefile".

<CD-ROM>

inc

pmclib.h

lib

clblib.o

<Install directory of the C library for C executor>

inc

<- pmclib.h

lib

<- clblib.o

man

tool

user

Page 16: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

2.HOW TO MAKE APPLICATION B- 64183EN/01

-6-

The example of modification of "makefile" is shown below. The number of modification point is 10.

# Make file for FS30i C Executor user application # # This makefile is for NMAKE.EXE #

# 2000.09.10 FANUC LTD. # 2000.09.12 ... #------------------------------------------------------------------------------ .¥STEP1¥STEP1_1.MAP : $(TASK1) $(RAMOBJ) $(SELEC) .¥STEP1¥STEP1_1.LNK $(TOOL)¥STEP1.LNK 1 $(LINK) -@<<$(TMP_FILE) .¥STEP1¥STEP1_1.LNK -o .¥STEP1¥STEP1_1.ELF $(TASK1) $(RAMOBJ) $(FCLIB)¥tsk1_lib.o $(FCLIB)¥cexe_lib.o $(FCLIB)¥clblib.o $(FCLIB)¥jump_tbl.o -@O=.¥STEP1¥STEP1_1.MAP <<NOKEEP $(TASK1LEN) : .¥STEP1¥STEP1_1.MAP $(TOOL)¥GAWK -v task=1 -f $(TOOL)¥CHK_LEN1.AWK .¥STEP1¥STEP1_1.MAP > $(TASK1LEN) #------------------------------------------------------------------------------ .¥STEP1¥STEP1_2.MAP : $(TASK2) $(RAMOBJ) $(SELEC) .¥STEP1¥STEP1_2.LNK $(TOOL)¥STEP1.LNK 2 $(LINK) -@<<$(TMP_FILE) .¥STEP1¥STEP1_2.LNK -o .¥STEP1¥STEP1_2.ELF $(TASK2) $(RAMOBJ) $(FCLIB)¥tsk2_lib.o $(FCLIB)¥cexe_lib.o $(FCLIB)¥clblib.o $(FCLIB)¥jump_tbl.o -@O=.¥STEP1¥STEP1_2.MAP <<NOKEEP $(TASK2LEN) : .¥STEP1¥STEP1_2.MAP $(TOOL)¥GAWK -v task=2 -f $(TOOL)¥CHK_LEN1.AWK .¥STEP1¥STEP1_2.MAP > $(TASK2LEN) #------------------------------------------------------------------------------ .¥STEP1¥STEP1_3.MAP : $(TASK3) $(RAMOBJ) $(SELEC) .¥STEP1¥STEP1_3.LNK $(TOOL)¥STEP1.LNK 3 $(LINK) -@<<$(TMP_FILE) .¥STEP1¥STEP1_3.LNK -o .¥STEP1¥STEP1_3.ELF $(TASK3) $(RAMOBJ) $(FCLIB)¥tsk3_lib.o $(FCLIB)¥cexe_lib.o $(FCLIB)¥clblib.o $(FCLIB)¥jump_tbl.o -@O=.¥STEP1¥STEP1_3.MAP <<NOKEEP $(TASK3LEN) : .¥STEP1¥STEP1_3.MAP $(TOOL)¥GAWK -v task=3 -f $(TOOL)¥CHK_LEN1.AWK .¥STEP1¥STEP1_3.MAP > $(TASK3LEN) ...

Page 17: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 2.HOW TO MAKE APPLICATION

-7-

#------------------------------------------------------------------------------ .¥STEP1¥STEP1_4.MAP : $(TASK4) $(RAMOBJ) $(SELEC) .¥STEP1¥STEP1_4.LNK $(TOOL)¥STEP1.LNK 4 $(LINK) -@<<$(TMP_FILE) .¥STEP1¥STEP1_4.LNK -o .¥STEP1¥STEP1_4.ELF $(TASK4) $(RAMOBJ) $(FCLIB)¥tsk4_lib.o $(FCLIB)¥cexe_lib.o $(FCLIB)¥clblib.o $(FCLIB)¥jump_tbl.o -@O=.¥STEP1¥STEP1_4.MAP <<NOKEEP $(TASK4LEN) : .¥STEP1¥STEP1_4.MAP $(TOOL)¥GAWK -v task=4 -f $(TOOL)¥CHK_LEN1.AWK .¥STEP1¥STEP1_4.MAP > $(TASK4LEN) #------------------------------------------------------------------------------ .¥STEP1¥STEP1_5.MAP : $(TASK5) $(RAMOBJ) $(SELEC) .¥STEP1¥STEP1_5.LNK $(TOOL)¥STEP1.LNK 5 $(LINK) -@<<$(TMP_FILE) .¥STEP1¥STEP1_5.LNK -o .¥STEP1¥STEP1_5.ELF $(TASK5) $(RAMOBJ) $(FCLIB)¥tsk5_lib.o $(FCLIB)¥cexe_lib.o $(FCLIB)¥clblib.o $(FCLIB)¥jump_tbl.o -@O=.¥STEP1¥STEP1_5.MAP <<NOKEEP $(TASK5LEN) : .¥STEP1¥STEP1_5.MAP $(TOOL)¥GAWK -v task=5 -f $(TOOL)¥CHK_LEN1.AWK .¥STEP1¥STEP1_5.MAP > $(TASK5LEN) #------------------------------------------------------------------------------ $(TASKALEN) : $(CHK_LEN) echo s/SRAM_LEN/$(SRAM_LEN)/g> $(TASKALEN) $(TOOL)¥GAWK -f $(TOOL)¥CHK_LEN2.AWK <<$(TMP_FILE) >> $(TASKALEN) $(CHK_LEN) <<NOKEEP #------------------------------------------------------------------------------ TASK1.ELF : $(TASKALEN) $(SELEC) .¥STEP2¥TASK1.DAT $(TOOL)¥STEP2.LNK 1 $(TOOL)¥SED -f $(TASKALEN) .¥STEP2¥TASK1.DAT > .¥STEP2¥TASK1.LNK $(LINK) -@<<$(TMP_FILE) .¥STEP2¥TASK1.LNK -o TASK1.ELF $(TASK1) $(RAMOBJ) $(FCLIB)¥tsk1_lib.o $(FCLIB)¥cexe_lib.o $(FCLIB)¥clblib.o $(FCLIB)¥jump_tbl.o -@O=.¥map¥task1.map <<NOKEEP #------------------------------------------------------------------------------ TASK2.ELF : $(TASKALEN) $(SELEC) .¥STEP2¥TASK2.DAT $(TOOL)¥STEP2.LNK 2 $(TOOL)¥SED -f $(TASKALEN) .¥STEP2¥TASK2.DAT > .¥STEP2¥TASK2.LNK $(LINK) -@<<$(TMP_FILE) .¥STEP2¥TASK2.LNK -o TASK2.ELF $(TASK2) $(RAMOBJ) $(FCLIB)¥tsk2_lib.o $(FCLIB)¥cexe_lib.o $(FCLIB)¥clblib.o $(FCLIB)¥jump_tbl.o -@O=.¥map¥task2.map <<NOKEEP #------------------------------------------------------------------------------ ...

Page 18: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

2.HOW TO MAKE APPLICATION B- 64183EN/01

-8-

#------------------------------------------------------------------------------ TASK3.ELF : $(TASKALEN) $(SELEC) .¥STEP2¥TASK3.DAT $(TOOL)¥STEP2.LNK 3 $(TOOL)¥SED -f $(TASKALEN) .¥STEP2¥TASK3.DAT > .¥STEP2¥TASK3.LNK $(LINK) -@<<$(TMP_FILE) .¥STEP2¥TASK3.LNK -o TASK3.ELF $(TASK3) $(RAMOBJ) $(FCLIB)¥tsk3_lib.o $(FCLIB)¥cexe_lib.o $(FCLIB)¥clblib.o $(FCLIB)¥jump_tbl.o -@O=.¥map¥task3.map <<NOKEEP #------------------------------------------------------------------------------ TASK4.ELF : $(TASKALEN) $(SELEC) .¥STEP2¥TASK4.DAT $(TOOL)¥STEP2.LNK 4 $(TOOL)¥SED -f $(TASKALEN) .¥STEP2¥TASK4.DAT > .¥STEP2¥TASK4.LNK $(LINK) -@<<$(TMP_FILE) .¥STEP2¥TASK4.LNK -o TASK4.ELF $(TASK4) $(RAMOBJ) $(FCLIB)¥tsk4_lib.o $(FCLIB)¥cexe_lib.o $(FCLIB)¥clblib.o $(FCLIB)¥jump_tbl.o -@O=.¥map¥task4.map <<NOKEEP #------------------------------------------------------------------------------ TASK5.ELF : $(TASKALEN) $(SELEC) .¥STEP2¥TASK5.DAT $(TOOL)¥STEP2.LNK 5 $(TOOL)¥SED -f $(TASKALEN) .¥STEP2¥TASK5.DAT > .¥STEP2¥TASK5.LNK $(LINK) -@<<$(TMP_FILE) .¥STEP2¥TASK5.LNK -o TASK5.ELF $(TASK5) $(RAMOBJ) $(FCLIB)¥tsk5_lib.o $(FCLIB)¥cexe_lib.o $(FCLIB)¥clblib.o $(FCLIB)¥jump_tbl.o -@O=.¥map¥task5.map <<NOKEEP ...

Page 19: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 2.HOW TO MAKE APPLICATION

-9-

2.2 CNC HARDWARE The comparison between the hardware, to execute the C language application, for the "Series 30i/ 31i/ 32i C executor" and one for the "Series 15i/ 16i/ 18i/ 21i C language board" is shown below.

Item Series 30i/ 31i/ 32iC executor

Series 16i/ 18i/ 21i C language board

Series 15i C language board

CPU PowerPC compatible CPU

80486DX2 80486DX2

Program code 2 MB in the maximum (Optional)

2 MB in the maximum (Optional)

Work memory

About 5.2 MB in the maximum (Optional) *Note 1 256 KB in the

maximum 256 KB in the

maximum Work memory (Nonvolatile)

About 250 KB in the maximum (Optional) *Note 2, 3

64 KB in the maximum (Optional)

64 KB in the maximum (Optional)

Display 10.4" color LCD 10.4" color LCD 9.5" monochrome

LCD 8.4" color LCD

7.2" monochrome LCD

10.4" color LCD 9.5" monochrome

LCD

RS-232C 2ch 2ch 2ch Memory card Supported Not supported Not supported Touch panel Supported Not supported Not supported

NOTE 1. When a "Custom software size 6MB" option,

A02B-0303-J738#6M, is equipped and the "C library for conversion" is used, you can use about 5.2 MB memory.

2. When a "C language executor additional SRAM" option, A02B-0303-J736, is equipped, you can use about 250 KB nonvolatile memory.

3. When a "Nonvolatile memory expansion 256 KB" option, A02B-0303-J993#256K, is equipped, you can use additional 256 KB of nonvolatile memory.

Page 20: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

2.HOW TO MAKE APPLICATION B- 64183EN/01

-10-

2.3 COMPATIBILITY WITH THE "C LIBRARY FOR C LANGUAGE BOARD"

Overview

The "C library for conversion" is designed to be compatible with the "C library for C language board". However, some functions are unavailable and behavior of some functions is different from "C library for C language board" because of the difference of hardware and CNC system software, and the restriction of the C executor. In this case, to use a similar conventional function of C executor is worth considering. The software block diagram of "C library for conversion" is shown below.

C language application

C library for C executor

C library for conversion

CNC system software

Display driver

Keyboarddriver

RS-232Cdriver

Memory card driver

Other driver

Many functions of the "C library for conversion" are designed to call some functions of the "C library for C executor" to carry out the purpose. This means that the "C library for conversion" have tendency to be slower than the "C library for C executor". Furthermore, the simultaneous use of some similar function of the "C library for C executor" may be restricted, such as functions related to RS-232C and CNC program. If the execution speed or above restriction turn into a grave issue, to use a similar conventional function of C executor is worth considering.

The different points from the "C library for C language board"

The differences between the "C library for conversion" and the "C library for C language board" are shown below. About the details, see the reference of each function.

- System call Following functions are unavailable. ・ os_chng_pri(), os_new_mem(), os_disp_mem(), os_rep_mem(),

os_mak2_sem(), os_queu_sem(), os_make_mbx(), os_delt_mbx(), os_read_mbx(), os_red2_mbx(), os_writ_mbx(), os_wrt2_mbx(), os_make_pkt(), os_delt_pkt(), os_send_pkt(), os_recv_pkt(), os_mark_pkt(), os_rmrk_pkt(), os_curr_tsk()

-

Page 21: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 2.HOW TO MAKE APPLICATION

-11-

- Switch screen Some behaviors of the following function are different. ・ pl_pcmdi()

- MDI keys

Following functions are unavailable. ・ pl_fcustom_ign(), pl_fcustom_avail()

Some behaviors of following functions are different. ・ pl_keysts(), pl_fkey_ign(), pl_fkey_avail()

- Access to the PMC address

Following functions are unavailable. ・ pl_memc(), pl_memuc(), pl_mems(), pl_memus(), pl_meml(),

pl_memul(), pl_memc2(), pl_memuc2(), pl_mems2(), pl_memus2(), pl_meml2(), pl_memul2()

Following functions are added. ・ pl_memcrd2(), pl_memucrd2(), pl_memsrd2(), pl_memusrd2(),

pl_memlrd2(), pl_memulrd2(), pl_memcwrt2(), pl_memucwrt2(), pl_memswrt2(), pl_memuswrt2(), pl_memlwrt2(), pl_mwmulwrt2()

- Read system information

Some behaviors of the following function are different. ・ pl_sysinfrd()

The following function is added. ・ pl_symcmt2()

- Access to the extended nonvolatile memory

The "Nonvolatile memory expansion 256 KB" option is added.

- Character display Following functions are unavailable. ・ pl_dspopen2(), pl_dspopen3()

Some behaviors of following functions are different. ・ pl_dspopen4(), pl_dspstrw(), pl_cursor(), initreq_printf()

- Graphic display

The following function is unavailable. ・ pl_grpopen2()

Some behavior of the following function is different. ・ pl_grparc()

Page 22: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

2.HOW TO MAKE APPLICATION B- 64183EN/01

-12-

- Reader / puncher interface The baud rate setting "19200 bps" is unavailable. The simultaneous use of similar function in "C library for C executor" is restricted.

- CNC window

The following function is unavailable. ・ pl_exin()

Some behaviors of following functions are different. ・ pl_windr(), pl_windw()

- CNC program

The following functions are unavailable. ・ pl_nc_vrfstart(), pl_nc_verify(), pl_nc_vrfend(),

pl_nc_vrfstart2(), pl_nc_verify2(), pl_nc_vrfend2() The simultaneous use of similar function in "C library for C executor" is restricted.

- Character code conversion

All functions are compatible.

- Floating point All functions defined in the file "math.h" are available. There may be some difference of accuracy because the CPU and the C compiler are different.

Page 23: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 2.HOW TO MAKE APPLICATION

-13-

2.4 CONVERSION POINTS Conversion points from C language board to C executor are shown below.

C Compiler Followings are conversion points caused by the differences of C compiler.

Item

30i/ 31i/ 32i C executor Diab C/C++

15i/ 16i/ 18i/ 21i C language board

INTEL i-C286

Conversion Points

Addressing 32 bit addressing 16 bit addressing The addressing size is extended from 16 bits to 32 bits. You can access memory over 64 KB size.

Size of "int" 4 bytes 2 bytes The size of "int" is different. The program, that the size of "int" is assumed 2 bytes, has to be modified.

Size of pointer 4 bytes 2 bytes (near) 4 bytes (far)

The size of pointer is different. The program, that the size of pointer is assumed 2 bytes, has to be modified.

char 1 byte 1 byte short 2 bytes 2 bytes long 4 bytes 2 bytes float 4 bytes 2 bytes

double 8 bytes 2 bytes

Data alignment

pointer 4 bytes 2 bytes

The default setting of data alignment is different. The program, that the location address of a member in a structure is assumed, has to be modifiled.

Byte order Big endian Little endian The byte order is different. The program, that the byte order is assumed little endian, has to be modified.

Syntax checking of compiler

Stricter Looser The syntax checking of a C compiler becomes stricter.

Page 24: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

2.HOW TO MAKE APPLICATION B- 64183EN/01

-14-

Tasks The differences between task on "30i/ 31i/ 32i C executor" and task on "15i/ 16i/ 18i/ 21i C language board" are shown below.

Item

30i/ 31i/ 32i C executor

15i/ 16i/ 18i/ 21i C language board

Number of tasks 5 in the maximum 16 in the maximum Task priority Fixed Programmable

Execution cycle Fixed Programmable Other character The purpose of each

task have been defined and fixed.

All tasks have a same character.

On "C executor", you can use up to five tasks. The purpose of an each task has been defined and an each task will executed automatically in certain cycle with certain task priority. The characters of each task on C executor are shown below.

CNC System Task (Axes Control etc.) High Real-time Custom Macro

(A-5) High-level Task CNC System Task (Preparing etc.) Auxiliary Macro of Macro Executor

(A-3) Alarm Task (A-2) Communication Task

CNC System Task(Display etc.)

(A-1) Main Task

(A-4) Window Task

Low Priority

(A-1) Main task (Priority: Low) This task is to execute a process for user application screen. In

this task, you can use almost all the library functions. When the user application screen is changed to another screen, this task is automatically suspended by the system. When the user application screen is displayed again, this task is automatically executed again. If no background process is necessary in the user application, you should describe all programs in this task.

(A-2) Communication task (Priority: Middle) This task is to execute a background communication process

using RS-232C. In this task, the use of some kind of functions is restricted.

You should describe a background communication process using RS-232C in this task. If the background communication process is not required, this means that the communication process runs only on the user screen, you should describe it in the Main task.

(A-3) Alarm task (Priority: Middle) This task is to execute a background process. In this task, the use

of some kind of functions is restricted. This task is executed automatically and cyclically. Its execution

cycle occasionally may changes because of the busy status of the

Page 25: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 2.HOW TO MAKE APPLICATION

-15-

CNC system software. Therefore, you should describe background process, which does not require strict cyclic execution, in this task.

(A-4) Window task (Priority: Low) This task is to execute a virtual machine operator's panel function

or virtual keyboard function using a touch panel. In this task, the use of some kind of functions is restricted.

(A-5) High-level task (Priority: High) This task is to execute a background process that requires a short

and accurate execution cycle. The priority of this task is very high, this means that a large process in this task may have effect on the execution of CNC system software. Carefully you should select the process running in this task.

In this task, the use of some kind of functions is restricted. The functions that you can use are described in the following manuals. - "3.1 Function List" in this manual - "C language executor operator's manual, B-63944EN-3,

Function List" The details of the High-level task are described in the following

manual. - "C language executor operator's manual, B-63944EN-3,

High-level Task" When you convert a C program running on "C language board" to "C executor", you should assign all tasks on C language board to five tasks on C executor. The assignment policy is shown below. (1) Classify all tasks on "C language board" under following four

types. (B-1) Background process (High priority) Select process carefully that has to be executed in high and

accurate cycle such a machine and a CNC control. (B-2) Background process (Low priority) Select process that is nearly executed in cyclically. (B-3) Background process (RS-232C) Select RS-232C process that has to be executed in

background on any screens. (B-4) User application screen process Select process that is executed when a user application

screen is displayed, such a displaying process, key handling and so on. You should select a RS-232C process that is only executed on user screen too.

Page 26: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

2.HOW TO MAKE APPLICATION B- 64183EN/01

-16-

(2) You should describe above classified process to following each task on C executor.

Classification

in (1) Tasks

on C executor (B-1) (A-5) High-level task (B-2) (A-3) Alarm task (B-3) (A-2) Communication task (B-4) (A-1) Main task

Using functions When you use the "C library for conversion", you can use both functions of "C library for conversion" and "C library for C executor". Using the "C library for conversion", you can save your efforts to convert the calling of C library functions in the C language program. Furthermore, you can also use the rich functions of the "C library for C executor". However, the mixed use of some kind of functions in each library may be restricted, such as RS-232C functions and CNC program functions. About the details, refer to the following manual.

・ "3.10 READER / PUNCHER INTERFACE" in this manual ・ "3.12 CNC PROGRAM" in this manual

By the library structure, the "C library for conversion" have tendency to be slower than the "C library for C executor". If the slower execution speed of the user program turn into grave issue, to use a similar conventional function of "C library for C executor" is worth considering. If you develop a new user application, we recommend that you use the rich functions in "C library for C executor" rather than "C library for conversion".

Common variables You should define common variables in the file "DRAMVAR.C".

Nonvolatile variables There are two types of nonvolatile memory. The way to access is different between them. If you use nonvolatile memory area newly, the type (1) is recommended because of the easy programming. (1) "C language executor additional SRAM (A02B-0303-J736)" You can use about 250 KB nonvolatile memory. In addition, you

can program and use it by the description of normal C language sentence.

(2) "Nonvolatile memory expansion 64 KB (A02B-0303-J993#64K)" or "Nonvolatile memory expansion 256 KB (A02B-0303-J993#256K)" You can use 64 KB or 256 KB nonvolatile memory. You can access it using the function pl_kpmrd() or pl_kpmwrt().

Page 27: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 2.HOW TO MAKE APPLICATION

-17-

PMC address The byte order is different between "C executor" and "C language board" because they have different type of CPU. This means that the direct accessing using a pointer is not compatible between them. Therefore, following functions are unavailable in "C library for conversion". ・ pl_memc(), pl_memuc(), pl_mems(), pl_memus(), pl_meml(),

pl_memul() ・ pl_memc2(), pl_memuc2(), pl_mems2(), pl_memus2(),

pl_meml2(), pl_memul2() You should use functions "pmc_rdpmcrng()" and "pmc_wrpmcrng()" in "C library for C executor" or following new functions in "C library for conversion" ・ pl_memcrd2(), pl_memucrd2(), pl_memsrd2(), pl_memusrd2(),

pl_memlrd2(), pl_memulrd2() ・ pl_memcwrt2(), pl_memucwrt2(), pl_memswrt2(),

pl_memuswrt2(), pl_memlwrt2(), pl_mwmulwrt2() The example using "C library for conversion" is shown below. Before) num = *pl_mems2(id, offset); num |= 0x8000; *pl_mems2(id, offset) = num; After) num = pl_memsrd2(id, offset, NULL); num |= 0x8000; pl_memswrt2(id, offset, num);

Page 28: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-18-

3 FUNCTION REFERENCE

Page 29: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-19-

3.1 FUNCTION LIST

SYSTEM CALL No. Name Content Available

task 3.2.1 os_show_tim() Read the Task Timer Value MWAC 3.2.2 os_set_tim() Set the Task Timer Value MWAC 3.2.3 os_sync_tim() Wait for the Timer Value MWAC 3.2.4 os_wait_tim() Wait for Time MWAC 3.2.5 os_make_flg() Create an Event Flag MAC 3.2.6 os_delt_flg() Delete the Event Flag MAC 3.2.7 os_sign_flg() Set the Event Flag MAC 3.2.8 os_wait_flg() Wait for the Event Flag MAC 3.2.9 os_clar_flg() Clear the Event Flag MAC 3.2.10 os_puls_flg() Set the Event Flag (Pulse type) MAC 3.2.11 os_make_sem() Create a Semaphore MAC 3.2.12 os_delt_sem() Delete the Semaphore MAC 3.2.13 os_sign_sem() Set the Semaphore MAC 3.2.14 os_wait_sem() Wait for the Semaphore MAC

- os_chng_pri() Change the Task Priority - - os_new_mem() Allocate Memory - - os_disp_mem() Free Memory - - os_repo_mem() Get Memory Information - - os_mak2_sem() Create a Semaphore (Exclusive control type) - - os_queu_sem() Change the Semaphore Type - - os_make_mbx() Create a Mailbox - - os_delt_mbx() Delete the Mailbox - - os_read_mbx() Receive Message (4 bytes) - - os_red2_mbx() Receive Message (8 bytes) - - os_writ_mbx() Send Message (4 bytes) - - os_wrt2_mbx() Send Message (8 bytes) - - os_make_pkt() Create a Packet - - os_delt_pkt() Delete the Packet - - os_send_pkt() Send the Packet - - os_recv_pkt() Receive a Packet - - os_mark_pkt() Set Mark to the Packet - - os_rmrk_pkt() Clear Mark to the Packet - - os_curr_tsk() Get Task ID -

M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

SWITCH SCREEN No. Name Content Available

task 3.3.1 pl_pcmdi() Switch to the User Application Screen MWAC 3.3.2 pl_pcmdi_wait() Wait for Switching to the User Application Screen M 3.3.3 pl_ncmdi() Switch to the CNC Screen MWAC

M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

Page 30: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-20-

MDI KEYS No. Name Content Available

task 3.4.2 pl_mdikey() Read key M 3.4.3 pl_keydef() Control a Key-in Line M 3.4.4 pl_keysts() Read Key Status M 3.4.5 pl_fkey_ign() Disable Function Key M 3.4.6 pl_fkey_avail() Enable Function Keys M 3.4.7 pl_fkey_sts() Read a Function Key M 3.4.8 pl_fcustom_ign() Disable Custom Keys M 3.4.9 pl_fcustom_avail() Enable Custom Keys M

M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

ACCESS TO THE PMC ADDRESS No. Name Content Available

task 3.5.1 pl_membrd2() Read from the PMC Address (bit) MWACH 3.5.2 pl_membwrt2() Write to the PMC Address (bit) MWACH 3.5.3 pl_memcrd2() Read from the PMC Address (char) MWACH 3.5.4 pl_memsrd2() Read from the PMC Address (short) MWACH 3.5.5 pl_memlrd2() Read from the PMC Address (long) MWACH 3.5.6 pl_memucrd2() Read from the PMC Address (unsigned char) MWACH 3.5.7 pl_memusrd2() Read from the PMC Address (unsigned short) MWACH 3.5.8 pl_memulrd2() Read from the PMC Address (unsigned long) MWACH 3.5.9 pl_memcwrt2() Write to the PMC Address (char) MWACH 3.5.10 pl_memswrt2() Write to the PMC Address (short) MWACH 3.5.11 pl_memlwrt2() Write to the PMC Address (long) MWACH 3.5.12 pl_memucwrt2() Write to the PMC Address (unsigned char) MWACH 3.5.13 pl_memuswrt2() Write to the PMC Address (unsigned short) MWACH 3.5.14 pl_memulwrt2() Write to the PMC Address (unsigned long) MWACH

- pl_memc() Get Pointer to the PMC Address (char *) - - pl_mems() Get Pointer to the PMC Address (short *) - - pl_meml() Get Pointer to the PMC Address (long *) - - pl_memuc() Get Pointer to the PMC Address (unsigned char *) - - pl_memus() Get Pointer to the PMC Address (unsigned short *) - - pl_memul() Get Pointer to the PMC Address (unsigned long *) - - pl_membrd() Read from the PMC Address - - pl_membwrt() Write to the PMC Address - - pl_memc2() Get Pointer to the PMC Address (char *) - - pl_mems2() Get Pointer to the PMC Address (short *) - - pl_meml2() Get Pointer to the PMC Address (long *) - - pl_memuc2() Get Pointer to the PMC Address (unsigned char *) - - pl_memus2() Get Pointer to the PMC Address (unsigned short *) - - pl_memul2() Get Pointer to the PMC Address (unsigned long *) -

M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

Page 31: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-21-

READ SYSTEM INFORMATION No. Name Content Available

task 3.6.1 pl_sysinfrd() Read CNC Information MWACH 3.6.2 pl_symcmt2() Read Symbol and Comment in LADDER Program

(16 characters symbol is available) MWACH

3.6.3 pl_symcmt() Read Symbol and Comment in LADDER Program MWACH 3.6.4 pl_message() Read a Message in LADDER Program MWACH

M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

ACCESS TO THE EXTENDED NONVOLATILE MEMORY No. Name Content Available

task 3.7.1 pl_kpmrd() Read from the Extended Nonvolatile Memory MWACH 3.7.2 pl_kpmwrt() Write to the Extended Nonvolatile Memory MWACH 3.7.3 pl_kpmsiz() Get Size of the Extended Nonvolatile Memory MWACH

M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

CHARACTER DISPLAY No. Name Content Available

task 3.8.4 pl_dspopen4() Initialize the Character Screen

(80 Columns x 30 Lines) M

3.8.5 pl_dspopen() Initialize a Character Screen (80 Columns x 25 Lines or 40 Columns x 16 Lines)

M

3.8.6 pl_dspclr() Erase the Entire Screen MW 3.8.7 pl_dspclrl() Clear Lines MW 3.8.8 pl_dspclrc() Clear Columns MW 3.8.9 pl_dsppos() Set a Display Position MW 3.8.10 pl_dspcolor() Set a Display Attribute MW 3.8.11 pl_dspattr() Change Attribute of the Characters Being Displayed MW 3.8.12 pl_dspstr() Display ASCII Characters MW 3.8.13 pl_dspstrw() Display Characters

(Kanji, Hiragana and Special Characters) MW

3.8.14 pl_dsptrblr() Display Hex Size Characters MW 3.8.15 pl_cursor() Display Cursor MW 3.8.16 pl_dspchar() Display Characters

(ASCII, Kanji and Hiragana) MW

3.8.17 pl_dspsave() Save the Character Screen MW 3.8.18 pl_dspresave() Restore the Character Screen MW 3.8.19 pl_dspcntl() Control the Screen MW 3.8.20 pl_backcolor() Set Background Color of the Character Screen MW 3.8.21 pl_dsppalette() Set Palette for Character Screen MW 3.8.22 pl_dspopen2() Initialize the Character Screen

(74 Columns x 27 Lines) M

3.8.23 pl_dspopen3() Initialize the Character Screen (74 Columns x 30 Lines)

M

3.8.24 initreq_printf() Initialize printf() MW M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

Page 32: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-22-

GRAPHIC DISPLAY No. Name Content Available

task 3.9.3 pl_grpopen() Open the Graphic Screen M 3.9.4 pl_grpclose() Close the Graphic Screen M 3.9.5 pl_grpclr() Clear the Graphic Screen MW 3.9.6 pl_grpdspon() Display or Hide the Graphic Screen MW 3.9.7 pl_grplntyp() Set a Graphic Line Type MW 3.9.8 pl_grpcolor() Set a Graphic Color MW 3.9.9 pl_grpline() Draw Straight Lines MW 3.9.10 pl_grparc() Draw an Arc MW 3.9.11 pl_paint() Paint MW 3.9.12 pl_grpsft() Shift MW 3.9.13 pl_grpstatus() Get Graphic Screen Status MW 3.9.14 pl_grpclr2() Erase the Square MW 3.9.15 pl_grppalette() Set Palette for the Graphic Screen MW

- pl_grpopen2() Open the Graphic Screen (432 dots x 592 dots) - M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

READER / PUNCHER INTERFACE No. Name Content Available

task

3.10.1 pl_rsopen2() Open the Reader / Puncher Interface C 3.10.2 pl_rsclose2() Close the Reader / Puncher Interface C 3.10.3 pl_rsrd2() Read from the Reader / Puncher Interface C 3.10.4 pl_rswrt2() Write to the Reader / Puncher Interface C 3.10.5 pl_fopen2() Open the Reader / Puncher Interface

(for FANUC Handy File) C

3.10.6 pl_fdir2() Get the File Information C 3.10.7 pl_fdel2() Delete the File C 3.10.8 pl_rsopen() Open the Reader / Puncher Interface C 3.10.9 pl_rsclose() Close the Reader / Puncher Interface C

3.10.10 pl_rsrd() Read from the Reader / Puncher Interface C 3.10.11 pl_rswrt() Write to the Reader / Puncher Interface C 3.10.12 pl_fopen() Open the Reader / Puncher Interface

(for FANUC Handy File) C

3.10.13 pl_fdir() Get the File Information C 3.10.14 pl_fdel() Delete the File C

M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

Page 33: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-23-

CNC WINDOW No. Name Content Available

task 3.11.1 pl_nc_windr() CNC Window Function (Read) No. 23, 24,

25, 26, 27, 28, 29, 30, 31, 34, 50,

153 MWACH

Others MWAC

3.11.2 pl_nc_windw() CNC Window Function (Write) MWAC - pl_exin() External Data Input -

M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

CNC PROGRAM No. Name Content Available

task 3.12.1 pl_nc_dwnstart2() Start Registration of the CNC Program MWAC 3.12.2 pl_nc_download2() Register the CNC Program MWAC 3.12.3 pl_nc_dwnend2() End Registration of the CNC Program MWAC

- pl_nc_vrfstart2() Start Verification of the CNC Program - - pl_nc_verify2() Verify the CNC Program - - pl_nc_vrfend2() End Verification of the CNC Program -

3.12.4 pl_nc_dncstart2() Start DNC running of the CNC Program MWAC 3.12.5 pl_nc_dnc2() Run the CNC Program (DNC running) MWAC 3.12.6 pl_nc_dncend2() End DNC Running of the CNC Program MWAC 3.12.7 pl_nc_search2_8d() Search the CNC Program

(Supported 8 Digits Program Number) MWAC

3.12.8 pl_nc_search2() Search the CNC Program MWAC 3.12.9 pl_nc_delall2() Delete All CNC Programs MWAC

3.12.10 pl_nc_delete2_8d() Delete the CNC Program (Supported 8 Digits Program Number)

MWAC

3.12.11 pl_nc_delete2() Delete the CNC Program MWAC 3.12.12 pl_nc_upstart2_8d() Start Reading of the CNC Program

(Supported 8 Digits Program Number) MWAC

3.12.13 pl_nc_upstart2() Start Reading of the CNC Program MWAC 3.12.14 pl_nc_upload2() Read the CNC Program MWAC 3.12.15 pl_nc_upend2() End Reading of the CNC Program MWAC 3.12.16 pl_nc_dir2() Read the CNC Program Memory Information MWAC 3.12.17 pl_nc_pdirstart2_8d() Start Reading of the CNC Program List

(Supported 8 Digits Program Number) MWAC

3.12.18 pl_nc_pdirstart2() Start Reading of the CNC Program List MWAC 3.12.19 pl_nc_progdir2() Read the CNC Program List MWAC 3.12.20 pl_nc_pdirend2() End Reading of the Program List MWAC 3.12.21 pl_nc_dwnstart() Start Registration of the CNC Program MWAC 3.12.22 pl_nc_download() Register the CNC Program MWAC 3.12.23 pl_nc_dwnend() End Registration of the CNC Program MWAC

- pl_nc_vrfstart() Start Verification of the CNC Program - - pl_nc_verify() Verify the CNC Program - - pl_nc_vrfend() End Verification of the CNC Program -

Page 34: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-24-

No. Name Content Available task

3.12.24 pl_nc_dncstart() Start DNC running of the CNC Program MWAC 3.12.25 pl_nc_dnc() Run the CNC Program (DNC running) MWAC 3.12.26 pl_nc_dncend() End DNC Running of the CNC Program MWAC 3.12.27 pl_nc_search_8d() Search the CNC Program

(Supported 8 Digits Program Number) MWAC

3.12.28 pl_nc_search() Search the CNC Program MWAC 3.12.29 pl_nc_delall() Delete All CNC Programs MWAC 3.12.30 pl_nc_delete_8d() Delete the CNC Program

(Supported 8 Digits Program Number) MWAC

3.12.31 pl_nc_delete() Delete the CNC Program MWAC 3.12.32 pl_nc_upstart_8d() Start Reading of the CNC Program

(Supported 8 Digits Program Number) MWAC

3.12.33 pl_nc_upstart() Start Reading of the CNC Program MWAC 3.12.34 pl_nc_upload() Read the CNC Program MWAC 3.12.35 pl_nc_upend() End Reading of the CNC Program MWAC 3.12.36 pl_nc_dir() Read the CNC Program Memory Information MWAC 3.12.37 pl_nc_pdirstart_8d() Start Reading of the CNC Program List

(Supported 8 Digits Program Number) MWAC

3.12.38 pl_nc_pdirstart() Start Reading of the CNC Program List MWAC 3.12.39 pl_nc_progdir() Read the CNC Program List MWAC 3.12.40 pl_nc_pdirend() End Reading of the Program List MWAC

M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

CHARACTER CODE CONVERSION No. Name Content Available

task 3.13.1 pl_asciso() Convert Characters from ASCII to ISO Code MWACH 3.13.2 pl_isoasc() Convert Characters from ISO to ASCII Code MWACH

M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported

Page 35: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-25-

3.2 SYSTEM CALL

3.2.1 Read the Task Timer Value [Name]

os_show_tim

[Syntax] #include <oscall.h> void os_show_tim(unsigned long *time) ;

[Arguments] Input

--- Output

*time: Timer value

[Return] ---

[Description] This function reads a timer value. The unit of a timer value is the tick: one tick = eight msec. This function reads the timer value of the timer specific to each task. A timer value read with this function does not fully match the actually elapsed time. To simply read time, use the clock() function, which has a higher precision.

Page 36: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-26-

3.2.2 Set the Task Timer Value [Name]

os_set_tim

[Syntax] #include <oscall.h> void os_set_tim(unsigned long new_time, unsigned long *old_time);

[Arguments] Input

new_time: New timer value Output

*old_time: Old timer value

[Return] ---

[Description] This function sets a timer value. This function reads the timer value of the timer specific to each task. A timer value read with this function does not fully match the actually elapsed time. To simply read time, use the clock function, which has a higher precision.

Page 37: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-27-

3.2.3 Wait for the Timer Value [Name]

os_sync_tim

[Syntax] #include <oscall.h> unsigned short os_sync_tim(unsigned long wakeup_time);

[Arguments] Input

wakeup_time: Timer value Output

---

[Return] EC_TIMOUT: (0x011a) Normal termination.

[Description] This function makes the task wait until specified time comes. No other tasks can be held in wait state. This instruction does not return the error value 0. When specified time has come, the error value "EC_TIMOUT" is returned. Actually, the task is held for the period ("wakeup_time" - current time). If the "wakeup_time" is less than the current time (that is, if a past point time is specified), the task is not held in wait state. Before this function can be executed, the current time must be read using os_show_tim(). In wakeup_time, a value not greater than 7FFFFFFFh (198 days, 20 hours, 11 minutes, 9 seconds, and 180 msec) may be set. The unit of a time value to be specified in "wakeup_time" is the tick (= 8 msec).

Page 38: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-28-

3.2.4 Wait for Time [Name]

os_wait_tim

[Syntax] #include <oscall.h> unsigned short os_wait_tim(unsigned long timeout_value);

[Arguments] Input

timeout_value: Wait time Output

---

[Return] EC_TIMOUT: (0x011a) Normal completion

[Description] This function makes the task wait for a specified time. No other tasks can be held in wait state. This instruction does not return the error value 0. When specified time has come, the error value "EC_TIMOUT" is returned. The task is held in wait state for the time specified in "timeout_value". In "timeout_value", a value not greater than FFFFFFFFH (397 days, 16 hours, 22 minutes, 18 seconds, and 360 msec) may be set. The unit of a time value to be specified in "timeout_value" is the tick (= 8 msec).

Page 39: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-29-

3.2.5 Create an Event Flag [Name]

os_make_flg

[Syntax] #include <oscall.h> unsigned short os_make_flg(unsigned char event_flag_id);

[Arguments] Input

event_flag_id: Event flag ID Output

---

[Return] 0: Normal termination EC_FLGID: (0x0107) Event flag ID error EC_EXSTFLG: (0x0111) The event flag already exists.

[Description] This function creates an event flag. The size of an event flag is 32 bits. (Thirty-two flags make up one group.) Before an event flag can be used, this function must be issued.

Page 40: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-30-

3.2.6 Delete the Event Flag [Name]

os_delt_flg

[Syntax] #include <oscall.h> unsigned short os_delt_flg(unsigned char event_flag_id);

[Arguments] Input

event_flag_id: Event flag ID Output

---

[Return] 0: Normal termination EC_FLGID: (0x0107) Event flag ID error EC_NXSTFLG: (0x0112) The event flag does not exists.

[Description] This function deletes an event flag. The error code "EC_DELFLG" is returned to the task that possessed a deleted event flag.

Page 41: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-31-

3.2.7 Set the Event Flag [Name]

os_sign_flg

[Syntax] #include <oscall.h> unsigned short os_sign_flg(unsigned char event_flag_id,

unsigned long flag_on_message); [Arguments] Input

event_flag_id: Event flag ID flag_on_message: Flag pattern

Output ---

[Return]

0: Normal completion EC_FLGID: (0x0107) Event flag ID error EC_NXSTFLG: (0x0112) The event flag does not exists.

[Description] This function sets an event flag. A flag is recorded in the image of the event flag.

Page 42: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-32-

3.2.8 Wait for the Event Flag [Name]

os_wait_flg

[Syntax] #include <oscall.h> unsigned short os_wait_flg(unsigned char event_flag_id,

unsigned long wait_message, unsigned short and_or, long wait_limit, unsigned long *return_message);

[Arguments] Input

event_flag_id: Event flag ID wait_message: Flag pattern and_or: 0:AND,1:OR wait_limit: Be sure to set 0 (*).

Output return_message: When zero (AND) is set in "and_or", zero is

returned at all times. When one (OR) is set in "and_or", the signaled flags are returned.

[Return]

0: Normal completion EC_FLGID: (0x0107) Event flag ID error EC_NXSTFLG: (0x0112) The event flag does not exists. EC_DELFLG: (0x0117) The event flag was deleted.

[Description] This function makes the task wait until the event flag is signaled. When "AND_W(0)" is set in "and_or", an "AND" wait is specified. In this case, the system waits for all flags specified in "wait_message" to be signaled. When "OR_W(1)" is set, an "OR" wait is specified. In this case, the system waits for at least one of the flags specified in "wait_message" to be signaled.

Page 43: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-33-

3.2.9 Clear the Event Flag [Name]

os_clar_flg

[Syntax] #include <oscall.h> unsigned short os_clar_flg(unsigned char event_flag_id,

unsigned long clear_message);

[Arguments] Input

event_flag_id: Event flag ID clear_message: Flag pattern

Output ---

[Return] 0: Normal completion EC_FLGID: (0x0107) Event flag ID error EC_NXSTFLG: (0x0112) The event flag does not exists.

[Description] This function clears an event flag. The flag specified in "clear_message" of the image of an event flag is cleared.

Page 44: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-34-

3.2.10 Set the Event Flag (Pulse type) [Name]

os_puls_flg

[Syntax] #include <oscall.h> unsigned short os_puls_flg(unsigned char event_flag_id,

unsigned long puls_message);

[Arguments] Input

event_flag_id: Event flag ID puls_message: Flag pattern

Output ---

[Return] 0: Normal completion EC_FLGID: (0x0107) Event flag ID error EC_NXSTFLG: (0x0112) The event flag does not exists.

[Description] This function sets an event flag. A signaled flag is recorded in the image of the event flag.

Page 45: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-35-

3.2.11 Create a Semaphore

[Name] os_make_sem

[Syntax] #include <oscall.h> unsigned short os_make_sem(unsigned char semaphore_id, char

initial_value);

[Arguments] Input

semaphore_id: Semaphore ID initial_value: Initial value

Output ---

[Return] 0: Normal completion EC_SEMID: (0x0106 ) Semaphore ID error EC_EXSTSEM: (0x010f ) The semaphore already exists.

[Description] This function creates a semaphore.

Page 46: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-36-

3.2.12 Delete the Semaphore

[Name] os_delt_sem

[Syntax] #include <oscall.h> unsigned short os_delt_sem(unsigned char semaphore_id);

[Arguments] Input

semaphore_id: Semaphore ID Output

---

[Return] 0: Normal completion EC_SEMID: (0x0106) Semaphore ID error EC_NXSTSEM: (0x0110) The semaphore does not exists.

[Description] This function deletes a semaphore. The error code "EC_DELSEM" is returned to the task that was waiting for the deleted semaphore.

Page 47: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-37-

3.2.13 Set the Semaphore

[Name] os_sign_sem

[Syntax] #include <oscall.h> unsigned short os_sign_sem(unsigned char semaphore_id);

[Arguments] Input

semaphore_id: Semaphore ID Output

---

[Return] 0: Normal completion EC_SEMID: (0x0106) Semaphore ID error EC_NXSTSEM: (0x0110) The semaphore does not exists. EC_SEMOVF: (0x011c) Semaphore overflow

[Description] This function signals a semaphore. The counter is incremented. If the value of the counter is zero or less, the first task of the waiting task queue is placed in ready state.

Page 48: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-38-

3.2.14 Wait for the Semaphore

[Name] os_wait_sem

[Syntax] #include <oscall.h> unsigned short os_wait_sem(unsigned char semaphore_id,

long wait_limit) ;

[Arguments] Input

semaphore_id: Semaphore ID wait_limit: Be sure to set zero (*)

Output ---

[Return] 0: Normal completion. EC_SEMID: (0x0106) Semaphore ID error EC_NXSTSEM: (0x0110) The semaphore does not exists. EC_DELSEM: (0x0116) The semaphore was deleted. EC_SEMUDF: (0x011d) Semaphore underflow

[Description] This function makes the task wait until the semaphore is signaled. The counter is decremented. If the value of the counter is a negative value, the task is placed in wait state.

Page 49: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-39-

3.3 SWITCH SCREEN 3.3.1 Switch to the User Application Screen

[Name]

pl_pcmdi

[Syntax] #include <pmclib.h> void pl_pcmdi(void);

[Arguments] Input

--- Output

---

[Return] ---

[Description] When this function is executed, the screen display can be switched to the C application screen assigned to the custom key beforehand. Internally, crt_cncscrn(CRT_CUS_CEXE) of the C executor is called. So, when using this function, assign the C application screen to the custom key (CRT_CUS_CEXE) by using the crt_setuserscrn() function of the C executor. (See the sample program below.) If the C application screen is not assigned correctly, this function does not operate normally. /* MAIN task */ #include <crt.h> main() { int scrn_table[] = {CRT_CUS_CEXE}; crt_setuserscrn(scrn_tbl_size(scrn_table), scrn_table); }

[Related Function]

crt_cncscrn(), crt_setuserscrn()

Page 50: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-40-

3.3.2 Wait for Switching to the User Application Screen [Name]

pl_pcmdi_wait()

[Syntax] #include <pmclib.h> void pl_pcmdi_wait(void);

[Arguments] Input

--- Output

---

[Return] ---

[Description] This function is no operation. This function is provided for the keeping compatibility to the C program for "C language board" In "C executor", when a screen is changed from user application screen to other screen, the main task will automatically stop. If you develop a new application, you do not have to call this function.

Page 51: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-41-

3.3.3 Switch to the CNC Screen [Name]

pl_ncmdi

[Syntax] #include <pmclib.h> void pl_ncmdi(void);

[Arguments] Input

--- Output

---

[Return] ---

[Description] When this function is executed, the screen can be switched to the CNC absolute position screen Internally, crt_cncscrn(CRT_POS_ABS) of the C executor is called. When you want to switch another CNC screen, use crt_cncscrn() in the "C library for C executor".

[Related Function] crt_cncscrn()

Page 52: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-42-

3.4 MDI KEYS

3.4.1 MDI Key Code Table

0 1 2 3 4 5 6 7 0 SP 0 @ P 1 ! 1 A Q 2 " 2 B R 3 # 3 C S 4 $ 4 D T 5 % 5 E U 6 & 6 F V 7 ' 7 G W 8 ( 8 H X 9 TAB ) 9 I Y A EOB * : J Z B + ; K [ C , < L ¥ D - = M ] E . > N ~ F / ? O _

8 9 A B C D E F 0 RESET SKV1*1 F0*2 1 SKV2*1 F1*2 2 SKV3*1 F2*2 3 SKV4*1 F3*2 4 SHIFT INSERT SKV5*1 AUX F4*2 5 S.CAN*3 DELETE SKV6*1 F5*2 6 CAN ALTER SKV7*1 F6*2 7 A.CAN*4 ALT SKV8*1 F7*2 8 [→] INPUT SKV9*1 POS F8*2 9 [←] CALC PROG F9*2

A [↓] HELP OFFSET SETTING

B [↑] CTRL SYSTEM

C ABC/abc MESSAG

E

D GRAPH*5

E PAGE ↓

CUSTOM *5

FR*2 [ ]

F ↑

PAGE

FL*2 [ ]

" " indicates command key.

Page 53: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-43-

NOTE 1. The keys from "SKV1" through "SKV9" are virtual

soft keys. The bottom key is "SKV1". 2. The keys from "F0" through "F9" are horizontal soft

keys. From the left side, the keys are "FL", "F9"-"F0" and "FR". Please carefully that the order from "F0" to "F9" is different from the function in "C library for C executor".

3. The "S.CAN" is returned when a "SHIFT" key is released in "SHIFT" state.

4. The "A.CAN" is returned when a "CAN" key is pressed in "SHIFT" state.

5. The key code of the [GRAPH/CUSTOM] key on a small keyboard is "0xED". The key code of the [GRAPH] key on a normal keyboard is "0xED". The key code of the [CUSTOM] key on a normal keyboard is "0xEE".

Page 54: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-44-

3.4.2 Read key [Name]

pl_mdikey

[Syntax] #include <pmclib.h> short pl_mdikey(unsigned short * input_len, char * input_buffer);

[Arguments] Input

--- Output

input_len: Pointer to the variable to which the number of keyed characters is returned

input_buffer: Pointer to the array to which keyed characters are returned

[Return]

0: No key input 88H-FFH: Command key

[Description] This function reads the key. The function keys (E8H-EFH) cannot be read usually. However, if you execute the function pl_fkey_ign(), you can read it. You should set a pointer to the sufficient size of array to the "input_buffer". About the command key codes, refer to the "3.4.1 MDI Key Code Table". Note that the key code of the "INPUT" key is 98H in the "C library for conversion", but one is 0DH in the "C executor". Be careful when using the both libraries.

[Example]

/* MAIN task */ #include <stdlib.h> #include <pmclib.h> #define INPUT_KEY 0x98 long get_number(void) { long number; short ret; unsigned short len; char buf[256]; while(0 == (ret = pl_mdikey(&len, buf))) { os_wait_tim(32 /*msec*/ / 8); } if (ret == INPUT_KEY) {

Page 55: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-45-

number = strtol(buf, NULL, 0); } else { number = 0; } return number; }

[Related Function]

getchar(), getch()

Page 56: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-46-

3.4.3 Control a Key-in Line [Name]

pl_keydef

[Syntax] #include <pmclib.h> short pl_keydef(short * cntl);

[Arguments] Input

cntl: Key-in line control information

cntl +0 CF Key-in line control flag

+2 LN Maximum number of input characters +4 LA Display attribute +6 X Column position +8 Y Line position

+10 PN Number of prompt characters +12 PA Prompt display attribute +14 S1 S2 STRING: Prompt character string +16 S3 S4

... ... +30 S15 S16

NULL

#7 #6 #5 #4 #3 #2 #1 #0

CF KYMMK KYDSP KYDPS KYPRM

KYDSP: Echo-back display is:

= 0: Not provided = 1: Provided

KYDPS: The echo-back display position (valid when KYDSP = 1) is: = 0: Standard display position = 1: Changed

KYPRM: Prompt display (valid when KYDSP = 1) is: = 0: Not provided = 1: Provided

KYMMK: Display of ">" (valid when KYDSP = 1) is: = 1: Provided = 0: Not provided

LN: Maximum number of input characters Set the maximum allowable number of characters input on the key-in line (0 to 60). If 0, a negative value, or a value greater than 60 is set, the specification of 60 is assumed.

Page 57: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-47-

LA: Display attribute When echo-back display is to be provided on the key-in line (KYDSP = 1), set the attribute of characters. Normal attribute: Color code + 0x00 Reverse attribute: Color code + 0x10 Blink attribute: Color code + 0x08 Color code : Black:0x00, Red:0x20, Green:0x40, Yellow:0x60, Blue:0x80, Magenta:0xA0, Cyan:0xC0, White:0xE0

PA: Prompt display attribute When prompt display is to be provided (KYPRM = 1), set the attribute of prompt characters. Normal: Color code+0x00 Reverse: Color code+0x10 Blink: Color code+0x08 Color code: Black:0x00, Red:0x20, Green:0x40, Yellow:0x60, Blue:0x80, Magenta:0xA0, Cyan:0xC0, White:0xE0

X: Column position of the key-in line (0 to maximum display column position) When the key-in line display position is to be changed (KYDPS = 1), set a new column position. When the display position is not to be changed (KYDPS = 0), the column position is 0.

Y: Line position of the key-in line (0 to maximum display line position) When the key-in line display position is to be changed (KYDPS = 1), set a new line position. When the display position is not to be changed (KYDPS = 0), the line position will be 23.

PN: Number of prompt characters When prompt display is to be provided (KYPRM = 1), set the number of characters of a prompt character string. A value from 1 to 17 (including a NULL character) can be specified.

STRING: Prompt character string When prompt display is to be provided (KYPRM = 1), set a character string. In the case of access of short type, the byte order differs from that used with the C language board. Note that a character string is set in the order from a high byte to a low byte.

Output

Page 58: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-48-

---

[Return] 0: Normal completion.

[Description] This function sets the key-in line setting.

[Example] #include <pmclib.h> void setup_keyinline(void) { /* white, (x, y) = (40, 25) */ const short cntl[16] = {0x06, 40, 0xe0, 40, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; pl_keydef(cntl); }

Page 59: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-49-

3.4.4 Read Key Status [Name]

pl_keysts

[Syntax] #include <pmclib.h> short pl_keysts(short * code);

[Arguments] Input

--- Output

*code: Key code

code[0] Code1 code[1] Code2

code[0]: When a key is pressed, the key code of the key is

returned once instantly If the key is then held down, 0 is returned. If no key is pressed, 0 is returned.

code[1]: The value 0 is returned at all times.

[Return] 0: Normal completion.

[Description] When a key is pressed, this function reads the key code once. The read key code is stored in the "code[0]". If you keep pressing the key and call this function repeatedly, zero will be returned to the "code[0]". If the no key is pressed, zero will be returned to the "code[0]". If you press two keys simultaneously, the corresponding key codes are returned by the order of pressing of the keys. Zero is stored always in the "code[1]". Note that the behavior of this function differs from one in the "C library for C language board".

[Related Function]

kbhit(), getch(), getchar()

Page 60: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-50-

3.4.5 Disable Function Keys [Name]

pl_fkey_ign

[Syntax] #include <pmclib.h> void pl_fkey_ign(void);

[Arguments] Input

--- Output

---

[Return] ---

[Description] This function disables the switching screen by pressing the function keys. Even after this function is executed, you can switch screen by calling the pl_ncmdi() or the pl_pmcmdi(). Note that the keep relays K18#0 and K901#0 (IGNKEY), which are used in the "C library for C language board", are not supported in the "C library for conversion". This function is equivalent to the following function call of the "C executor": crt_setswt(CRT_SWT_MFKY | CRT_SWT_GREN | CRT_SWT_GRON);

[Related Function] crt_setswt()

Page 61: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-51-

3.4.6 Enable Function Keys [Name]

pl_fkey_avail

[Syntax] #include <pmclib.h> void pl_fkey_avail(void);

[Arguments] Input

--- Output

---

[Return] ---

[Description] This function enables the switching screen by pressing the function keys. Note that the keep relays K18#0 and K901#0 (IGNKEY), which are used in the "C library for C language board", are not supported in the "C library for conversion". This function is equivalent to the following function call of the C executor: crt_setswt(CRT_SWT_GREN | CRT_SWT_GRON);

[Related Function] crt_setswt()

Page 62: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-52-

3.4.7 Read a Function Key [Name]

pl_fkey_sts

[Syntax] #include <pmclib.h> short pl_fkey_sts(void);

[Arguments] Input

--- Output

---

[Return] 0: When a function key is disabled (after

pl_fkey_ign() is called), the function key is pressed.

1: No function key is pressed.

[Description] This function is to know if any function keys are pressed or not when the function key is disabled by calling the pl_fkey_ign(). If you read the key code of the function key, use the crt_readfkey() in the "C library for C executor".

[Related Function] crt_readfkey()

[Example] #include <pmclib.h> void check_fkey(void) { if (pl_fkey_sts() == 0) { pl_fkey_avail(); pl_ncmdi(); pl_pcmdi_wait(); } }

Page 63: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-53-

3.4.8 Disable Custom Keys [Name]

pl_fcustom_ign

[Syntax] #include <pmclib.h> void pl_fcustom_ign(void);

[Arguments] Input

--- Output

---

[Return] ---

[Description] This function performs no operation. On the "C executor", it is impossible to disable custom key input alone. Check if the crt_setswt(), pl_fkey_ign(), or pl_fkey_avail() for disabling a function key can be used instead.

[Related Function] crt_setswt ()

Page 64: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-54-

3.4.9 Enable Custom Keys [Name]

pl_fcustom_avail

[Syntax] #include <pmclib.h> void pl_fcustom_vail(void);

[Arguments] Input

--- Output

---

[Return] ---

[Description] This function performs no operation. On the "C executor", it is impossible to disable custom key input alone. Check if pl_fkey_ign() or pl_fkey_avail() for disabling a function key can be used instead.

[Related Function] crt_setswt ()

Page 65: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-55-

3.5 ACCESS TO THE PMC ADDRESS The byte order is different between "C executor" and "C language board" because they have different type of CPU. This means that the direct accessing using a pointer is not compatible between them. Therefore following functions in "C library for conversion" is unavailable. ・ pl_memc(), pl_memuc(), pl_mems(), pl_memus(), pl_meml(),

pl_memul() ・ pl_memc2(), pl_memuc2(), pl_mems2(), pl_memus2(),

pl_meml2(), pl_memul2() You should use functions "pmc_rdpmcrng()" and "pmc_wrpmcrng()" in "C library for C executor" or following new functions in "C library for conversion" ・ pl_memcrd2(), pl_memucrd2(), pl_memsrd2(), pl_memusrd2(),

pl_memlrd2(), pl_memulrd2() ・ pl_memcwrt2(), pl_memucwrt2(), pl_memswrt2(),

pl_memuswrt2(), pl_memlwrt2(), pl_mwmulwrt2() The example using "C library for conversion" is shown below. Before) num = *pl_mems2(id, offset); num |= 0x8000; *pl_mems2(id, offset) = num; After) num = pl_memsrd2(id, offset, NULL); num |= 0x8000; pl_memswrt2(id, offset, num); NOTE All functions in this section can access a PMC

address on 1st PMC, cannot access it on 2nd or 3rd PMC.

Page 66: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-56-

3.5.1 Read from the PMC Address (bit) [Name]

pl_membrd2

[Syntax] #include <pmclib.h> short pl_membrd2(unsigned short id, unsigned short offset, unsigned

short bit);

[Arguments] Input

id: PMC address ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset bit: PMC address bit position (0-7)

Output ---

[Return] 0: The specified bit is OFF. 1: The specified bit is ON. -1: The specification of "id", "offset", or "bit" is

invalid.

[Description] This function reads bit from the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 67: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-57-

3.5.2 Write to the PMC Address (bit) [Name]

pl_membwrt2

[Syntax] #include <pmclib.h> short pl_membwrt2(unsigned short id, unsigned short offset, unsigned

short bit, short status);

[Arguments] Input

id: PMC address ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset bit: PMC address bit position (0-7) status: Write value (0 or 1)

Output ---

[Return] 0: Normal completion. -1: The specification of "id", "offset", or "bit" is

invalid.

[Description] This function writes the bit value to the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 68: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-58-

3.5.3 Read from the PMC Address (char) [Name]

pl_memcrd2

[Syntax] #include <pmclib.h> char pl_memcrd2(unsigned short id, unsigned short offset, short *

error);

[Arguments] Input

id: PMC address ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset Output

*error: Completion code 0: Terminated normally. –1: The specification of "id" or "offset" is invalid. If a NULL pointer is specified for "error", no completion code is returned.

[Return]

A read value is returned. When the function is terminated abnormally, 0 is returned.

[Description] This function reads "char" type value from the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

[Example] /* Read the value of R800 as a char type value */ #define SIGNAL_R 5 short error; char data; data = pl_memcrd2(SIGNAL_R, 800, &error); if (error != 0) { /* error handling */ }

Page 69: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-59-

3.5.4 Read from the PMC Address (short) [Name]

pl_memsrd2

[Syntax] #include <pmclib.h> short pl_memsrd2(unsigned short id, unsigned short offset, short *

error);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset Output

*error: Completion code 0: Terminated normally. –1: The specification of "id" or "offset" is invalid. If a NULL pointer is specified for "error", no completion code is returned.

[Return]

A read value is returned. When the function is terminated abnormally, 0 is returned.

[Description] This function reads "short" type value from the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 70: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-60-

3.5.5 Read from the PMC Address (long) [Name]

pl_memlrd2

[Syntax] #include <pmclib.h> long pl_memlrd2(unsigned short id, unsigned short offset, short *

error);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset Output

*error: Completion code 0: Terminated normally. –1: The specification of "id" or "offset" is invalid. If a NULL pointer is specified for "error", no completion code is returned.

[Return]

A read value is returned. When the function is terminated abnormally, 0 is returned.

[Description] This function reads "long" type value from the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 71: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-61-

3.5.6 Read from the PMC Address (unsigned char) [Name]

pl_memucrd2

[Syntax] #include <pmclib.h> unsigned char pl_memucrd2(unsigned short id, unsigned short offset,

short * error);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset Output

*error: Completion code 0: Terminated normally. –1: The specification of "id" or "offset" is invalid. If a NULL pointer is specified for "error", no completion code is returned.

[Return]

A read value is returned. When the function is terminated abnormally, 0 is returned.

[Description] This function reads "unsigned char" type value from the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 72: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-62-

3.5.7 Read from the PMC Address (unsigned short) [Name]

pl_memusrd2

[Syntax] #include <pmclib.h> unsigned short pl_memusrd2(unsigned short id, unsigned short offset,

short * error);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset Output

*error: Completion code 0: Terminated normally. –1: The specification of "id" or "offset" is invalid. If a NULL pointer is specified for "error", no completion code is returned.

[Return]

A read value is returned. When the function is terminated abnormally, 0 is returned.

[Description] This function reads "unsigned short" type value from the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 73: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-63-

3.5.8 Read from the PMC Address (unsigned long) [Name]

pl_memulrd2

[Syntax] #include <pmclib.h> unsigned long pl_memulrd2(unsigned short id, unsigned short offset,

short * error);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset Output

*error: Completion code 0: Terminated normally. –1: The specification of "id" or "offset" is invalid. If a NULL pointer is specified for "error", no completion code is returned.

[Return]

A read value is returned. When the function is terminated abnormally, 0 is returned.

[Description] This function reads "unsigned long" type value from the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 74: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-64-

3.5.9 Write to the PMC Address (char) [Name]

pl_memcwrt2

[Syntax] #include <pmclib.h> short pl_memcwrt2(unsigned short id, unsigned short offset, char

data);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset data: Write value

Output ---

[Return] 0: Normal completion. -1: The specification of "id" or "offset" is invalid.

[Description]

This function writes "char" type value to the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

[Example] /* Write 100 to R800 as a char type value */ #define SIGNAL_R 5 short error; short ret; ret = pl_memcwrt2(SIGNAL_R, 800, 100); if (ret != 0) { /* error handling */ }

Page 75: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-65-

3.5.10 Write to the PMC Address (short) [Name]

pl_memswrt2

[Syntax] #include <pmclib.h> short pl_memswrt2(unsigned short id, unsigned short offset, short

data);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset data: Write value

Output ---

[Return] 0: Normal completion. -1: The specification of "id" or "offset" is invalid.

[Description] This function writes "short" type value to the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 76: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-66-

3.5.11 Write to the PMC Address (long) [Name]

pl_memlwrt2

[Syntax] #include <pmclib.h> short pl_memlwrt2(unsigned short id, unsigned short offset, long

data);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset data: Write value

Output ---

[Return] 0: Normal completion. -1: The specification of "id" or "offset" is invalid.

[Description] This function writes "long" type value to the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 77: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-67-

3.5.12 Write to the PMC Address (unsigned char) [Name]

pl_memucwrt2

[Syntax] #include <pmclib.h> short pl_memucwrt2(unsigned short id, unsigned short offset,

unsigned char data);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset data: Write value

Output ---

[Return] 0: Normal completion. -1: The specification of "id" or "offset" is invalid.

[Description] This function writes "unsigned char" type value to the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 78: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-68-

3.5.13 Write to the PMC Address (unsigned short) [Name]

pl_memuswrt2

[Syntax] #include <pmclib.h> short pl_memuswrt2(unsigned short id, unsigned short offset,

unsigned short data);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset data: Write value

Output ---

[Return] 0: Normal completion. -1: The specification of "id" or "offset" is invalid.

[Description] This function writes "unsigned short" type value to the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 79: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-69-

3.5.14 Write to the PMC Address (unsigned long) [Name]

pl_memulwrt2

[Syntax] #include <pmclib.h> short pl_memulwrt2(unsigned short id, unsigned short offset,

unsigned long data);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

offset: PMC address offset data: Write value

Output ---

[Return] 0: Normal completion. -1: The specification of "id" or "offset" is invalid.

[Description] This function writes "unsigned long" type value to the PMC address.

[Related Function] pmc_rdpmcrng(), pmc_wrpmcrng()

Page 80: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-70-

3.6 READ SYSTEM INFORMATION 3.6.1 Read CNC Information

[Name]

pl_sysinfrd

[Syntax] #include <pmclib.h> short pl_sysinfrd(unsigned short id)

[Arguments] Input

id: Read data type ID

ID (id)

Data type Return value

Description

0 CNC model 0 Series 30i MODEL-A 1 CNC type 0-0x0f

0x10-0x1f 0x20-0x2f 0x30-0x3f 0x40-0x4f

Machining system Lathe system Multi-path lathe system Multi-path machining system Multi-path compound system

2 CRT type 6 9

14" 9"

3 KEY type 0 0 is always returned. 4 Total number

of axes (1st path)

n Total number of axes on 1st path

5 (reserved) - 86 Total number

of axes (2nd path)

n Total number of axes on 2nd path

87 (reserved) -

Output

---

[Return] Other than -1: Read data –1: The specification of "id" is invalid.

[Description] This function reads various CNC information items. The return values related to some types of "id" are different from "C library for C language board".

[Related Function] cnc_sysinfo(), crt_gettype(), cnc_setpath()

Page 81: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-71-

3.6.2 Read Symbol and Comment in LADDER Program (16 characters symbol is available) [Name]

pl_symcmt2

[Syntax] #include <pmclib.h> unsigned short pl_symcmt2(unsigned char id,

unsigned char type, unsigned short offset, unsigned short bit, unsigned char * symbol, unsigned char * comment, unsigned char * size);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

type: 0: Byte address 1: Bit address

offset: PMC address offset bit: PMC address bit position (0-7)

Output *symbol: Read symbol string (up to 17 characters including

a NULL character) *comment: Read comment string(up to 31 characters including

a NULL character) *size: Comment string size (not including a NULL

character)

[Return] 0: Normal completion 1: The "id", "type", "offset" or "bit" is invalid, or

there is no sequence program.

[Description] This function reads a symbol or comment of the specified PMC address. Up to 16 symbol characters can be read. Up to 30 comment characters can be read. At the end of the read character string "*symbol" or "*comment", a NULL character ('¥0') is added. For a "symbol", set a pointer to an array not smaller than 17 characters. For a "comment", set a pointer to an array not smaller than 31 characters.

Page 82: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-72-

If no symbol or comment is defined, a NULL character ('¥0') is returned as "*symbol" or "*comment". NOTE 1. This function can read a symbol or comment in 1st

PMC, cannot read it in 2nd or 3rd PMC. 2. This function cannot read a extended symbol or

extended comment.

[Example] /* Read a bit symbol and comment from R800.0 */ #define SIGNAL_R 5 char symbol[17]; char comment[31]; unsigned short size; unsigned short ret; ret = pl_symcmt2(SIGNAL_R, 1, 800, 0, &symbol, &comment, &size); if (ret == 0) { printf("SYMBOL: %s¥n", symbol); printf("COMMENT: %s¥n", comment); }

Page 83: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-73-

3.6.3 Read Symbol and Comment in LADDER Program [Name]

pl_symcmt

[Syntax] #include <pmclib.h> unsigned short pl_symcmt(unsigned char id,

unsigned char type, unsigned short offset, unsigned short bit, unsigned char * symbol, unsigned char * comment, unsigned char * size);

[Arguments] Input

id: PMC ADDRESS ID G:0, F:1, Y:2, X:3, A:4, R:5, T:6, K:7, C:8, D:9, M:10, N:11, E:12

type: 0: Byte address 1: Bit address

offset: PMC address offset bit: PMC address bit position (0-7)

Output *symbol: Read symbol string (up to 7 characters including a

NULL character) *comment: Read comment string(up to 31 characters including

a NULL character) *size: Comment string size (not including a NULL

character)

[Return] 0: Normal completion. 1: The "id", "type", "offset" or "bit" is invalid, or

there is no sequence program.

[Description] This function reads a symbol or comment of the specified PMC address. Up to 6 symbol characters can be read. Up to 30 comment characters can be read. At the end of the read character string "*symbol" or "*comment", a NULL character ('¥0') is added. For a "symbol", set a pointer to an array not smaller than 7 characters. For a "comment", set a pointer to an array not smaller than 31 characters.

Page 84: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-74-

If no symbol or comment is defined, a NULL character ('¥0') is returned as "*symbol" or "*comment". NOTE 1. This function can read a symbol or comment in 1st

PMC, cannot read it in 2nd or 3rd PMC. 2. This function cannot read a extended symbol or

extended comment.

[Example] /* Read a bit symbol and comment from R800.0 */ #define SIGNAL_R 5 char symbol[7]; char comment[31]; unsigned short size; unsigned short ret; ret = pl_symcmt(SIGNAL_R, 1, 800, 0, &symbol, &comment, &size); if (ret == 0) { printf("SYMBOL: %s¥n", symbol); printf("COMMENT: %s¥n", comment); }

Page 85: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-75-

3.6.4 Read a Message in LADDER Program [Name]

pl_message

[Syntax] #include <pmclib.h> unsigned short pl_message(unsigned short offset,

unsigned short bit, unsigned char * message, unsigned short * size);

[Arguments]

Input offset: "A" address offset bit: "A" address bit position (0-7)

Output *message: Read message (up to 256 characters including a

NULL character) *size: Number of characters of a read message (not

including a NULL character)

[Return] 0 Normal completion. 1 The "offset" or "bit" is invalid.

[Description]

This function reads a message of the specified PMC address 'A'. At the end of a read message string, a NULL character ('¥0') is added. For "message", set a pointer to an array not smaller than 256 characters. If no message is defined, only NULL character ('¥0') is returned to "*message". NOTE This function can read a message in 1st PMC,

cannot read it in 2nd or 3rd PMC.

[Example] /* Read a message defined at A10.0 */ char message[256]; unsigned short size; unsigned short ret; ret = pl_message(10, 0, message, &size); if (ret == 0) { printf("message[] = %s¥n", message); }

Page 86: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-76-

3.7 ACCESS TO THE EXTENDED NONVOLATILE MEMORY 3.7.1 Read from the Extended Nonvolatile Memory

[Name]

pl_kpmrd

[Syntax] #include <pmclib.h> short pl_kpmrd(unsigned long offset,

char * data, unsigned short size);

[Arguments] Input

offset: Read start offset size: Number of bytes to be read

Output *data: Read data

[Return] 0: Normal completion. 2: The "offset" or "size" is invalid. 6: No option

[Description] This function reads data from the extended nonvolatile memory. In "data", set an array that is not smaller than the value specified in "size".

[Related Function] pmc_rdkpm(), pmc_wrkpm(), pmc_kpmsiz()

[Example]

/* Read 1KB from offset 0 */ char data[1024]; short ret; ret = pl_kpmrd(0, data, sizeof(data)); if (ret != 0) { /* error handling */ }

Page 87: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-77-

3.7.2 Write to the Extended Nonvolatile Memory [Name]

pl_kpmwrt

[Syntax] #include <pmclib.h> short pl_kpmwrt(unsigned long offset,

char * data, unsigned short size);

[Arguments] Input

offset: Write start offset *data: Write data size: Number of bytes to be written

Output ---

[Return] 0: Normal completion. 2: The "offset" or "size" is invalid. 6: No option

[Description] This function writes data to the extended nonvolatile memory.

[Related Function] pmc_rdkpm(), pmc_wrkpm(), pmc_kpmsiz()

[Example] /* Clear 10 bytes from offset 0 to zeros */ short ret; const char data[10]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; ret = pl_kpmwrt(0, data, sizeof(data)); if (ret != 0) { /* error handling */ }

Page 88: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-78-

3.7.3 Get Size of the Extended Nonvolatile Memory [Name]

pl_kpmsiz

[Syntax] #include <pmclib.h> unsigned long pl_kpmsiz(void);

[Arguments] Input

--- Output

---

[Return] 0: No option Other than 0: Number of bytes of the extended nonvolatile

memory

[Description] This function reads the total size of the extended nonvolatile memory.

[Related Function] pmc_rdkpm(), pmc_wrkpm(), pmc_kpmsiz()

[Example] unsigned long size; size = pl_kpmsiz(); printf("NONVOLATILE MEMORY SIZE = %d bytes¥n", size);

Page 89: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-79-

3.8 CHARACTER DISPLAY 3.8.1 Color Palette for the Character Display

On the character screen, you can set current color by the palette number, from 0 to 15. The correspondence of the palette number to the default color is shown below.

Palette number

Color R G B

0 Black 0 0 0 1 Red 0x3f 0 0 2 Green 0 0x3f 0 3 Yellow 0x3f 0x3f 0 4 Blue 0 0 0x3f 5 Magenta 0x3f 0 0x3f 6 Cyan 0 0x3f 0x3f 7 White 0x3f 0x3f 0x3f 8 Dark gray 0x18 0x18 0x18 9 Dark red 0x1c 0x0c 0x0c

10 Dark green 0x0c 0x1c 0x0c 11 Dark yellow 0x1c 0x1c 0x0c 12 Dark blue 0x0c 0x0c 0x1c 13 Dark magenta 0x1c 0x0c 0x1c 14 Dark cyan 0x0c 0x1c 0x1c 15 Light gray 0x28 0x28 0x28

Page 90: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-80-

3.8.2 Coordinates of the Character Screen Coordinates of the character screen, 80 columns and 30 lines mode, is shown below.

The coordinates of character screen (80 columns * 30 lines) X 0 1 2 3 . . . . . 76 77 78 79 0 1 2 3 . .

Y . . . . 25 26 28 29

Page 91: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-81-

3.8.3 Character Code

NOTE 1. Graph characters, marked with , can be

displayed with the graph character mode. 2. About the KANJI code, refer to "1 CHARACTER

CODE (KANJI, HIRAGANA AND OTHERS)".

Page 92: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-82-

3.8.4 Initialize the Character Screen (80 Columns x 30 Lines) [Name]

pl_dspopen4

[Syntax] #include <pmclib.h> short = pl_dspopen4(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion. 3: The display unit does not allow this display mode

to be set.

[Description] This function initializes the character screen with the mode of 80 columns × 30 lines. This function is usable with a display unit of VGA type only. This function is equivalent to the following function call: crt_setmode(CRT_MODE_V30); The initialization flag for R9072 used on the "C library for C language board" is no longer used. Therefore, R9072 need not be set.

[Related Function] crt_setmode()

Page 93: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-83-

3.8.5 Initialize a Character Screen (80 Columns x 25 Lines or 40 Columns x 16 Lines) [Name]

pl_dspopen

[Syntax] #include <pmclib.h> short pl_dspopen(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion.

[Description] This function initializes the character screen. On a display unit with 12 horizontal soft keys, the screen mode will be "80 Columns x 25 Lines" and this function is equivalent to the following function call: crt_setmode(CRT_MODE_80X25); On a display unit with seven horizontal soft keys, the screen mode will be "40 Columns x 16 Lines" and this function is equivalent to the following function call: crt_setmode(CRT_MODE_40X16);

[Related Function] crt_setmode()

Page 94: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-84-

3.8.6 Erase the Entire Screen [Name]

pl_dspclr

[Syntax] #include <pmclib.h> short pl_dspclr(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion.

[Description] This function clears the entire character screen. Graphic display is not cleared. This function is equivalent to the following function call: printf("¥x1b[2J"];

[Related Function] Escape sequence (ESC[2J]

Page 95: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-85-

3.8.7 Clear Lines [Name]

pl_dspclrl

[Syntax] #include <pmclib.h> short pl_dspclrl(short * cntl);

[Arguments] Input

*cntl: Control information

cntl[0] Clear start line (Y) 0 to cntl[1] Number of lines

Output ---

[Return] 0: Normal completion. 5: The "*cntl" is invalid.

[Description] This function clears the specified lines on the character screen.

[Related Function] Escape sequence (ESC[2K]

[Example] /* Clear four lines from line 0 */ short ret; short cntl[2] = {0, 4}; ret = pl_dspclrl(cntl); if (ret != 0) { /* error handling */ }

Page 96: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-86-

3.8.8 Clear Columns [Name]

pl_dspclrc

[Syntax] #include <pmclib.h> short pl_dspclrc(short * cntl);

[Arguments] Input

*cntl: Control information

cntl[0] Start column (X) 0 to cntl[1] Start line (Y) 0 to cntl[2] Number of columns

Output ---

[Return] 0: Normal completion. 5: The "*cntl" is invalid.

[Description] This function clears the specified columns on the character screen.

[Related Function] Escape sequence (ESC[0K, ESC[1K, ESC[2K]

[Example] /* Clear 10 columns from line 0 and column 40 */ short ret; short cntl[3] = {0, 40, 10}; ret = pl_dspclrc(cntl); if (ret != 0) { /* error handling */ }

Page 97: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-87-

3.8.9 Set a Display Position [Name]

pl_dsppos

[Syntax] #include <pmclib.h> short pl_dsppos(short * cntl);

[Arguments] Input

*cntl: Control information

cntl[0] Column (X) 0 to cntl[1] Line (Y) 0 to

Output ---

[Return] 0: Normal completion. 5: The "*cntl" is invalid.

[Description] This function sets a current display position on the character screen. This function is equivalent to the following function call: printf("¥x1b[%d;%dH", cntl[1]+1, cntl[0]+1]

[Related Function] Escape sequence (ESC[y;xH)

[Example] /* Set a display position at line 4 and column 2 */ short ret; short cntl[2] = {2, 4}; ret = pl_dsppos(cntl); if (ret != 0) { /* error handling */ }

Page 98: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-88-

3.8.10 Set a Display Attribute [Name]

pl_dspcolor

[Syntax] #include <pmclib.h> short pl_dspcolor(short * cntl);

[Arguments] Input

*cntl: Control information

cntl[0] Color code 0 to cntl[1] Reverse setting 0 to

cntl[0]: Color code

Black:0x00, Red:0x20, Green:0x40, Yellow:0x60, Blue:0x80, Magenta:0xA0, Cyan:0xC0, White:0xE0

cntl[1]: Reverse setting Normal:0x00, Reverse:0x10

Output ---

[Return] 0: Normal completion. 5: The "*cntl" is invalid.

[Description] This function sets a current display color and reverse attribute on the character screen.

[Related Function] Escape sequence (ESC[nm]

Page 99: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-89-

3.8.11 Change Attribute of the Characters Being Displayed [Name]

pl_dspattr

[Syntax] #include <pmclib.h> short pl_dspattr(short * cntl);

[Arguments] Input

*cntl: Control information

cntl[0] Start column (X) 0 to cntl[1] Start line (Y) 0 to cntl[2] Attribute cntl[3] Number of columns

cntl[0]: Set a column position where to start changing the

attribute (X = 0 and up). cntl[1]: Set a line position where to start changing the

attribute (Y = 0 and up). cntl[2]: Set a color and display attribute.

Normal: Color code + 0x00 Blink: Color code + 0x08 Reverse: Color code + 0x10 Color code: Black:0x00, Red:0x20, Green:0x40, Yellow:0x60, Blue:0x80, Magenta:0xA0, Cyan:0xC0, White:0xE0

cntl[3]: Set the number of columns whose display attribute is to be changed.

Output ---

[Return] 0: Normal completion. 5: The "*cntl" is invalid.

[Description] This function changes the attribute (color, blink or reverse) of characters already displayed on the screen. This function does not affect the current display attribute that is set by pl_dspcolor().

[Related Function] crt_settextattr()

Page 100: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-90-

3.8.12 Display ASCII Characters [Name]

pl_dspstr

[Syntax] #include <pmclib.h> short pl_dspstr(short attr, char * str, unsigned short size);

[Arguments] Input

attr: Display attribute Normal: 0x18 Blink: 0x17

*str: Character string to be displayed (up to 101 characters including a NULL character) Set a NULL character ('¥0') at the end of a character string.

size: Number of characters (up to 100) Output

---

[Return] 0: Normal completion. 5: The "attr", "*str" or "size" is invalid.

[Description] This function displays one-byte characters such as ASCII characters.

[Related Function] putchar(), puts(), printf(), Escape sequence

Page 101: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-91-

3.8.13 Display Characters (Kanji, Hiragana and Special Characters) [Name]

pl_dspstrw

[Syntax] #include <pmclib.h> short pl_dspstrw(short attr, short * str, unsigned short size);

[Arguments] Input

attr: Display attribute Normal: 0x18 Blink: 0x17

*str: Character string to be displayed (up to 101 characters including a NULL character) Set a character string by using the shift JIS code. Set 0 at the end of a character string. This argument functions as a pointer to data of short type. However, it is recommended that character codes be set in arrays of character type and a pointer to the array be set in this argument, as in the example of programming indicated below. In this case, set one character in a set of two arrays (a set of two bytes). Specifically, when setting a two-byte character, set the first byte of the character code in index 2n of an array of character type, and set the second by of the character code in index 2n+1. When setting a one-byte character such as an ASCII character, set the character code in index 2n of an array of character type, and set 0 in index 2+1. When setting a character of a character string of two-byte characters in array str[n] of short type, for example, set the first byte of the character code in the high-order byte position of str[n] and set the second byte of the character code in the low-order byte position of str[n]. When setting a one-byte character such as an ASCII character, set the character code in the high-order byte position of str[n] and set 0 in the low-order byte position of str[n]. When setting a character string in a variable of short type, note that the byte order

Page 102: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-92-

differs from that used with the "C library for C language board".

size: Number of bytes of a specified character string

When calculating the number of bytes, remember that one character consists of two bytes. The maximum allowable number of bytes is 200.

Output ---

[Return] 0: Normal completion. 2: The "size" is invalid. 5: The "attr" or "*str" is invalid.

[Description] This function displays two-byte characters such as kanji, hiragana, and special characters.

[Related Function] putchar(), puts(), printf(), Escape sequence

[Example] /* Example of displaying the ASCII characters 'A' and the two-byte

character 'A' */ /* ASCII character 'A' = 0x41 */ /* 2bytes character 'A' = 0x82, 0x60 */ #include <pmclib.h> short ret; /* Using character array */ char strc[] = {0x41, 0x00, 0x82, 0x60, 0x00, 0x00}; ret = pl_dspstrw(0x18, (short *)strc, sizeof(strc)); if (ret != 0) { /* error handling */ }

Page 103: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-93-

3.8.14 Display Hex Size Characters [Name]

pl_dsptrblr

[Syntax] #include <pmclib.h> short pl_dsptrblr(short attr, char * str, unsigned short size);

[Arguments] Input

attr: Display attribute Normal: 0x18 Blink: 0x17

*str: Character string to be displayed (up to 101 characters including a NULL character) Set a NULL character ('¥0') at the end of a character string.

size: Number of bytes of a specified character string

Output ---

[Return] 0: Normal completion. 5: The "str" or "size" is invalid.

[Description] This function displays hex size characters. The displayable characters are uppercase alphabetic characters, numeric characters, "-" (minus), "." (period), and " " (space). With the "C library for C language board", this function is named "Display Triple Size Characters". On the "C executor", the display function equivalent to this function is named "Display Hex Size Characters". So, the same name is used in this library as well.

[Related Function] putchar(), puts(), printf(), Escape sequence (ESC(6)

[Example]

short ret; const char str[] = "012-. ABC"; ret = pl_dsptrblr(0x18, str, sizeof(str)); if (ret != 0) { /* error handling */ }

Page 104: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-94-

3.8.15 Display Cursor [Name]

pl_cursor

[Syntax] #include <pmclib.h> short pl_cursor(short * cntl);

[Arguments] Input

*cntl: Control information

cntl[0] Column (X) 0 to cntl[1] Line (Y) 0 to cntl[2] Attribute cntl[3] Number of cursor

characters

cntl[0]: Set a column position for cursor display (X = 0 and

up). cntl[1]: Set a line position for cursor display (Y = 0 and

up). cntl[2]: Set the display attribute of the cursor. Attribute

Attribute Cursor type 0x0C 0x80

Underline cursor display

0x4C 0x6C

Blink underline cursor display

0x2C Clear cursor

cntl[3]: Set the number of cursor characters (up to 40 characters)

Output ---

[Return] 0: Normal completion. 5: The "*cntl" is invalid.

[Description] This function displays or clears a cursor on the character screen. When clearing the cursor, specify the same argument values (column, line, the number of cursor characters) as used for display. Only one cursor may be displayed on the screen. The specification of this function is different from one of "C library for C language board".

[Related Function]

Page 105: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-95-

crt_2ndcursor() [Example]

/* Display cursor at the position, (X, Y) = (20, 3). */ short ret; short cntl_on[] = {20, 3, 0x0080, 10}; short cntl_off[] = {20, 3, 0x002c, 10}; ret = pl_cursor(cntl_on); /* print cursor */ if (ret != 0) { /* error handling */ } ret = pl_cursor(cntl_off); /* erase cursor */ if (ret != 0) { /* error handling */ }

Page 106: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-96-

3.8.16 Display Characters (ASCII, Kanji and Hiragana) [Name]

pl_dspchar

[Syntax] #include <pmclib.h> short pl_dspchar(short * cntl);

[Arguments] Input

*cntl: Control information

cntl[0] Data size (N) cntl[1] Attribute (A) cntl[2] Character type (S) cntl[3] Column (X) 0 to cntl[4] Line (Y) 0 to cntl[5] XX XX Character

to cntl[n] XX XX

cntl[0]: Set the number of bytes in the character area

cntl[5] and up. cntl[1]: Set a color and display attribute.

Normal: Color code + 0x00 Blink: Color code + 0x08 Reverse: Color code + 0x10 Color code: Black:0x00, Red:0x20, Green:0x40, Yellow:0x60, Blue:0x80, Magenta:0xA0, Cyan:0xC0, White:0xE0

cntl[2]: Set a character type. 1: One-byte characters such as ASCII characters

2: Two-byte characters in the JIS code 3: Triple height and double width size characters 4: Mixture of one-byte characters and two-byte

characters in the shift JIS code 5: Graphic characters (character codes 0x85 to

0x8F) cntl[3]: Set a display start column position (0 and up). cntl[4]: Set a display start line position (0 and up). cntl[5]-cntl[n]: Set characters.

At the end of a character string, set a NULL character ('¥0"). The argument cntl represents a pointer to data of short type. However, it is recommended that the

Page 107: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-97-

character string area "cntl[5]" to "cntl[n]" be set via a pointer variable of character type as in the example of programming provided below.

Output ---

[Return] 0: Normal completion. 2: The "cntl[0]" is invalid. 5: The "cntl[2]" is invalid.

[Description] This function displays characters with a specified attribute at a specified position.

[Related Function] putchar(), puts(), printf(), Escape sequence

[Example] /* Example of displaying the ASCII characters 'A' and the two-byte

character 'A' */ /* ASCII character 'A' = 0x41 */ /* 2bytes character 'A' = 0x82, 0x60 */ #include <pmclib.h> short cntl[7]; char * pstr; cntl[0] = 4, cntl[1]=0xE0, cntl[2]=4, cntl[3]= 0, cntl[4]=0; pstr = &cntl[5]; strcpy(pstr, "A¥x82¥x60"); ret = pl_dspchar(cntl); if (ret != 0) { /* error handling */ }

Page 108: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-98-

3.8.17 Save the Character Screen [Name]

pl_dspsave

[Syntax] #include <pmclib.h> short pl_dspsave(short id, short * cntl, unsigned char * buf);

[Arguments] Input

id: Specify a screen save mode. 0: Saves the entire screen. 1: Saves a part (up to 80 characters) of the screen

to area 1. 2: Saves a part (up to 80 characters) of the screen

to area 2. 3: Saves a part (up to 80 characters) of the screen

to area 3. 4: Saves a part (up to 80 characters) of the screen

to area 4. 5: Saves a part (up to 80 characters) of the screen

to area 5. *cntl: Control information Set this argument when a value from 1 to 5 is set in

"id". Set a NULL pointer when 0 is set in "id".

cntl[0] Column (X) 0 to cntl[1] Line (Y) 0 to cntl[2] Number of columns

(C) 1 to 80

Output

*buf: Save area Set a pointer to an array variable for saving the screen. The size required to save the screen is 4 bytes per column. So, when the entire screen is to be saved ("id" = 0), the size of a required save area is: 80 columns × 30 lines × 4 bytes = 9600 bytes.

[Return]

0: Normal completion. 3: The "id" is invalid. 5: The "cntl[0]", "cntl[1]" or "cntl[2]" is invalid.

Page 109: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-99-

[Description] This function saves a part of the character screen or the entire character screen to the memory. This function is used with pl_dspresave() to temporarily save or restore the character screen. Cursor display is not saved.

[Related Function] crt_gettextimg(), crt_puttextimg()

[Example] #include <pmclib.h> short ret; unsigned char buf[80*30*4]; ret = pl_dspsave(0, NULL, buf); if (ret != 0) { /* error handling */ } ret = pl_dspresave(0, buf); if (ret != 0) { /* error handling */ }

Page 110: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-100-

3.8.18 Restore the Character Screen [Name]

pl_dspresave

[Syntax] #include <pmclib.h> short pl_dspresave(short id, unsigned char * buf);

[Arguments] Input

id: Specify the restoration of the character screen. In "id", set the same value as used for execution of pl_dspsave().

0: Restores the entire screen. 1: Restores a part (up to 80 characters) of the

screen to area 1. 2: Restores a part (up to 80 characters) of the

screen to area 2. 3: Restores a part (up to 80 characters) of the

screen to area 3. 4: Restores a part (up to 80 characters) of the

screen to area 4. 5: Restores a part (up to 80 characters) of the

screen to area 5. *buf: Save area Set a pointer to the same array variable as used for

execution of pl_dspsave().

Output ---

[Return] 0: Normal completion. 3: The "id" is invalid.

[Description] This function restores a part of the screen or the entire screen saved to the memory with pl_dspsave(). The cursor is not restored.

[Related Function] crt_gettextimg(), crt_puttextimg()

Page 111: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-101-

3.8.19 Control the Screen [Name]

pl_dspcntl

[Syntax] #include <pmclib.h> short pl_dspcntl(short id);

[Arguments] Input

id: 0: Sets the monochrome mode (without brightness modulation).

1: Sets gray scale display or color display. 2: Turns off the video signal. 3: Turn on the video signal. If a value other than 0 to 3 is set, the setting of 3 is

assumed.

Output ---

[Return] 0: Normal completion.

[Description] This function controls the screen.

[Related Function]

crt_setmode(), Escape sequence (ESC[9l, ESC[9h]

Page 112: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-102-

3.8.20 Set Background Color of the Character Screen [Name]

pl_backcolor

[Syntax] #include <pmclib.h> short pl_backcolor(short no);

[Arguments] Input

no: Palette specification Set the value of a palette number (0 to 15) × 0x20.

Output ---

[Return] 0: Normal completion.

[Description] This function sets the background color of the character screen. This function is usable with a display unit of VGA type only.

[Related Function] Escape sequence (ESC[4xm, ESC[3m, ESC[23m]

Page 113: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-103-

3.8.21 Set Palette for Character Screen [Name]

pl_dsppalette

[Syntax] #include <pmclib.h> short pl_dsppalette(long * cntl);

[Arguments] Input

*cntl: Palette color information Set color information for each palette. Set 0 in

"cntl[0]" for palette No. 0 at all times.

cntl[0] Color information for palette No. 0

0 at all times

cntl[1] Color information for palette No. 1

to cntl[15] Color information for

palette No. 15

Set the "R" value, "G" value, and "B" value of each

palette in the format below. A value from 0 to 0x3F can be specified as a "R" value, "G" value, and "B" value.

bit 31 23 15 7

cntl[n] Set 0. "B" value "G" value "R" value

Output

---

[Return] 0: Normal completion. 3: The display unit is of other than VGA and XGA

types.

[Description] This function sets color information for each palette. This function is usable with a display unit of VGA or XGA type only.

[Related Function] crt_setallpalette()

Page 114: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-104-

3.8.22 Initialize the Character Screen (74 Columns x 27 Lines) [Name]

pl_dspopen2

[Syntax] #include <pmclib.h> short = pl_dspopen2(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion.

[Description] The display mode, "74 columns x 27 lines", is not supported. If you execute this function, the screen will be initialized with "80 columns x 30 lines" mode. This function is equivalent to the following function call: crt_setmode(CRT_MODE_V30);

[Related Function] crt_setmode ()

Page 115: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-105-

3.8.23 Initialize the Character Screen (74 Columns x 30 Lines) [Name]

pl_dspopen3

[Syntax] #include <pmclib.h> short = pl_dspopen3(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion.

[Description] The display mode, "74 columns x 30 lines", is not supported. If you execute this function, the screen will be initialized with "80 columns x 30 lines" mode. This function is equivalent to the following function call: crt_setmode(CRT_MODE_V30);

[Related Function] crt_setmode ()

Page 116: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-106-

3.8.24 Initialize printf() [Name]

initreq_printf

[Syntax] #include <pmclib.h> void initreq_printf(unsigned char task_id);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion.

[Description] This function is no longer used. This function need not be called. If this function is called, the value 0 is returned without performing any processing.

Page 117: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-107-

3.9 GRAPHIC DISPLAY 3.9.1 Color Palette for Graphic Display

On the graphic screen, you can set current color by the palette number, from 0 to 15. The correspondence of the palette number to the default color is shown below.

Palette number

Color R G B

0 Black 0 0 0 1 Red 0x3f 0 0 2 Green 0 0x3f 0 3 Yellow 0x3f 0x3f 0 4 Blue 0 0 0x3f 5 Magenta 0x3f 0 0x3f 6 Cyan 0 0x3f 0x3f 7 White 0x3f 0x3f 0x3f 8 Dark gray 0x18 0x18 0x18 9 Dark red 0x1c 0x0c 0x0c

10 Dark green 0x0c 0x1c 0x0c 11 Dark yellow 0x1c 0x1c 0x0c 12 Dark blue 0x0c 0x0c 0x1c 13 Dark magenta 0x1c 0x0c 0x1c 14 Dark cyan 0x0c 0x1c 0x1c 15 Light gray 0x28 0x28 0x28

Page 118: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-108-

3.9.2 Coordinates of the Graphic Screen Coordinates of the graphic screen, 640 x 480 dots, are shown below.

The Coordinates of the graphic screen (640 x 480 dots) Y (0, 239)

X (-320, 0) (0, 0) (319, 0)

(0, -240)

Page 119: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-109-

3.9.3 Open the Graphic Screen [Name]

pl_grpopen

[Syntax] short pl_grpopen(void);

[Arguments] Input

--- Output

--- [Return]

0: Normal completion. 6: No graphic function

[Description] This function initializes graphic screen. The graphic screen is cleared. Before calling a graphic function, execute pl_grpopen(). When a series of graphic functions have been called, execute pl_grpclose().

[Related Function] crt_opengr(), _setvideomode(), crt_setswt(), _clearscreen(), crt_closegr()

Page 120: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-110-

3.9.4 Close the Graphic Screen [Name]

pl_grpclose

[Syntax] #include <pmclib.h> short pl_grpclose(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion.

[Description] This function closes the graphic screen. When a series of graphic functions have been called, execute this function.

[Related Function] crt_closegr(), crt_opengr()

Page 121: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-111-

3.9.5 Clear the Graphic Screen [Name]

pl_grpclr

[Syntax] #include <pmclib.h> short pl_grpclr(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion.

[Description] This function clears the entire graphic screen. At this time, the character screen is not cleared.

[Related Function]

_clearscreen()

Page 122: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-112-

3.9.6 Display or Hide the Graphic Screen [Name]

pl_grpdspon

[Syntax] #include <pmclib.h> short pl_grpdspon(short display);

[Arguments] Input

display: The graphic screen is displayed or hidden 0: Hides the graphic screen. 1: Displays the graphic screen.

Output ---

[Return] 0: Normal completion. 6: No graphic function

[Description] This function displays or hides the graphic screen. This function is equivalent to the following function call: #include <crt.h> crt_graphic(CRT_OFF_BEAM); /* display == 0 */ crt_graphic(CRT_ON_BEAM); /* display == 1 */

[Related Function] crt_graphic()

Page 123: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-113-

3.9.7 Set a Graphic Line Type [Name]

pl_grplntyp

[Syntax] #include <pmclib.h> short pl_grplntyp(short type);

[Arguments] Input

type: Line type 0: Solid line 1: Dashed line 2: Dot-dash line 3: Double-dot-dash line 4: Deletion line

Output ---

[Return] 0: Normal completion.

[Description] This function sets the current graphic line type. The setting is valid until the next line type is set. This function is equivalent to the following function call: #include <graph.h> _setlinestyle(0xffff); /* type == 0 */ _setlinestyle(0xf0f0); /* type == 1 */ _setlinestyle(0x0x3cff); /* type == 2 */ _setlinestyle(0x333f); /* type == 3 */ _setlinestyle(0x0000); /* type == 4 */

[Related Function] _setlinestyle()

Page 124: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-114-

3.9.8 Set a Graphic Color

[Name]

pl_grpcolor

[Syntax] #include <pmclib.h> short pl_grpcolor(short color);

[Arguments] Input

color: Palette number Set a palette number (0 to 15).

Output ---

[Return] 0: Normal completion.

[Description] This function sets the current graphic color. The setting is valid until the next color is set. This function is equivalent to the following function call: #include <graph.h> _setcolor(color);

[Related Function] _setcolor()

Page 125: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-115-

3.9.9 Draw Straight Lines [Name]

pl_grpline

[Syntax] #include <pmclib.h> short pl_grpline(short * cntl, unsigned short size);

[Arguments] Input

*cntl: Drawing information Set the start point and end of a straight line to be

drawn. On a VGA type display unit, the valid X coordinate ranges from -320 to 319, and the valid Y coordinate ranges from -240 to 239.

cntl[0] X Start point cntl[1] Y cntl[2] X End point 1 cntl[3] Y cntl[4] X End point 2 cntl[5] Y

to cntl[2n] X End point n

cntl[2n+1] Y

size: Number of bytes of drawing information ("*cntl") Set the number of bytes of the "*cntl" array above.

The minimum size is 8 bytes for "cntl[0]"-"cntl[3]". The size can be incremented in steps of 4 bytes.

Output ---

[Return] 0: Normal completion. 2: The "size" is invalid.

[Description] This function draws a straight line on the graphic screen.

[Related Function] _moveto(), _lineto()

Page 126: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-116-

3.9.10 Draw an Arc [Name]

pl_grparc

[Syntax] #include <pmclib.h> short pl_grparc(short * cntl, unsigned short size);

[Arguments] Input

*cntl: Drawing information Set parameters and the coordinates of a start point,

end points, and centers in the following format:

cntl[0] X Start point cntl[1] Y cntl[2] P Parameter 1 cntl[3] X End point 1 cntl[4] Y cntl[5] X Center 1 cntl[6] Y

to cntl[5n-3] P Parameter n cntl[5n-2] X End point n cntl[5n-1] Y

cntl[5n] X Center n cntl[5n+1] Y

Set a parameter in the following format:

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Unused (a) Unused

(a) Drawing direction 0: Clockwise, 1: Counterclockwise

size: Number of bytes of drawing information ("*cntl") Set the number of bytes of the "*cntl" array above.

The minimum size is 14 bytes for "cntl[0]"-"cntl[6]". The size can be incremented in steps of 10 bytes.

Output ---

[Return] 0: Normal completion. 2: The "size" is invalid.

Page 127: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-117-

[Description] This function draws an arc on the graphic screen.

[Related Function] _arc()

Page 128: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-118-

3.9.11 Paint [Name]

pl_paint

[Syntax] #include <pmclib.h> short pl_paint(short * cntl);

[Arguments] Input

*cntl: Drawing information Set drawing information in the following format:

cntl[0] X Start point cntl[1] Y cntl[2] P Parameter

cntl[2]: Parameter

Set palette number, 0 to 7, of the boundary of the area that you want to paint.

0: The palette number of the boundary is regarded as current palette number.

1-7: Palette number of the boundary Output

-

[Return] 0: Normal completion. 3: The "cntl[2]" is invalid. 6: No graphic function

[Description] The specific area on the graphic screen is painted with the current palette color. Its area should be defined by closed line and the start point must not be on the closed line. Set the palette number of the closed line to "cntl[2]".

[Related Function] _floodfill()

Page 129: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-119-

3.9.12 Shift [Name]

pl_grpsft

[Syntax] #include <pmclib.h> short pl_grpsft(short * cntl);

[Arguments] Input

*cntl: Shift value Set the shift value with the following format.

cntl[0] X Shift value (dot) cntl[1] Y

Output

-

[Return] 0: Normal completion.

[Description] Entire graphic screen is shifted but the coordinates system of the graphic screen is not shifted.

[Related Function] _imagesize(), _getimage(), _putimage()

Page 130: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-120-

3.9.13 Get Graphic Screen Status [Name]

pl_grpstatus

[Syntax] #include <pmclib.h> short pl_grpstatus(void);

[Arguments] Input

- Output

-

[Return] 0: Previous graphic screen is no longer available. You have to call the pl_grpopen() to initialize the

graphic screen and to draw graphic object again. 1: Previous graphic screen is available. You should call the pl_grpdspon() to display the

previous graphic screen.

[Description] To use this function, you can judge if you need to redraw the graphic screen or not when a screen is switched back to the application screen.

[Related Function] crt_opengr()

Page 131: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-121-

3.9.14 Erase the Square [Name]

pl_grpclr2

[Syntax] #include <pmclib.h> short pl_grpclr2(short * cntl);

[Arguments] Input

*cntl: Specification of the square Set the coordinates of the square with the

following format.

cntl[0] X1 Top-left (dot) cntl[1] Y1 cntl[2] X2 Bottom-right (dot) cntl[3] Y2

Output

-

[Return] 0: Normal completion 6: Abnormal completion

[Description] This function erases specific square area on the graphic screen. The character screen is not erased.

[Related Function] _rectangle()

Page 132: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-122-

3.9.15 Set Palette for the Graphic Screen [Name]

pl_grppalette

[Syntax] #include <pmclib.h> short pl_grppalette(long * cntl);

[Arguments] Input

*cntl: Palette color information Set color information for each palette. Set 0 in

cntl[0] for palette No. 0 at all times.

cntl[0] Color information for palette No. 0

0 at all times

cntl[1] Color information for palette No. 1

to cntl[15] Color information for

palette No. 15

Set the "R" value, "G" value, and "B" value of each

palette in the format below. A value from 0 to 0x3F can be specified as a "R" value, "G" value, and "B" value.

bit 31 23 15 7

cntl[n] Set 0. "B" value "G" value "R" value

Output

---

[Return] 0: Normal completion.

[Description] This function sets the color palette for the graphic screen.

[Related Function] _remapallpalette()

Page 133: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-123-

3.10 READER / PUNCHER INTERFACE There are three choices to use RS-232C communication functions. (1) You can use only functions named "pl_xxxx()" in "C library for

conversion". (2) You can use only functions named "pl_xxxx2()" in "C library for

conversion". (3) You can use only conventional functions in "C library for C

executor". Note that you cannot use above three types of functions together. We recommend that you choose (2) or (3).

Page 134: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-124-

3.10.1 Open the Reader / Puncher Interface [Name]

pl_rsopen2

[Syntax] #include <pmclib.h> short pl_rsopen2(short * cntl);

[Arguments] Input

*cntl: Control information Set the communication parameter for RS-232C as

following format.

cntl[0] OP Channel number, mode, flow control cntl[1] OB Baud rate cntl[2] OS Stop bits, Parity setting (Low byte)

DC3 code (High byte) cntl[3] OC Output code (Low byte)

Input code (High byte)

OP (cntl[0]): The channel number, mode and the method of flow

control Set the channel number of RS-232C, communication mode and the method of flow control as following format.

n: Bidirectional (Hardware flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with bidirectional mode and controlled by the hardware flow control. No control code is output when the communication line is opened or closed. To use this setting, you can read or write binary data. The writing to the target device is flow-controlled by the "CS" signal from the target device. The reading from the target device is flow-controlled by the "RS" signal from the CNC.

1n: Reading (DC1 / DC3 flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with reading mode and controlled by the DC1 / DC3 flow control. The DC1 code is output to the target device when the communication line is opened. The DC3 code is output to the target device when the communication line is closed. The reading

Page 135: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-125-

from the target device is flow-controlled by the DC1 and DC3 code from the CNC.

2n: Writing (DC1 / DC3 flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with writing mode and controlled by the DC1 / DC3 flow control. The DC2 code is output to the target device when the communication line is opened. The DC4 code is output to the target device when the communication line is closed. The writing to the target device is flow-controlled by the DC1 and DC3 code from the target device.

9n: Bidirectional (DC1 / DC3 flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with bidirectional mode and controlled by the DC1 / DC3 flow control. No control code is output when the communication line is opened or closed. The writing to the target device is flow-controlled by the DC1 and DC3 code from the target device. The reading from the target device is flow-controlled by the DC1 and DC3 code from the CNC.

OB (cntl[1]): Baud rate 7:600bps, 8:1200bps, 9:2400bps, 10:4800bps,

11:9600bps OS (cntl[2]): Stop bits, parity and DC3 code Set the stop bits and parity setting to the low byte

as following format. 1: 1 stop bit, none parity 2: 2 stop bits, none parity 11: 1 stop bit, odd parity 12: 2 stop bits, odd parity 21: 1 stop bit, even parity 22: 2 stop bits, even parity Set the DC3 code to the high byte as following

format. 0: The DC3 code is 0x93. 0x13: The DC3 code is 0x13. For example, when the setting is "2 stop bits,

non-parity, the DC3 code is 0x13", you should set the 0x1302 to OS (cntl[2]).

OC (cntl[3]): Output code, input code Set the output code to the low byte as following

format.

Page 136: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-126-

When the OP (cntl[0]) == n, this setting is unavailable.

1: ASCII, 2: ISO Set the input code to the high byte as following

format. 0: Automatic detection 1: ISO (The input code is checked.) For example, when the setting is "Output and input

code is ASCII", you should set the 0x0001 to OC (cntl[3]).

Output

[Return] 0: Normal completion. -1: Specified channel is already in use by another user. 5: Invalid arguments

[Description] This function opens the reader / puncher interface. You should open the interface by the calling of pl_rsopen2() before the calling of pl_rsrd2() or pl_rswrt2(). You should close the interface by the calling of pl_rsclose2() after the calling of pl_rsrd2() or pl_rswrt2(). When you open the interface using the pl_rsopen2(), you cannot use the function pl_rsrd(), pl_rswrt() or pl_rsclose(). You should use the pl_rsrd2(), pl_rswrt2() or pl_rsclose2(). When you use this function, you cannot use the conventional function related to the RS-232C communication in "C library for C executor" together.

[Related Function] rs_open()

Page 137: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-127-

3.10.2 Close the Reader / Puncher Interface [Name]

pl_rsclose2

[Syntax] #include <pmclib.h> short pl_rsclose2(short channel);

[Arguments] Input

channel: Channel number of RS-232C Set the channel number (1-) of RS-232C.

Output ---

[Return] 0: Normal completion. 5: The argument is invalid.

[Description] This function closes the reader / puncher interface. You should close the interface by the calling of pl_rsclose2() after the calling of pl_rsrd2() or pl_rswrt2(). When you open the interface using the pl_rsopen(), you cannot use the function pl_rsclose2(). You should use the pl_rsclose(). When you use this function, you cannot use the conventional function related to the RS-232C communication in "C library for C executor" together.

[Related Function] rs_close(), fca_close()

Page 138: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-128-

3.10.3 Read from the Reader / Puncher Interface [Name]

pl_rsrd2

[Syntax] #include <pmclib.h> short pl_rsrd(short channel, char * buf, unsigned short * size);

[Arguments] Input

channel: Channel number of RS-232C Set the channel number (1-) of RS-232C. buf: Pointer to the buffer Set the pointer to the array that the read data is

stored. *size: Size of the buffer Set size of the buffer. The maximum size is 256

bytes. Output

*buf: Read data The read data is stored. *size: Size of read data The size of read data is returned. The value is

equal or less than the specified value at calling. [Return]

0: Normal completion. -11: The reader / puncher interface is not opened. 2: The "*size" is invalid. 5: The argument or read value is invalid. 20: The communication status is invalid or the "DR"

signal is OFF. 21: There is no data in communication buffer. After

certain time, call this function again.

[Description] This function reads data from reader / puncher interface. You should open the interface by the calling of pl_rsopen2(), not pl_rsopen(), before the calling of pl_rsrd2(). You should close the interface by the calling of pl_rsclose2(), not pl_rsclose(), after the calling of pl_rsrd2(). When you use this function, you cannot use the conventional function related to the RS-232C communication in "C library for C executor" together.

[Related Function] rs_read()

Page 139: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-129-

3.10.4 Write to the Reader / Puncher Interface [Name]

pl_rswrt2

[Syntax] #include <pmclib.h> short pl_rswrt2(short channel, char * buf, unsigned short size);

[Arguments] Input

channel: Channel number of RS-232C Set the channel number (1-) of RS-232C. *buf: Data Set the array that you want to write. size: Size of the data Set size of the data that you want to write. The

maximum size is 256 bytes. Output

---

[Return] 0: Normal completion -11: The reader / Puncher interface is not opened. -12: Cannot write 2: The "size" is invalid. 5: The argument is invalid. 20: The communication status is invalid or the "DR"

signal is OFF.

[Description] This function writes data to the reader / puncher interface. You should open the interface by the calling of pl_rsopen2(), not pl_rsopen(), before the calling of pl_rswrt2(). You should close the interface by the calling of pl_rsclose2(), not pl_rsclose(), after the calling of pl_rswrt2(). When you use this function, you cannot use the conventional function related to The RS-232C communication in "C library for C executor" together.

[Related Function] rs_wrt()

Page 140: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-130-

3.10.5 Open the Reader / Puncher Interface (for FANUC Handy File) [Name]

pl_fopen2

[Syntax] #include <pmclib.h> short pl_fopen2(short * cntl, short file_no, char * file_name);

[Arguments] Input

*cntl: Control information Set the communication parameter for RS-232C as

following format.

cntl[0] OP Channel number, mode, flow control cntl[1] OB Baud rate cntl[2] OS Stop bits, Parity setting (Low byte)

DC3 code (High byte) cntl[3] OC Output code (Low byte)

Input code (High byte)

OP (cntl[0]): The channel number, mode and the method of flow

control Set the channel number of RS-232C, communication mode and the method of flow control as following format.

1n: Reading (DC1 / DC3 flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with reading mode and controlled by the DC1 / DC3 flow control. The DC1 code is output to the target device when the communication line is opened. The DC3 code is output to the target device when the communication line is closed. The reading from the target device is flow-controlled by the DC1 and DC3 code from the CNC.

2n: Writing (DC1 / DC3 flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with writing mode and controlled by the DC1 / DC3 flow control. The DC2 code is output to the target device when the communication line is opened. The DC4 code is output to the target device when the communication line is closed. The writing to

Page 141: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-131-

the target device is flow-controlled by the DC1 and DC3 code from the target device.

3n: Reading directory, deleting a file. Set the channel number of RS-232C to "n". In this

setting, you can read directory information or delete the file in FANUC Handy File.

OB (cntl[1]): Baud rate 7:600bps, 8:1200bps, 9:2400bps, 10:4800bps,

11:9600bps OS (cntl[2]): Stop bits, parity and DC3 code Set the stop bits and parity setting to the low byte

as following format. 1: 1 stop bit, none parity 2: 2 stop bits, none parity 11: 1 stop bit, odd parity 12: 2 stop bits, odd parity 21: 1 stop bit, even parity 22: 2 stop bits, even parity Set the DC3 code to the high byte as following

format. 0: The DC3 code is 0x93. 0x13: The DC3 code is 0x13. For example, when the setting is "2 stop bits,

non-parity, the DC3 code is 0x13", you should set the 0x1302 to OS (cntl[2]).

OC (cntl[3]): Output code, input code Set the output code to the low byte as following

format. When the OP (cntl[0]) == n, this setting is

unavailable. 1: ASCII, 2: ISO Set the input code to the high byte as following

format. 0: Automatic detection 1: ISO (The input code is checked.) For example, when the setting is "Output and input

code is ASCII", you should set the 0x0001 to OC (cntl[3]).

file_no: File number Set the file number on FANUC Handy File to

operate. When you specify the file by the file name, set zero.

*file_name: File name

Page 142: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-132-

Set the file name on FANUC Handy File to operate. You should terminate the file name string with NUL ('¥0'). When you use a MS-DOS format floppy disk, the file name is 12 characters in the maximum, "8 characters in the maximum" + ". (dot)" + "3 characters in the maximum". When you use a FANUC format floppy disk, the file name is 17 characters in the maximum. When you specify the file number, you should set NULL(0) to the "file_name".

NOTE When you specify both the file number and the file

name, specification by the file name is available.

Output ---

[Return] 0: Normal completion -1: Specified channel is already in use by another user. 5: The argument is invalid.

[Description] This function opens the reader / puncher interface for FANUC Handy File. You should open the interface by the calling of pl_fopen2() before the calling of pl_rsrd2(), pl_rswrt2(), pl_fdir2() or pl_fdel2(). You should close the interface by the calling of pl_rsclose2() after the calling of pl_rsrd2(), pl_rswrt2(), pl_fdir2() or pl_fdel2(). When you open the interface using the pl_fopen2(), you cannot use the function pl_rsrd(), pl_rswrt(), pl_fdir(), pl_fdel() or pl_rsclose(). You should use the pl_rsrd2(), pl_rswrt2(), pl_fdir2(), pl_fdel2() or pl_rsclose2(). When you use this function, you cannot use the conventional function related to The RS-232C communication in "C library for C executor" together. ・ When you open the interface with the file number and with the

setting OP (cntl[0]) = 2n, files after the specified number will be deleted and the new file, its file number is specified number, will be created.

・ When you open the interface with the file number "0" and with the setting OP (cntl[0]) = 2n, the new file, its file number is the last file number + 1, will be created.

・ When you open the interface with the file number "-1" and with the setting OP (cntl[0]) = 2n, all files will be deleted, and next, the new file, which file number is "1", will be created.

Page 143: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-133-

・ When you create a file with the setting OP (cntl[0]) = 2n, the default file name will be "#FCAxxxx" for FANUC format floppy disk or will be "#xxxx.DAT" for MS-DOS format floppy disk.

・ When you open the interface with the file name and with the setting OP (cntl[0]) = 2n, the new file, its file number is the last file number + 1 and which file name is specified name, will be created.

[Related Function]

fca_open(), fcs_fopen()

Page 144: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-134-

3.10.6 Get the File Information [Name]

pl_fdir2

[Syntax] #include <pmclib.h> short pl_fdir2(short channel, short file_no, char * file_name, long *

size);

[Arguments] Input

channel: Channel number of RS-232C Set the channel number (1-) of RS-232C. file_no: File number Set the file number.

Output *file_name: File name Set pointer to the array to store the file name. The

array size should be 17 bytes. The read file name is 17 characters. The file name is not terminated with NUL ('¥0'). When the file name is less than 17 characters, space character will be added.

"AAAAAAAA.BBB " *size: File size Set pointer to the variable to store the file size.

[Return] 0: Normal completion -11: The reader / puncher interface is not opened. 5: The argument is invalid. 20: The communication status is invalid or the "DR"

signal is OFF. 23: No specified file

[Description] This function reads the file name and the file size. You should open the interface by the calling of pl_fopen2() with the setting OP (cntl[0]) = 3n, not pl_fopen(), before the calling of pl_fdir2(). You should close the interface by the calling of pl_rsclose2(), not pl_rsclose(), after the calling of pl_fdir2(). If you want to read the information of two or more files, call pl_fopen2(), pl_fdir2() and pl_rsclose2() repeatedly. When you use this function, you cannot use the conventional function related to The RS-232C communication in "C library for C executor" together.

Page 145: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-135-

[Related Function] fca_readdir()

Page 146: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-136-

3.10.7 Delete the File [Name]

pl_fdel2

[Syntax] #include <pmclib.h> short pl_fdel2(short channel, short file_no, char * file_name);

[Arguments] Input

channel: Channel number of RS-232C Set the channel number (1-) of RS-232C. file_no: File number Set the file number on FANUC Handy File to

operate. When you specify the file by the file name, set zero.

*file_name: File name Set the file name on FANUC Handy File to operate.

You should terminate the file name string with NUL ('¥0'). When you use a MS-DOS format floppy disk, the file name is 12 characters in the maximum, "8 characters in the maximum" + ". (dot)" + "3 characters in the maximum". When you use a FANUC format floppy disk, the file name is 17 characters in the maximum. When you specify the file number, you should set NULL(0) to the "file_name".

NOTE When you specify both the file number and the file

name, specification by the file name is available.

Output ---

[Return] 0: Normal completion -11: The reader / puncher interface is not opened. 5: The argument is invalid.

[Description] The function deletes the specified file. You should open the interface by the calling of pl_fopen2() with the setting OP (cntl[0]) = 3n, not pl_fopen(), before the calling of pl_fdel2(). You should close the interface by the calling of pl_rsclose2(), not pl_rsclose(), after the calling of pl_fdel2(). If you

Page 147: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-137-

want to delete two of more files, call pl_fopen2(), pl_fdel2() and pl_rsclose2() repeatedly. When some file is deleted, the file number after the deleted file will be changed. When you use this function, you cannot use the conventional function related to The RS-232C communication in "C library for C executor" together.

[Related Function] fca_delete()

Page 148: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-138-

3.10.8 Open the Reader / Puncher Interface [Name]

pl_rsopen

[Syntax] #include <pmclib.h> short pl_rsopen(short * cntl);

[Arguments] Input

*cntl: Control information Set the communication parameter for RS-232C as

following format.

cntl[0] OP Channel number, mode, flow control cntl[1] OB Baud rate cntl[2] OS Stop bits, Parity setting (Low byte) cntl[3] OC Output code (Low byte)

OP (cntl[0]): The channel number, mode and the method of flow

control Set the channel number of RS-232C, communication mode and the method of flow control as following format.

n: Bidirectional (Hardware flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with bidirectional mode and controlled by the hardware flow control. No control code is output when the communication line is opened or closed. To use this setting, you can read or write binary data. The writing to the target device is flow-controlled by the "CS" signal from the target device. The reading from the target device is flow-controlled by the "RS" signal from the CNC.

1n: Reading (DC1 / DC3 flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with reading mode and controlled by the DC1 / DC3 flow control. The DC1 code is output to the target device when the communication line is opened. The DC3 code is output to the target device when the communication line is closed. The reading from the target device is flow-controlled by the DC1 and DC3 code from the CNC.

Page 149: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-139-

2n: Writing (DC1 / DC3 flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with writing mode and controlled by the DC1 / DC3 flow control. The DC2 code is output to the target device when the communication line is opened. The DC4 code is output to the target device when the communication line is closed. The writing to the target device is flow-controlled by the DC1 and DC3 code from the target device.

9n: Bidirectional (DC1 / DC3 flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with bidirectional mode and controlled by the DC1 / DC3 flow control. No control code is output when the communication line is opened or closed. The writing to the target device is flow-controlled by the DC1 code from the target device. The reading from the target device is flow-controlled by the DC3 code from the CNC.

10n: Bidirectional (DC1 / DC3 flow control) This setting is nearly same as OP=9n. The

difference is that the DC3 code is 0x13. OB (cntl[1]): Baud rate 7:600bps, 8:1200bps, 9:2400bps, 10:4800bps,

11:9600bps OS (cntl[2]): Stop bits, parity Set the stop bits and parity setting to the low byte

as following format. 1: 1 stop bit, none parity 2: 2 stop bits, none parity 11: 1 stop bit, odd parity 12: 2 stop bits, odd parity 21: 1 stop bit, even parity 22: 2 stop bits, even parity OC (cntl[3]): Output code Set the output code to the low byte as following

format. When the OP (cntl[0]) == n, this setting is

unavailable. 1: ASCII, 2: ISO

Output ---

[Return]

Page 150: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-140-

0: Normal completion. -1: Specified channel is already in use by another user. 5: Invalid arguments

[Description] This function opens the reader / puncher interface. You should open the interface by the calling of pl_rsopen() before the calling of pl_rsrd() or pl_rswrt(). You should close the interface by the calling of pl_rsclose() after the calling of pl_rsrd() or pl_rswrt(). When you open the interface using the pl_rsopen(), you cannot use the function pl_rsrd2(), pl_rswrt2() or pl_rsclose2(). You should use the pl_rsrd(), pl_rswrt() or pl_rsclose(). When you use this function, you cannot use the conventional function related to The RS-232C communication in "C library for C executor" together.

[Related Function] rs_open()

Page 151: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-141-

3.10.9 Close the Reader / Puncher Interface [Name]

pl_rsclose

[Syntax] #include <pmclib.h> short pl_rsclose(void);

[Arguments] 入力

--- Output

---

[Return] 0: Normal completion. Other than 0: Abnormal completion.

[Description] This function closes the reader / puncher interface. You should close the interface by the calling of pl_rsclose() after the calling of pl_rsrd() or pl_rswrt(). When you open the interface using the pl_rsopen2(), you cannot use the function pl_rsclose(). You should use the pl_rsclose2(). When you use this function, you cannot use the conventional function related to The RS-232C communication in "C library for C executor" together.

[Related Function]

rs_close(), fca_close()

Page 152: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-142-

3.10.10 Read from the Reader / Puncher Interface [Name]

pl_rsrd

[Syntax] #include <pmclib.h> short pl_rsrd(char * buf, unsigned short * size);

[Arguments] Input

buf: Pointer to the buffer Set the pointer to the array that the read data is

stored. *size: Size of the buffer Set size of the buffer. The maximum size is 256

bytes. Output

*buf: Read data The read data is stored. *size: Size of read data The size of read data is returned. The value is

equal or less than the specified value at calling.

[Return] 0: Normal completion. -11: The reader / puncher interface is not opened. 2: The "*size" is invalid. 5: The argument or read value is invalid. 20: The communication status is invalid or the "DR"

signal is OFF. 21: There is no data in communication buffer. After

certain time, call this function again.

[Description] This function reads data from reader / puncher interface. You should open the interface by the calling of pl_rsopen(), not pl_rsopen2(), before the calling of pl_rsrd(). You should close the interface by the calling of pl_rsclose(), not pl_rsclose2(), after the calling of pl_rsrd(). When you use this function, you cannot use the conventional function related to The RS-232C communication in "C library for C executor" together.

[Related Function] rs_read()

Page 153: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-143-

3.10.11 Write to the Reader / Puncher Interface [Name]

pl_rswrt

[Syntax] #include <pmclib.h> short pl_rswrt(char * buf, unsigned short size);

[Arguments] Input

*buf: Data Set the array that you want to write. size: Size of the data Set size of the data that you want to write. The

maximum size is 256 bytes. Output

---

[Return] 0: Normal completion -11: The reader / Puncher interface is not opened. -12: Cannot write 2: The "size" is invalid. 5: The argument is invalid. 20: The communication status is invalid or the "DR"

signal is OFF.

[Description] This function writes data to the reader / puncher interface. You should open the interface by the calling of pl_rsopen(), not pl_rsopen2(), before the calling of pl_rswrt(). You should close the interface by the calling of pl_rsclose(), not pl_rsclose2(), after the calling of pl_rswrt(). When you use this function, you cannot use the conventional function related to The RS-232C communication in "C library for C executor" together.

[Related Function] rs_wrt()

Page 154: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-144-

3.10.12 Open the Reader / Puncher Interface (for FANUC Handy File) [Name]

pl_fopen

[Syntax] #include <pmclib.h> short pl_fopen(short * cntl, short file_no, char * file_name);

[Arguments] Input

*cntl: Control information Set the communication parameter for RS-232C as

following format.

cntl[0] OP Channel number, mode, flow control cntl[1] OB Baud rate cntl[2] OS Stop bits, Parity setting (Low byte) cntl[3] OC Output code (Low byte)

OP (cntl[0]): The channel number, mode and the method of flow

control Set the channel number of RS-232C, communication mode and the method of flow control as following format.

1n: Reading (DC1 / DC3 flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with reading mode and controlled by the DC1 / DC3 flow control. The DC1 code is output to the target device when the communication line is opened. The DC3 code is output to the target device when the communication line is closed. The reading from the target device is flow-controlled by the DC1 and DC3 code from the CNC.

2n: Writing (DC1 / DC3 flow control) Set the channel number of RS-232C to "n". In this

setting, the communication line is opened with writing mode and controlled by the DC1 / DC3 flow control. The DC2 code is output to the target device when the communication line is opened. The DC4 code is output to the target device when the communication line is closed. The writing to the target device is flow-controlled by the DC1 and DC3 code from the target device.

Page 155: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-145-

3n: Reading directory, deleting a file. Set the channel number of RS-232C to "n". In this

setting, you can read directory information or delete the file in FANUC Handy File.

OB (cntl[1]): Baud rate 7:600bps, 8:1200bps, 9:2400bps, 10:4800bps,

11:9600bps OS (cntl[2]): Stop bits, parity setting Set the stop bits and parity setting to the low byte

as following format. 1: 1 stop bit, none parity 2: 2 stop bits, none parity 11: 1 stop bit, odd parity 12: 2 stop bits, odd parity 21: 1 stop bit, even parity 22: 2 stop bits, even parity OC (cntl[3]): Output code Set the output code to the low byte as following

format. 1: ASCII, 2: ISO The target device is FANUC Handy File, you

should set "2". file_no: File number Set the file number on FANUC Handy File to

operate. When you specify the file by the file name, set zero.

*file_name: File name Set the file name on FANUC Handy File to operate.

You should terminate the file name string with NUL ('¥0'). When you use a MS-DOS format floppy disk, the file name is 12 characters in the maximum, "8 characters in the maximum" + ". (dot)" + "3 characters in the maximum". When you use a FANUC format floppy disk, the file name is 17 characters in the maximum. When you specify the file number, you should set NULL(0) to the "file_name".

NOTE When you specify both the file number and the file

name, specification by the file name is available.

Output ---

Page 156: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-146-

[Return] 0: Normal completion. -1: Specified channel is already in use by another user. 5: The argument is invalid.

[Description] This function opens the reader / puncher interface for FANUC Handy File. You should open the interface by the calling of pl_fopen(), not pl_fopen2(), before the calling of pl_rsrd(), pl_rswrt(), pl_fdir() or pl_fdel(). You should close the interface by the calling of pl_rsclose(), not pl_rsclose2(), after the calling of pl_rsrd(), pl_rswrt(), pl_fdir() or pl_fdel(). When you open the interface using the pl_fopen(), you cannot use the function pl_rsrd2(), pl_rswrt2(), pl_fdir2(), pl_fdel2() or pl_rsclose2(). You should use the pl_rsrd(), pl_rswrt(), pl_fdir(), pl_fdel() or pl_rsclose(). When you use this function, you cannot use the conventional function related to The RS-232C communication in "C library for C executor" together. ・ When you open the interface with the file number and with the

setting OP (cntl[0]) = 2n, files after the specified number will be deleted and the new file, its file number is specified number, will be created.

・ When you open the interface with the file number "0" and with the setting OP (cntl[0]) = 2n, the new file, its file number is the last file number + 1, will be created.

・ When you open the interface with the file number "-1" and with the setting OP (cntl[0]) = 2n, all files will be deleted, and next, the new file, which file number is "1", will be created.

・ When you create a file with the setting OP (cntl[0]) = 2n, the default file name will be "#FCAxxxx" for FANUC format floppy disk or will be "#xxxx.DAT" for MS-DOS format floppy disk.

・ When you open the interface with the file name and with the setting OP (cntl[0]) = 2n, the new file, its file number is the last file number + 1 and which file name is specified name, will be created.

[Related Function]

fca_open(), fcs_fopen()

Page 157: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-147-

3.10.13 Get the File Information [Name]

pl_fdir

[Syntax] #include <pmclib.h> short pl_fdir(short file_no, char * file_name, long * size);

[Arguments] Input

file_no: File number Set the file number.

Output *file_name: File name Set pointer to the array to store the file name. The

array size should be 17 bytes. The read file name is 17 characters. The file name is not terminated with NUL ('¥0'). When the file name is less than 17 characters, space character will be added.

"AAAAAAAA.BBB " *size: File size Set pointer to the variable to store the file size.

[Return] 0: Normal completion. -11: The reader / puncher interface is not opened. 5: The argument is invalid. 20: The communication status is invalid or the "DR"

signal is OFF. 23: No specified file

[Description] This function reads the file name and the file size. You should open the interface by the calling of pl_fopen() with the setting OP (cntl[0]) = 3n, not pl_fopen2(), before the calling of pl_fdir(). You should close the interface by the calling of pl_rsclose(), not pl_rsclose2(), after the calling of pl_fdir(). If you want to read the information of two or more files, call pl_fopen(), pl_fdir() and pl_rsclose() repeatedly. When you use this function, you cannot use the conventional function related to The RS-232C communication in "C library for C executor" together.

[Related Function] fca_readdir()

Page 158: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-148-

3.10.14 Delete the File [Name]

pl_fdel

[Syntax] #include <pmclib.h> short pl_fdel(short file_no, char * file_name);

[Arguments] Input

file_no: File number Set the file number on FANUC Handy File to

operate. When you specify the file by the file name, set zero.

*file_name: File name Set the file name on FANUC Handy File to operate.

You should terminate the file name string with NUL ('¥0'). When you use a MS-DOS format floppy disk, the file name is 12 characters in the maximum, "8 characters in the maximum" + ". (dot)" + "3 characters in the maximum". When you use a FANUC format floppy disk, the file name is 17 characters in the maximum. When you specify the file number, you should set NULL(0) to the "file_name".

NOTE When you specify both the file number and the file

name, specification by the file name is available.

Output ---

[Return] 0: Normal completion. -11: The reader / puncher interface is not opened. 5: The argument is invalid.

[Description] The function deletes the specified file. You should open the interface by the calling of pl_fopen() with the setting OP (cntl[0]) = 3n, not pl_fopen2(), before the calling of pl_fdel(). You should close the interface by the calling of pl_rsclose(), not pl_rsclose2(), after the calling of pl_fdel(). If you want to delete two of more files, call pl_fopen(), pl_fdel() and pl_rsclose() repeatedly.

Page 159: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-149-

When some file is deleted, the file number after the deleted file will be changed. When you use this function, you cannot use the conventional function related to The RS-232C communication in "C library for C executor" together.

[Related Function] fca_delete()

Page 160: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-150-

3.11 CNC WINDOW

3.11.1 CNC Window Function (Read) [Name]

pl_nc_windr

[Syntax] #include <pmclib.h> short pl_nc_windr(short * cntl);

[Arguments] Input

*cntl: Control information Set the function code, the number and the attribute. The required array size depends on the function

code, the data number and the data attribute. You should prepare enough array size accordingly.

Supported function code is shown below. No. 0, 13, 15, 17, 19, 21, 23, 24, 25, 26, 27, 28, 29,

30, 31, 32, 33, 34, 50, 59, 74, 75, 76, 90, 153, 154, 155, 156, 321, 395

About the details, refer to the following manual. "Series 30i/ 31i/ 32i PMC Programming manual

(B-63983EN)"

cntl[0] Function code cntl[1] (Return code) cntl[2] (Length) cntl[3] Number cntl[4] Attribute

cntl[5] (Data) to

cntl[n] (Data)

Page 161: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-151-

Output *cntl: Return value The return code, the length and the data are

returned. The read data is returned from the "Data (cntl[5])".

cntl[0] (Function code) cntl[1] Return code cntl[2] Length cntl[3] (Number) cntl[4] (Attribute) cntl[5] Data

to cntl[n] Data

[Return]

0: Normal completion -1: Rejected The reading is rejected by the CNC because of the

busy. Call this function again. -10: Rejected The reading is not completed. Call this function

repeatedly until the completion. 1: The function code cntl[0] is invalid. 3: The number cntl[3] is invalid. 4: The attribute cntl[4] is invalid. 6: No option

[Description] This function reads the various CNC data through the CNC window.

[Related Function] cnc_sysinfo(), cnc_rdprgnum(), cnc_rdseqnum(), cnc_actf(), cnc_acts(), cnc_absolute(), cnc_machine(), cnc_relative(), cnc_distance(), cnc_skip(), cnc_srvdelay(), cnc_accdecdly(), cnc_rddynamic(), cnc_statinfo(), cnc_alarm(), cnc_rdalminfo(), cnc_rdtofs(), cnc_rdtofsr(), cnc_rdzofs(), cnc_rdzofsr(), cnc_rdparam(), cnc_rdparar(), cnc_rdset(), cnc_rdsetr(), cnc_rdpitchr(), cnc_rdmacro(), cnc_rdmacror(), cnc_rdpmacro(), cnc_rdpmacror(), cnc_modal(), cnc_diagnoss(), cnc_diagnosr(), cnc_adcnv(), cnc_rdopmsg(), cnc_setpath(), cnc_rdspload(), cnc_rdmovrlap()

Page 162: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-152-

3.11.2 CNC Window Function (Write) [Name]

pl_nc_windw

[Syntax] #include <pmclib.h> short pl_nc_windw(short * cntl);

[Arguments] Input

*cntl: Control information Set the function code, the length, the number, the

attribute and the data. The required array size depends on the function

code, the data number and the data attribute. You should prepare enough array size accordingly.

Supported function code is shown below. No. 14, 16, 18, 20, 22, 60, 323, 396 About the details, refer to the following manual. "Series 30i/ 31i/ 32i PMC Programming manual

(B-63983EN)"

cntl[0] Function code cntl[1] (Return code) cntl[2] Length cntl[3] Number cntl[4] Attribute cntl[5] Data

to cntl[n] Data

Output

*cntl: Return value The return code is returned.

cntl[0] (Function code) cntl[1] Return code cntl[2] (Length) cntl[3] (Number) cntl[4] (Attribute) cntl[5] (Data)

to cntl[n] (Data)

[Return]

0: Normal completion -1: Rejected

Page 163: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-153-

The reading is rejected by the CNC because of the busy. Call this function again.

-10: Rejected The reading is not completed. Call this function

repeatedly until the completion. 1: The function code cntl[0] is invalid. 2: The length cntl[2] is invalid. 3: The number cntl[3] is invalid. 4: The attribute cntl[4] is invalid. 5: The data cntl[5] is invalid. 6: No option 7: Write protected

[Description] This function writes the various CNC data thorough the CNC window.

[Related Function] cnc_wrtofs(), cnc_wrtofsr(), cnc_wrzofs(), cnc_wrzofsr(), cnc_wrparam(), cnc_wrparas(), cnc_wrset(), cnc_wrsets(), cnc_wrpitchr(), cnc_wrmacro(), cnc_wrmacror(), cnc_wrpmacro(), cnc_wrpmacror(), cnc_setpath(), cnc_settimer()

Page 164: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-154-

3.11.3 External Data Input [Name]

pl_exin

[Syntax] #include <pmclib.h> short pl_exin(short * cntl);

[Arguments] Input

--- Output

---

[Return] ---

[Description] This function is not supported. Use the function EXIN (SUB 42) in your LADDER program. If this function is called, the value 0 is returned without performing any processing.

Page 165: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-155-

3.12 CNC PROGRAM

3.12.1 Start Registration of the CNC Program [Name]

pl_nc_dwnstart2

[Syntax] #include <pmclib.h> short pl_nc_dwnstart2(unsigned short path);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The CNC is in background editing mode. - The CNC is in MDI mode. - P/S 000 or P/S101 alarm status

1: The "path" is invalid. 7: Write protect

[Description] This function starts a registration of the CNC program. You should call the pl_nc_dwnstart2() before the calling of the pl_nc_download2(). You should call the pl_nc_dwnend2() after the pl_nc_download2(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_dwnstart(), cnc_download(), cnc_dwnend()

Page 166: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-156-

3.12.2 Register the CNC Program [Name]

pl_nc_download2

[Syntax] #include <pmclib.h> short pl_nc_download2(unsigned short path, char * buf, unsigned

short size);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. *but: CNC program Set the CNC program that you want to register

with following format. "Oxxxx¥n(Block 1)¥n(Block 2)¥n...¥nMxx¥n%" The "Oxxxx" is a program number, the "Mxx" is a

M code. The beginning of CNC program should be program number, "Oxxxx". The end of CNC program should be the "%" character.

Example) O1234 ; G1 F0.3 W10. ; M30 : % If you want to register above CNC program, you

should set following string. "O1234¥nG1F0.3W10.¥nM30¥n%" You can register 256 characters of CNC program

in the maximum in one time calling. If you want to register more than 256 characters of CNC program, you should call this function repeatedly.

size: Byte count of the CNC program Set the byte count of the CNC program.

Output ---

[Return] 0: Normal completion. -11: The function pl_nc_dwnstart2() is not called. 1: The "path" is invalid. 2: The "size" is invalid.

Page 167: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-157-

5: The CNC program is invalid. This error happens when following cases. - The duplicate number program has been

registered. - An illegal character is found in the CNC

program. - When a TV check is enabled, a block that

includes odd number of characters is detected. - The maximum number of programs is

exceeded. 8: No space in the CNC tape memory

[Description] This function registers the CNC program. You can register the CNC program, which is described using ASCII characters. You should call the pl_nc_dwnstart2() before the calling of the pl_nc_download2(). You should call the pl_nc_dwnend2() after the calling of the pl_nc_download2(). You can register the CNC program that is more than 256 characters by the repeated calling of this function. When you register the duplicate number of CNC program, the behavior of the CNC is depends on the CNC parameter "REP (No.3201#2)". REP = 0: The return code is "5" and no CNC program registers. REP = 1: The return code is "0" and the existing CNC program will be

replaced by the specified program. However, when the existing CNC program that should be replaced is currently selected by the CNC, you cannot replace it.

When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_dwnstart(), cnc_download(), cnc_dwnend()

Page 168: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-158-

3.12.3 End Registration of the CNC Program [Name]

pl_nc_dwnend2

[Syntax] #include <pmclib.h> short pl_nc_dwnend2(unsigned short path);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. Output

---

[Return] 0: Normal completion. -11: The function pl_nc_dwnstart2() is not called. 1: The "path" is invalid. 5: The CNC program is invalid. This error happens

when following cases. - The duplicate number program has been

registered. - An illegal character is found in the CNC

program. - When a TV check is enabled, a block that

includes odd number of characters is detected. - The maximum number of programs is

exceeded. 8: No space in the CNC tape memory

[Description] This function ends a registration of the CNC program. You should call the pl_nc_dwnend2() after the calling of the pl_nc_dwnload2(). The error code of the pl_nc_download2(), which is previously called, may be sometimes returned in this function. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_dwnstart(), cnc_download(), cnc_dwnend()

Page 169: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-159-

3.12.4 Start DNC running of the CNC Program [Name]

pl_nc_dncstart2

[Syntax] #include <pmclib.h> short pl_nc_dncstart2(unsigned short path);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - Alarm state - The "Automatic operation signal OP (F000#7)"

is on. - The "DMMC signal (G42#7)" is off.

1: The "path" is invalid.

[Description] This function starts a DNC running of the CNC program. You should call the pl_nc_dncstart2() before the calling of the pl_nc_dnc2(). You should call the pl_nc_dncend2() after the calling of the pl_nc_dnc2(). The procedure of the DNC running is shown below. (1) Set the CNC to MEM mode. (2) Turn the "DMMC signal (G42#7)" on. (3) Execute the pl_nc_dncstart2(). (4) Turn the "ST signal (G7#2)" off and on and off to start program. (5) Transfer the CNC program using the pl_nc_dnc2(). (6) Execute the pl_nc_dncend2(). (7) Reset the CNC after the completion of the CNC program. (8) Turn the "DMMC signal (G42#7)" off. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

Page 170: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-160-

[Related Function]

cnc_dncstart(), cnc_dnc(), cnc_dncend()

Page 171: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-161-

3.12.5 Run the CNC Program (DNC running) [Name]

pl_nc_dnc2

[Syntax] #include <pmclib.h> short pl_nc_dnc2(unsigned short path, char * buf, unsigned short

size);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. *but: CNC program Set the CNC program that you want to run with

following format. "Oxxxx¥n(Block 1)¥n(Block 2)¥n...¥nMxx¥n%" The "Oxxxx" is a program number, the "Mxx" is a

M code. The beginning of CNC program should be program number, "Oxxxx". The end of CNC program should be the "%" character.

Example) O1234 ; G1 F0.3 W10. ; M30 : % If you want to run above CNC program, you

should set following string. "O1234¥nG1F0.3W10.¥nM30¥n%" You can run 256 characters of CNC program in the

maximum in one time calling. If you want to run more than 256 characters of CNC program, you should call this function repeatedly.

size: Byte count of the CNC program Set the byte count of the CNC program.

Output ---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed.

Page 172: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-162-

- Another command is executing. (Downloading, Verifying, Uploading, listing program)

- Alarm status - The "Automatic operation signal OP (F000#7)"

is on. - The "DMMC signal (G42#7)" is off.

-2: Reset state Stop the calling of this function and call the

pl_nc_dncend2(). -11: The function pl_nc_dncstart2() is not called. 1: The "path" is invalid. 2: The "size" is invalid. 5: The CNC program is invalid.

- An illegal character is found in the CNC program.

- When a TV check is enabled, a block that includes odd number of characters is detected.

[Description]

This function runs the CNC program. (DNC running) You can run the CNC program, which is described using ASCII characters". You should call the pl_nc_dncstart2() before the calling of the pl_nc_dnc2(). You should call the pl_nc_dncend2() after the calling of the pl_nc_dnc2(). You can run the CNC program that is more than 256 characters by the repeated calling of this function. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_dncstart(), cnc_dnc(), cnc_dncend()

Page 173: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-163-

3.12.6 End DNC Running of the CNC Program [Name]

pl_nc_dncend2

[Syntax] #include <pmclib.h> short pl_nc_dncend2(unsigned short path);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. Output

---

[Return] 0: Normal completion. -2: Reset state -11: The function pl_nc_dncstart2() is not called. 1: The "path" is invalid. 5: The CNC program is invalid.

- An illegal character is found in the CNC program.

- When a TV check is enabled, a block that includes odd number of characters is detected.

[Description]

This function ends the DNC running of the CNC program. You should call the pl_nc_dncend2() after the calling of the pl_nc_dnc2(). The error code of the pl_nc_dnc2(), which is previously called, may be sometimes returned in this function. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_dncstart(), cnc_dnc(), cnc_dncend()

Page 174: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-164-

3.12.7 Search the CNC Program (Supported 8 Digits Program Number) [Name]

pl_nc_search2_8d

[Syntax] #include <pmclib.h> short pl_nc_search2(unsigned short path, long no);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. no: The CNC program number Set the CNC program number, which you want to

search. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The CNC is in EDIT or MEM mode, and the

"Automatic operation signal OP (F000#7) is on.

- Alarm state of P/S 000 or P/S 101 1: The "path" is invalid. 5: No specified program 7: Write protect

[Description] This function searches the CNC program to run in MEM mode. When the CNC is in EDIT or MEM mode, the foreground search will be done. When the CNC is in another mode, the background search will be done. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_search()

Page 175: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-165-

3.12.8 Search the CNC Program [Name]

pl_nc_search2

[Syntax] #include <pmclib.h> short pl_nc_search2(unsigned short path, short no);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. no: The CNC program number Set the CNC program number, which you want to

search. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The CNC is in EDIT or MEM mode, and the

"Automatic operation signal OP (F000#7) is on.

- Alarm state of P/S 000 or P/S 101 1: The "path" is invalid. 5: No specified program 7: Write protect

[Description] This function searches the CNC program to run in MEM mode. When the CNC is in EDIT or MEM mode, the foreground search will be done. When the CNC is in another mode, the background search will be done. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_search()

Page 176: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-166-

3.12.9 Delete All CNC Programs [Name]

pl_nc_delall2

[Syntax] #include <pmclib.h> short pl_nc_delal2l(unsigned short path);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The "Automatic operation signal OP (F000#7)"

is on. - Alarm state of P/S 000, P/S 101 or BP/S.

1: The "path" is invalid. 7: Memory protected, Program protected

[Description]

This function deletes all CNC programs. The selected CNC program in foreground is also deleted. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_delall()

Page 177: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-167-

3.12.10 Delete the CNC Program (Supported 8 Digits Program Number) [Name]

pl_nc_delete2_8d

[Syntax] #include <pmclib.h> short pl_nc_delete2_8d(unsigned short path, long no);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. no: The CNC program number Set the CNC program number, which you want to

delete. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The "Automatic operation signal OP (F000#7)"

is on. - Alarm state of P/S 000, P/S 101 or BP/S.

1: The "path" is invalid. 5: No specified program 7: Memory protected, Program protected

[Description]

This function deletes the CNC program. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_delete()

Page 178: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-168-

3.12.11 Delete the CNC Program [Name]

pl_nc_delete2

[Syntax] #include <pmclib.h> short pl_nc_delete2(unsigned short path, short no);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. no: The CNC program number Set the CNC program number, which you want to

delete. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The "Automatic operation signal OP (F000#7)"

is on. - Alarm state of P/S 000, P/S 101 or BP/S.

1: The "path" is invalid. 5: No specified program 7: Memory protected, Program protected

[Description]

This function deletes the CNC program. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_delete()

Page 179: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-169-

3.12.12 Start Reading of the CNC Program (Supported 8 Digits Program Number) [Name]

pl_nc_upstart2_8d

[Syntax] #include <pmclib.h> short pl_nc_upstart2_8d(unsigned short path, long no);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. no: The CNC program number Set the CNC program number, which you want to

read. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The "Automatic operation signal OP (F000#7)"

is on. - Alarm state of P/S 000, P/S 101 or BP/S. - The CNC is in background editing mode or

MDI mode. 1: The "path" is invalid. 5: No specified program 7: Program protected

[Description] This function starts reading of the CNC program. You should call the pl_nc_upstart2_8d() before the calling of the pl_nc_upload2(). You should call the pl_nc_upend2() after the calling of the pl_nc_upload2(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_upstart(), cnc_upload(), cnc_upend()

Page 180: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-170-

3.12.13 Start Reading of the CNC Program [Name]

pl_nc_upstart2

[Syntax] #include <pmclib.h> short pl_nc_upstart2(unsigned short path, short no);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. no: The CNC program number Set the CNC program number, which you want to

read. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The "Automatic operation signal OP (F000#7)"

is on. - Alarm state of P/S 000, P/S 101 or BP/S. - The CNC is in background editing mode or

MDI mode. 1: The "path" is invalid. 5: No specified program 7: Program protected

[Description] This function starts reading of the CNC program. You should call the pl_nc_upstart2() before the calling of the pl_nc_upload2(). You should call the pl_nc_upend2() after the calling of the pl_nc_upload2(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_upstart(), cnc_upload(), cnc_upend()

Page 181: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-171-

3.12.14 Read the CNC Program [Name]

pl_nc_upload2

[Syntax] #include <pmclib.h> short pl_nc_upload2(unsigned short path, char * buf, unsigned short

size);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. buf: Pointer to the array to store the read program Set the pointer to the array, which the read CNC

program is stored. *size: Size of array Set the size of array. You can set 256 bytes in the

maximum. Output

*buf: Read CNC program The CNC program is stored with the following

format. "¥nOxxxx¥n(Block 1)¥n(Block

2)¥n...¥nMxx¥n%" The "Oxxxx" is the program number. The "Mxx" is

the M code. The end of the CNC program is the "%" character. Note that the read CNC program is not terminated with NUL ('¥0').

*size: Size of read data The size of read data is returned. The value is

equal or less than the specified value at calling.

[Return] 0: Normal completion. -11: The function pl_nc_upstart2() is not called. 1: The "path" is invalid. 2: The "size" is invalid.

[Description] This function reads the CNC program. You can read the CNC program described by ASCII characters. You should call the pl_nc_upstart2_8d() or pl_nc_upstart2() before the calling of the pl_nc_upload2(). You should call the pl_nc_upend2() after the calling of the pl_nc_upload2().

Page 182: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-172-

You can read the CNC program that is more than 256 characters by the repeated calling of this function. The end of CNC program is the "%". Call until the "%" character is read repeatedly. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_upstart(), cnc_upload(), cnc_upend()

Page 183: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-173-

3.12.15 End Reading of the CNC Program [Name]

pl_nc_upend2

[Syntax] #include <pmclib.h> short pl_nc_upend2(unsigned short path);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. Output

---

[Return] 0: Normal completion. -11: The function pl_nc_upstart2() is not called. 1: The "path" is invalid.

[Description] This function ends the reading of the CNC program. You should call pl_nc_upend2() after the calling of the pl_nc_upload2(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_upstart(), cnc_upload(), cnc_upend()

Page 184: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-174-

3.12.16 Read the CNC Program Memory Information [Name]

pl_nc_dir2

[Syntax] #include <pmclib.h> short pl_nc_dir2(unsigned short path, short * cntl);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. cntl: Pointer to the array to store the read data Set the pointer to the array, which the read data is

stored. The 12-byte array is required. Output

*cntl: Read data The read data is stored with the following format.

cntl[0] The number of CNC programs

cntl[1] The number of CNC programs, which you can

register.

cntl[2] cntl[3]

Used memory (Characters)

cntl[4] cntl[5]

Unused memory (Characters)

[Return]

0: Normal completion. 1: The "path" is invalid.

[Description] This function reads the CNC program memory information. You can read the number of CNC programs, the number of CNC programs that you can register, and the used and unused characters in the memory can be read. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_rdproginfo()

Page 185: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-175-

3.12.17 Start Reading of the CNC Program List (Supported 8 Digits Program Number) [Name]

pl_nc_pdirstart2_8d

[Syntax] #include <pmclib.h> short pl_nc_pdirstart2_8d(unsigned short path, short type, long *

cntl);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. type: Data type Set the data type that you want to read. 0: Read the CNC program number 1: Read the CNC program number, comment and

the number of used characters. *cntl: Control information Set the start and end number of the CNC program

with following format. If you set zero to the start number, the list is read from the top of the CNC program. If you set zero to the end number, the list is read until bottom of the CNC program.

cntl[0] Start program number cntl[1] End program number

Output

---

[Return] 0: Normal completion. 1: The "path" is invalid. 3: The "type" is invalid.

[Description] This function starts reading of the CNC program list. You should call the pl_nc_pdirstart2_8d() before the calling of the pl_nc_progdir2(). You should call the pl_nc_pdirend2() after the calling of the pl_nc_progdir2(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

Page 186: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-176-

[Related Function] cnc_rdprogdir()

Page 187: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-177-

3.12.18 Start Reading of the CNC Program List [Name]

pl_nc_pdirstart2

[Syntax] #include <pmclib.h> short pl_nc_pdirstart2(unsigned short path, short type, short * cntl);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. type: Data type Set the data type that you want to read. 0: Read the CNC program number 1: Read the CNC program number, comment and

the number of used characters. *cntl: Control information Set the start and end number of the CNC program

with following format. If you set zero to the start number, the list is read from the top of the CNC program. If you set zero to the end number, the list is read until bottom of the CNC program.

cntl[0] Start program number cntl[1] End program number

Output

---

[Return] 0: Normal completion. 1: The "path" is invalid. 3: The "type" is invalid.

[Description] This function starts reading of the CNC program list. You should call the pl_nc_pdirstart2() before the calling of the pl_nc_progdir2(). You should call the pl_nc_pdirend2() after the calling of the pl_nc_progdir2(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_rdprogdir()

Page 188: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-178-

3.12.19 Read the CNC Program List [Name]

pl_nc_progdir2

[Syntax] #include <pmclib.h> short pl_nc_progdir2(unsigned short path, char * buf, unsigned short *

size);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. buf: The pointer to the array to store the read data Set the pointer to the array, which the read data is

stored. *size: Size of array Set the size of array. You can set 256 bytes in the

maximum. Output

*buf: Read CNC program list - When you set zero to the "type", the data will

be read with following format. "OxxxxOxxxx ... %"

- When you set 1 to the "type", the data will be read with following format.

- "%¥nOxxxx(Comment)yyyy¥nOxxxx(Comment)yyyy¥n...%"

The "Oxxxx" is the CNC program number, which sorted by its character code. The "yyyy" is the number of characters of the CNC program and this size is rounded off to 80 characters unit. The "(Comment)" is a comment string, which is described after the program number "Oxxxx". The comment that you can read is 50 characters, included "()", in the maximum. The characters over 50 cannot be read. When no comment is described, the "()" will be returned.

Note that this read comment is not terminated with NULL ('¥0').

[Return]

0: Normal completion. -1: Rejected

Page 189: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-179-

When the CNC is following status, this function cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - Alarm state of P/S 000 or P/S 101 - The CNC is in background editing mode or

MDI mode. -2: Reset state -11: The function pl_nc_pdirstart2() is not called. 1: The "path" is invalid. 2: The "size" is invalid.

[Description] This function reads the CNC program list. You should call the pl_nc_pdirstart2_8d() or pl_nc_pdirstart2() before the calling of the pl_nc_progdir2(). You should call the pl_nc_pdirend2() after the calling of the pl_nc_progdir2(). The end of data is the "%". Call until the "%" character is read repeatedly. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_rdprogdir()

Page 190: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-180-

3.12.20 End Reading of the Program List [Name]

pl_nc_pdirend2

[Syntax] #include <pmclib.h> short pl_nc_pdirend2(unsigned short path);

[Arguments] Input

path: The CNC path number(from 1) Set the CNC path number. When you set zero, first

path CNC is selected. Output

---

[Return] 0: Normal completion. -11: The function pl_nc_pdirstart2() is not called. 1: The "path" is invalid.

[Description] This function ends the reading of the CNC program list. You should call the pl_pdirend2() after the calling of the pl_progdir2(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_rdprogdir()

Page 191: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-181-

3.12.21 Start Registration of the CNC Program [Name]

pl_nc_dwnstart

[Syntax] #include <pmclib.h> short pl_nc_dwnstart(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The CNC is in background editing mode. - The CNC is in MDI mode. - P/S 000 or P/S101 alarm status

7: Write protect

[Description] This function starts a registration of the CNC program. You should call the pl_nc_dwnstart() before the calling of the pl_nc_download(). You should call the pl_nc_dwnend() after the pl_nc_download(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_dwnstart(), cnc_download(), cnc_dwnend()

Page 192: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-182-

3.12.22 Register the CNC Program [Name]

pl_nc_download

[Syntax] #include <pmclib.h> short pl_nc_download(char * buf, unsigned short size);

[Arguments] Input

*but: CNC program Set the CNC program that you want to register

with following format. "Oxxxx¥n(Block 1)¥n(Block 2)¥n...¥nMxx¥n%" The "Oxxxx" is a program number, the "Mxx" is a

M code. The beginning of CNC program should be program number, "Oxxxx". The end of CNC program should be the "%" character.

Example) O1234 ; G1 F0.3 W10. ; M30 : % If you want to register above CNC program, you

should set following string. "O1234¥nG1F0.3W10.¥nM30¥n%" You can register 256 characters of CNC program

in the maximum in one time calling. If you want to register more than 256 characters of CNC program, you should call this function repeatedly.

size: Byte count of the CNC program Set the byte count of the CNC program.

Output ---

[Return] 0: Normal completion. -11: The function pl_nc_dwnstart() is not called. 2: The "size" is invalid. 5: The CNC program is invalid. This error happens

when following cases. - The duplicate number program has been

registered. - An illegal character is found in the CNC

program.

Page 193: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-183-

- When a TV check is enabled, a block that includes odd number of characters is detected.

- The maximum number of programs is exceeded.

8: No space in the CNC tape memory

[Description] This function registers the CNC program. You can register the CNC program, which is described using ASCII characters. You should call the pl_nc_dwnstart() before the calling of the pl_nc_download(). You should call the pl_nc_dwnend() after the calling of the pl_nc_download(). You can register the CNC program that is more than 256 characters by the repeated calling of this function. When you register the duplicate number of CNC program, the behavior of the CNC is depends on the CNC parameter "REP (No.3201#2)". REP = 0: The return code is "5" and no CNC program registers. REP = 1: The return code is "0" and the existing CNC program will be

replaced by the specified program. However, when the existing CNC program that should be replaced is currently selected by the CNC, you cannot replace it.

When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_dwnstart(), cnc_download(), cnc_dwnend()

Page 194: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-184-

3.12.23 End Registration of the CNC Program [Name]

pl_nc_dwnend

[Syntax] #include <pmclib.h> short pl_nc_dwnend(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion. -11: The function pl_nc_dwnstart() is not called. 5: The CNC program is invalid. This error happens

when following cases. - The duplicate number program has been

registered. - An illegal character is found in the CNC

program. - When a TV check is enabled, a block that

includes odd number of characters is detected. - The maximum number of programs is

exceeded. 8: No space in the CNC tape memory

[Description] This function ends a registration of the CNC program. You should call the pl_nc_dwnend() after the calling of the pl_nc_dwnload(). The error code of the pl_nc_download(), which is previously called, may be sometimes returned in this function. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_dwnstart(), cnc_download(), cnc_dwnend()

Page 195: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-185-

3.12.24 Start DNC running of the CNC Program [Name]

pl_nc_dncstart

[Syntax] #include <pmclib.h> short pl_nc_dncstart(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - Alarm state - The "Automatic operation signal OP (F000#7)"

is on. - The "DMMC signal (G42#7)" is off.

[Description]

This function starts a DNC running of the CNC program. You should call the pl_nc_dncstart() before the calling of the pl_nc_dnc(). You should call the pl_nc_dncend() after the calling of the pl_nc_dnc(). The procedure of the DNC running is shown below. (1) Set the CNC to MEM mode. (2) Turn the "DMMC signal (G42#7)" on. (3) Execute the pl_nc_dncstart(). (4) Turn the "ST signal (G7#2)" off and on and off to start program. (5) Transfer the CNC program using the pl_nc_dnc(). (6) Execute the pl_nc_dncend(). (7) Reset the CNC after the completion of the CNC program. (8) Turn the "DMMC signal (G42#7)" off. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_dncstart(), cnc_dnc(), cnc_dncend()

Page 196: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-186-

3.12.25 Run the CNC Program (DNC running) [Name]

pl_nc_dnc

[Syntax] #include <pmclib.h> short pl_nc_dnc(char * buf, unsigned short size);

[Arguments] Input

*but: CNC program Set the CNC program that you want to run with

following format. "Oxxxx¥n(Block 1)¥n(Block 2)¥n...¥nMxx¥n%" The "Oxxxx" is a program number, the "Mxx" is a

M code. The beginning of CNC program should be program number, "Oxxxx". The end of CNC program should be the "%" character.

Example) O1234 ; G1 F0.3 W10. ; M30 : % If you want to run above CNC program, you

should set following string. "O1234¥nG1F0.3W10.¥nM30¥n%" You can run 256 characters of CNC program in the

maximum in one time calling. If you want to run more than 256 characters of CNC program, you should call this function repeatedly.

size: Byte count of the CNC program Set the byte count of the CNC program.

Output ---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - Alarm status - The "Automatic operation signal OP (F000#7)"

is on.

Page 197: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-187-

- The "DMMC signal (G42#7)" is off. -2: Reset state Stop the calling of this function and call the

pl_nc_dncend(). -11: The function pl_nc_dncstart() is not called. 2: The "size" is invalid. 5: The CNC program is invalid.

- An illegal character is found in the CNC program.

- When a TV check is enabled, a block that includes odd number of characters is detected.

[Description]

This function runs the CNC program. (DNC running) You can run the CNC program, which is described using ASCII characters". You should call the pl_nc_dncstart() before the calling of the pl_nc_dnc(). You should call the pl_nc_dncend() after the calling of the pl_nc_dnc(). You can run the CNC program that is more than 256 characters by the repeated calling of this function. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_dncstart(), cnc_dnc(), cnc_dncend()

Page 198: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-188-

3.12.26 End DNC Running of the CNC Program [Name]

pl_nc_dncend

[Syntax] #include <pmclib.h> short pl_nc_dncend(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion. -2: Reset state -11: The function pl_nc_dncstart() is not called. 5: The CNC program is invalid.

- An illegal character is found in the CNC program.

- When a TV check is enabled, a block that includes odd number of characters is detected.

[Description]

This function ends the DNC running of the CNC program. You should call the pl_nc_dncend() after the calling of the pl_nc_dnc(). The error code of the pl_nc_dnc(), which is previously called, may be sometimes returned in this function. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_dncstart(), cnc_dnc(), cnc_dncend()

Page 199: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-189-

3.12.27 Search the CNC Program (Supported 8 Digits Program Number) [Name]

pl_nc_search_8d

[Syntax] #include <pmclib.h> short pl_nc_search_8d(long no);

[Arguments] Input

no: The CNC program number Set the CNC program number, which you want to

search. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The CNC is in EDIT or MEM mode, and the

"Automatic operation signal OP (F000#7) is on.

- Alarm state of P/S 000 or P/S 101 5: No specified program 7: Write protect

[Description] This function searches the CNC program to run in MEM mode. When the CNC is in EDIT or MEM mode, the foreground search will be done. When the CNC is in another mode, the background search will be done. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_search()

Page 200: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-190-

3.12.28 Search the CNC Program [Name]

pl_nc_search

[Syntax] #include <pmclib.h> short pl_nc_search(short no);

[Arguments] Input

no: The CNC program number Set the CNC program number, which you want to

search. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The CNC is in EDIT or MEM mode, and the

"Automatic operation signal OP (F000#7) is on.

- Alarm state of P/S 000 or P/S 101 5: No specified program 7: Write protect

[Description] This function searches the CNC program to run in MEM mode. When the CNC is in EDIT or MEM mode, the foreground search will be done. When the CNC is in another mode, the background search will be done. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_search()

Page 201: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-191-

3.12.29 Delete All CNC Programs [Name]

pl_nc_delall

[Syntax] #include <pmclib.h> short pl_nc_delall(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The "Automatic operation signal OP (F000#7)"

is on. - Alarm state of P/S 000, P/S 101 or BP/S.

7: Memory protected, Program protected [Description]

This function deletes all CNC programs. The selected CNC program in foreground is also deleted. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_delall()

Page 202: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-192-

3.12.30 Delete the CNC Program (Supported 8 Digits Program Number) [Name]

pl_nc_delete_8d

[Syntax] #include <pmclib.h> short pl_nc_delete_8d(long no);

[Arguments] Input

no: The CNC program number Set the CNC program number, which you want to

delete. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The "Automatic operation signal OP (F000#7)"

is on. - Alarm state of P/S 000, P/S 101 or BP/S.

5: No specified program 7: Memory protected, Program protected

[Description]

This function deletes the CNC program. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_delete()

Page 203: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-193-

3.12.31 Delete the CNC Program [Name]

pl_nc_delete

[Syntax] #include <pmclib.h> short pl_nc_delete(short no);

[Arguments] Input

no: The CNC program number Set the CNC program number, which you want to

delete. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The "Automatic operation signal OP (F000#7)"

is on. - Alarm state of P/S 000, P/S 101 or BP/S.

5: No specified program 7: Memory protected, Program protected

[Description]

This function deletes the CNC program. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_delete()

Page 204: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-194-

3.12.32 Start Reading of the CNC Program (Supported 8 Digits Program Number) [Name]

pl_nc_upstart_8d

[Syntax] #include <pmclib.h> short pl_nc_upstart_8d(long no);

[Arguments] Input

no: The CNC program number Set the CNC program number, which you want to

read. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The "Automatic operation signal OP (F000#7)"

is on. - Alarm state of P/S 000, P/S 101 or BP/S. - The CNC is in background editing mode or

MDI mode. 5: No specified program 7: Program protected

[Description] This function starts reading of the CNC program. You should call the pl_nc_upstart_8d() before the calling of the pl_nc_upload(). You should call the pl_nc_upend() after the calling of the pl_nc_upload(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_upstart(), cnc_upload(), cnc_upend()

Page 205: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-195-

3.12.33 Start Reading of the CNC Program [Name]

pl_nc_upstart

[Syntax] #include <pmclib.h> short pl_nc_upstart(short no);

[Arguments] Input

no: The CNC program number Set the CNC program number, which you want to

read. Output

---

[Return] 0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program) - The "Automatic operation signal OP (F000#7)"

is on. - Alarm state of P/S 000, P/S 101 or BP/S. - The CNC is in background editing mode or

MDI mode. 5: No specified program 7: Program protected

[Description] This function starts reading of the CNC program. You should call the pl_nc_upstart() before the calling of the pl_nc_upload(). You should call the pl_nc_upend() after the calling of the pl_nc_upload(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_upstart(), cnc_upload(), cnc_upend()

Page 206: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-196-

3.12.34 Read the CNC Program [Name]

pl_nc_upload

[Syntax] #include <pmclib.h> short pl_nc_upload(char * buf, unsigned short size);

[Arguments] Input

buf: Pointer to the array to store the read program Set the pointer to the array, which the read CNC

program is stored. *size: Size of array Set the size of array. You can set 256 bytes in the

maximum. Output

*buf: Read CNC program The CNC program is stored with the following

format. "¥nOxxxx¥n(Block 1)¥n(Block

2)¥n...¥nMxx¥n%" The "Oxxxx" is the program number. The "Mxx" is

the M code. The end of the CNC program is the "%" character. Note that the read CNC program is not terminated with NUL ('¥0').

*size: Size of read data The size of read data is returned. The value is

equal or less than the specified value at calling.

[Return] 0: Normal completion. -11: The function pl_nc_upstart() is not called. 2: The "size" is invalid.

[Description] This function reads the CNC program. You can read the CNC program described by ASCII characters. You should call the pl_nc_upstart_8d() or pl_nc_upstart() before the calling of the pl_nc_upload(). You should call the pl_nc_upend() after the calling of the pl_nc_upload(). You can read the CNC program that is more than 256 characters by the repeated calling of this function. The end of CNC program is the "%". Call until the "%" character is read repeatedly.

Page 207: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-197-

When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_upstart(), cnc_upload(), cnc_upend()

Page 208: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-198-

3.12.35 End Reading of the CNC Program [Name]

pl_nc_upend

[Syntax] #include <pmclib.h> short pl_nc_upend(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion. -11: The function pl_nc_upstart() is not called.

[Description] This function ends the reading of the CNC program. You should call pl_nc_upend() after the calling of the pl_nc_upload(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_upstart(), cnc_upload(), cnc_upend()

Page 209: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-199-

3.12.36 Read the CNC Program Memory Information [Name]

pl_nc_dir

[Syntax] #include <pmclib.h> short pl_nc_dir(short * cntl);

[Arguments] Input

cntl: Pointer to the array to store the read data Set the pointer to the array, which the read data is

stored. The 12-byte array is required. Output

*cntl: Read data The read data is stored with the following format.

cntl[0] The number of CNC programs

cntl[1] The number of CNC programs, which you can

register.

cntl[2] cntl[3]

Used memory (Characters)

cntl[4] cntl[5]

Unused memory (Characters)

[Return]

0: Normal completion.

[Description] This function reads the CNC program memory information. You can read the number of CNC programs, the number of CNC programs that you can register, and the used and unused characters in the memory can be read. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_rdproginfo ()

Page 210: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-200-

3.12.37 Start Reading of the CNC Program List (Supported 8 Digits Program Number) [Name]

pl_nc_pdirstart_8d

[Syntax] #include <pmclib.h> short pl_nc_pdirstart_8d(short type, long * cntl);

[Arguments] Input

type: Data type Set the data type that you want to read. 0: Read the CNC program number 1: Read the CNC program number, comment and

the number of used characters. *cntl: Control information Set the start and end number of the CNC program

with following format. If you set zero to the start number, the list is read from the top of the CNC program. If you set zero to the end number, the list is read until bottom of the CNC program.

cntl[0] Start program number cntl[1] End program number

Output

---

[Return] 0: Normal completion. 3: The "type" is invalid.

[Description] This function starts reading of the CNC program list. You should call the pl_nc_pdirstart_8d() before the calling of the pl_nc_progdir(). You should call the pl_nc_pdirend() after the calling of the pl_nc_progdir(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_rdprogdir()

Page 211: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-201-

3.12.38 Start Reading of the CNC Program List [Name]

pl_nc_pdirstart

[Syntax] #include <pmclib.h> short pl_nc_pdirstart(short type, short * cntl);

[Arguments] Input

type: Data type Set the data type that you want to read. 0: Read the CNC program number 1: Read the CNC program number, comment and

the number of used characters. *cntl: Control information Set the start and end number of the CNC program

with following format. If you set zero to the start number, the list is read from the top of the CNC program. If you set zero to the end number, the list is read until bottom of the CNC program.

cntl[0] Start program number cntl[1] End program number

Output

---

[Return] 0: Normal completion. 3: The "type" is invalid.

[Description] This function starts reading of the CNC program list. You should call the pl_nc_pdirstart() before the calling of the pl_nc_progdir(). You should call the pl_nc_pdirend() after the calling of the pl_nc_progdir(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_rdprogdir()

Page 212: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-202-

3.12.39 Read the CNC Program List [Name]

pl_nc_progdir

[Syntax] #include <pmclib.h> short pl_nc_progdir(char * buf, unsigned short * size);

[Arguments] Input

buf: The pointer to the array to store the read data Set the pointer to the array, which the read data is

stored. *size: Size of array Set the size of array. You can set 256 bytes in the

maximum. Output

*buf: Read CNC program list - When you set zero to the "type", the data will

be read with following format. "OxxxxOxxxx ... %"

- When you set 1 to the "type", the data will be read with following format.

- "%¥nOxxxx(Comment)yyyy¥nOxxxx(Comment)yyyy¥n...%"

The "Oxxxx" is the CNC program number, which sorted by its character code. The "yyyy" is the number of characters of the CNC program and this size is rounded off to 80 characters unit. The "(Comment)" is a comment string, which is described after the program number "Oxxxx". The comment that you can read is 50 characters, included "()", in the maximum. The characters over 50 cannot be read. When no comment is described, the "()" will be returned. Note that this read comment is not terminated with NULL ('¥0').

[Return]

0: Normal completion. -1: Rejected When the CNC is following status, this function

cannot be executed. - Another command is executing. (Downloading,

Verifying, Uploading, listing program)

Page 213: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-203-

- Alarm state of P/S 000 or P/S 101 - The CNC is in background editing mode or

MDI mode. -2: Reset state -11: The function pl_nc_pdirstart() is not called. 2: The "size" is invalid.

[Description] This function reads the CNC program list. You should call the pl_nc_pdirstart_8d() or the pl_nc_pdirstart() before the calling of the pl_nc_progdir(). You should call the pl_nc_pdirend() after the calling of the pl_nc_progdir(). The end of data is the "%". Call until the "%" character is read repeatedly. When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_rdprogdir()

Page 214: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-204-

3.12.40 End Reading of the Program List [Name]

pl_nc_pdirend

[Syntax] #include <pmclib.h> short pl_nc_pdirend(void);

[Arguments] Input

--- Output

---

[Return] 0: Normal completion. -11: The function pl_nc_pdirstart() is not called.

[Description] This function ends the reading of the CNC program list. You should call the pl_pdirend() after the calling of the pl_progdir(). When you use this function, you cannot use the conventional function related to the CNC program operation in "C library for C executor" together.

[Related Function] cnc_rdprogdir()

Page 215: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 3.FUNCTION REFERENCE

-205-

3.13 CHARACTER CODE CONVERSION

3.13.1 Convert Characters from ASCII to ISO Code [Name]

pl_asciso

[Syntax] #include <pmclib.h> void pl_asciso(unsigned short size, char * buf);

[Arguments] Input

size: The size of characters to be converted (1 to 65535) buf: Pointer to the source of conversion

Output *buf: Converted data

[Return] ---

[Description] This function converts characters from ASCII to ISO code.

[Related Function] ---

Page 216: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

3.FUNCTION REFERENCE B- 64183EN/01

-206-

3.13.2 Convert Characters from ISO to ASCII Code [Name]

pl_isoasc

[Syntax] #include <pmclib.h> void pl_isoasc(unsigned short size, char * buf);

[Arguments] Input

size: The size of characters to be converted (1 to 65535) buf: Pointer to the source of conversion

Output *buf: Converted data

[Return] ---

[Description] This function converts characters from ASCII to ISO code.

[Related Function] ---

Page 217: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 4.CHARACTER CODE (KANJI, HIRAGANA AND OTHERS)

-207-

4 CHARACTER CODE (KANJI, HIRAGANA AND OTHERS)

JIS Shift JIS 0 1 2 3 4 5 6 7 8 9 A B C D E F

2120 813F 全角空白 , 。 , . ・ : ; ? ! " ゜ ´ ` ¨

2130 814F ^  ̄ _ ヽ ヾ ゝ ゞ 〃 仝 々 〆 〇 ー ― ‐ /

2140 815F \ ~ ∥ | … ‥ ' ' " " ( ) 〔 〕 [ ]

2150 816F { } 〈 〉 《 》 「 」 『 』 【 】 + - ± ×2160 8180 ÷ = ≠ < > ≦ ≧ ∞ ∴ ♂ ♀ ° ′ ″ ℃ ¥

2170 8190 $ ¢ £ % # & * @ § ☆ ★ ○ ● ◎ ◇

Sym

bol

2220 819E ◆ □ ■ △ ▲ ▽ ▼ ※ 〒 → ← ↑ ↓ 〓 2330 824F 0 1 2 3 4 5 6 7 8 9 2340 825F A B C D E F G H I J K L M N O

2350 826F P Q R S T U V W X Y Z 2360 8280 a b c d e f g h i j k l m n oN

um/A

lph

2370 8290 p q r s t u v w x y z 2420 829E ぁ あ ぃ い ぅ う ぇ え ぉ お か が き ぎ く

2430 82AE ぐ け げ こ ご さ ざ し じ す ず せ ぜ そ ぞ た

2440 82BE だ ち ぢ っ つ づ て で と ど な に ぬ ね の は

2450 82CE ば ぱ ひ び ぴ ふ ぶ ぷ へ べ ぺ ほ ぼ ぽ ま み

2460 82DE む め も ゃ や ゅ ゆ ょ よ ら り る れ ろ ゎ わHira

gana

2470 82EE ゐ ゑ を ん 2520 833F ァ ア ィ イ ゥ ウ ェ エ ォ オ カ ガ キ ギ ク

2530 834F グ ケ ゲ コ ゴ サ ザ シ ジ ス ズ セ ゼ ソ ゾ タ

2540 835F ダ チ ヂ ッ ツ ヅ テ デ ト ド ナ ニ ヌ ネ ノ ハ

2550 836F バ パ ヒ ビ ピ フ ブ プ ヘ ベ ペ ホ ボ ポ マ ミ

2560 8380 ム メ モ ャ ヤ ュ ユ ョ ヨ ラ リ ル レ ロ ヮ ワKat

akan

a

2570 8390 ヰ ヱ ヲ ン ヴ ヵ ヶ 2620 839E Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο

2630 83AE Π Ρ Σ Τ Υ Φ Χ Ψ Ω 2640 83BE α β γ δ ε ζ η θ ι κ λ μ ν ξ οG

reek

2650 83CE π ρ σ τ υ φ χ ψ ω The marked character, " ", cannot be used.

Page 218: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

4.CHARACTER CODE (KANJI, HIRAGANA AND OTHERS) B- 64183EN/01

-208-

JIS Shift JIS 0 1 2 3 4 5 6 7 8 9 A B C D E F

01E0 ┬ ┐ ┤ ┘ ┴ └ ├ ┌ ─ │ ┼

2F40 885F

Spec

ial

2F50 886F

Page 219: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 4.CHARACTER CODE (KANJI, HIRAGANA AND OTHERS)

-209-

JIS Shift JIS 0 1 2 3 4 5 6 7 8 9 A B C D E F

3020 889E 亜 唖 娃 阿 哀 愛 挨 姶 逢 葵 茜 穐 悪 握 渥

3030 88AE 旭 葦 芦 鯵 梓 圧 斡 扱 宛 姐 虻 飴 絢 綾 鮎 或

3040 88BE 粟 袷 安 庵 按 暗 案 闇 鞍 杏 以 伊 位 依 偉 囲Kan

ji

3050 88CE 夷 委 威 尉 惟 意 慰 易 椅 為 畏 異 移 維 緯 胃

3060 88DE 萎 衣 謂 違 遺 医 井 亥 域 育 郁 磯 一 壱 溢 逸

3070 88EE 稲 茨 芋 鰯 允 印 咽 員 因 姻 引 飲 淫 胤 蔭

3120 893F 院 陰 隠 韻 吋 右 宇 烏 羽 迂 雨 卯 鵜 窺 丑

3130 894F 碓 臼 渦 嘘 唄 欝 蔚 鰻 姥 厩 浦 瓜 閏 噂 云 運

3140 895F 雲 荏 餌 叡 営 嬰 影 映 曳 栄 永 泳 洩 瑛 盈 穎

3150 896F 頴 英 衛 詠 鋭 液 疫 益 駅 悦 謁 越 閲 榎 厭 円

3160 8980 園 堰 奄 宴 延 怨 掩 援 沿 演 炎 焔 煙 燕 猿 縁

3170 8990 艶 苑 薗 遠 鉛 鴛 塩 於 汚 甥 凹 央 奥 往 応

3220 899E 押 旺 横 欧 殴 王 翁 襖 鴬 鴎 黄 岡 沖 荻 億

3230 89AE 屋 憶 臆 桶 牡 乙 俺 卸 恩 温 穏 音 下 化 仮 何

3240 89BE 伽 価 佳 加 可 嘉 夏 嫁 家 寡 科 暇 果 架 歌 河

3250 89CE 火 珂 禍 禾 稼 箇 花 苛 茄 荷 華 菓 蝦 課 嘩 貨

3260 89DE 迦 過 霞 蚊 俄 峨 我 牙 画 臥 芽 蛾 賀 雅 餓 駕

3270 89EE 介 会 解 回 塊 壊 廻 快 怪 悔 恢 懐 戒 拐 改

3320 8A3F 魁 晦 械 海 灰 界 皆 絵 芥 蟹 開 階 貝 凱 劾

3330 8A4F 外 咳 害 崖 慨 概 涯 碍 蓋 街 該 鎧 骸 浬 馨 蛙

3340 8A5F 垣 柿 蛎 鈎 劃 嚇 各 廓 拡 撹 格 核 殻 獲 確 穫

3350 8A6F 覚 角 赫 較 郭 閣 隔 革 学 岳 楽 額 顎 掛 笠 樫

3360 8A80 橿 梶 鰍 潟 割 喝 恰 括 活 渇 滑 葛 褐 轄 且 鰹

3370 8A90 叶 椛 樺 鞄 株 兜 竃 蒲 釜 鎌 噛 鴨 栢 茅 萱

3420 8A9E 粥 刈 苅 瓦 乾 侃 冠 寒 刊 勘 勧 巻 喚 堪 姦

3430 8AAE 完 官 寛 干 幹 患 感 慣 憾 換 敢 柑 桓 棺 款 歓

3440 8ABE 汗 漢 澗 潅 環 甘 監 看 竿 管 簡 緩 缶 翰 肝 艦

3450 8ACE 莞 観 諌 貫 還 鑑 間 閑 関 陥 韓 館 舘 丸 含 岸

3460 8ADE 巌 玩 癌 眼 岩 翫 贋 雁 頑 顔 願 企 伎 危 喜 器

3470 8AEE 基 奇 嬉 寄 岐 希 幾 忌 揮 机 旗 既 期 棋 棄

3520 8B3F 機 帰 毅 気 汽 畿 祈 季 稀 紀 徽 規 記 貴 起

3530 8B4F 軌 輝 飢 騎 鬼 亀 偽 儀 妓 宜 戯 技 擬 欺 犠 疑

3540 8B5F 祇 義 蟻 誼 議 掬 菊 鞠 吉 吃 喫 桔 橘 詰 砧 杵

3550 8B6F 黍 却 客 脚 虐 逆 丘 久 仇 休 及 吸 宮 弓 急 救

3560 8B80 朽 求 汲 泣 灸 球 究 窮 笈 級 糾 給 旧 牛 去 居

3570 8B90 巨 拒 拠 挙 渠 虚 許 距 鋸 漁 禦 魚 亨 享 京

3620 8B9E 供 侠 僑 兇 競 共 凶 協 匡 卿 叫 喬 境 峡 強

3630 8BAE 彊 怯 恐 恭 挟 教 橋 況 狂 狭 矯 胸 脅 興 蕎 郷

3640 8BBE 鏡 響 饗 驚 仰 凝 尭 暁 業 局 曲 極 玉 桐 粁 僅

3650 8BCE 勤 均 巾 錦 斤 欣 欽 琴 禁 禽 筋 緊 芹 菌 衿 襟

3660 8BDE 謹 近 金 吟 銀 九 倶 句 区 狗 玖 矩 苦 躯 駆 駈

3670 8BEE 駒 具 愚 虞 喰 空 偶 寓 遇 隅 串 櫛 釧 屑 屈

3720 8C3F 掘 窟 沓 靴 轡 窪 熊 隈 粂 栗 繰 桑 鍬 勲 君

3730 8C4F 薫 訓 群 軍 郡 卦 袈 祁 係 傾 刑 兄 啓 圭 珪 型

Page 220: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

4.CHARACTER CODE (KANJI, HIRAGANA AND OTHERS) B- 64183EN/01

-210-

JIS Shift JIS 0 1 2 3 4 5 6 7 8 9 A B C D E F

3740 8C5F 契 形 径 恵 慶 慧 憩 掲 携 敬 景 桂 渓 畦 稽 系

3750 8C6F 経 継 繋 罫 茎 荊 蛍 計 詣 警 軽 頚 鶏 芸 迎 鯨

3760 8C80 劇 戟 撃 激 隙 桁 傑 欠 決 潔 穴 結 血 訣 月 件Kan

ji

3770 8C90 倹 倦 健 兼 券 剣 喧 圏 堅 嫌 建 憲 懸 拳 捲

3820 8C9E 検 権 牽 犬 献 研 硯 絹 県 肩 見 謙 賢 軒 遣

3830 8CAE 鍵 険 顕 験 鹸 元 原 厳 幻 弦 減 源 玄 現 絃 舷

3840 8CBE 言 諺 限 乎 個 古 呼 固 姑 孤 己 庫 弧 戸 故 枯

3850 8CCE 湖 狐 糊 袴 股 胡 菰 虎 誇 跨 鈷 雇 顧 鼓 五 互

3860 8CDE 伍 午 呉 吾 娯 後 御 悟 梧 檎 瑚 碁 語 誤 護 醐

3870 8CEE 乞 鯉 交 佼 侯 候 倖 光 公 功 効 勾 厚 口 向

3920 8D3F 后 喉 坑 垢 好 孔 孝 宏 工 巧 巷 幸 広 庚 康

3930 8D4F 弘 恒 慌 抗 拘 控 攻 昂 晃 更 杭 校 梗 構 江 洪

3940 8D5F 浩 港 溝 甲 皇 硬 稿 糠 紅 紘 絞 綱 耕 考 肯 肱

3950 8D6F 腔 膏 航 荒 行 衡 講 貢 購 郊 酵 鉱 砿 鋼 閤 降

3960 8D80 項 香 高 鴻 剛 劫 号 合 壕 拷 濠 豪 轟 麹 克 刻

3970 8D90 告 国 穀 酷 鵠 黒 獄 漉 腰 甑 忽 惚 骨 狛 込

3A20 8D9E 此 頃 今 困 坤 墾 婚 恨 懇 昏 昆 根 梱 混 痕

3A30 8DAE 紺 艮 魂 些 佐 叉 唆 嵯 左 差 査 沙 瑳 砂 詐 鎖

3A40 8DBE 裟 坐 座 挫 債 催 再 哉 塞 妻 宰 彩 才 採 栽

3A50 8DCE 歳 済 災 采 犀 砕 砦 祭 斎 細 菜 裁 載 際 剤 在

3A60 8DDE 材 罪 財 冴 坂 阪 堺 榊 肴 咲 崎 埼 碕 鷺 作 削

3A70 8DEE 咋 搾 昨 朔 柵 窄 策 索 錯 桜 鮭 笹 匙 冊 刷

3B20 8E3F 察 拶 撮 擦 札 殺 薩 雑 皐 鯖 捌 錆 鮫 皿 晒

3B30 8E4F 三 傘 参 山 惨 撒 散 桟 燦 珊 産 算 纂 蚕 讃 賛

3B40 8E5F 酸 餐 斬 暫 残 仕 仔 伺 使 刺 司 史 嗣 四 士 始

3B50 8E6F 姉 姿 子 屍 市 師 志 思 指 支 孜 斯 施 旨 枝 止

3B60 8E80 死 氏 獅 祉 私 糸 紙 紫 肢 脂 至 視 詞 詩 試 誌

3B70 8E90 諮 資 賜 雌 飼 歯 事 似 侍 児 字 寺 慈 持 時

3C20 8E9E 次 滋 治 爾 璽 痔 磁 示 而 耳 自 蒔 辞 汐 鹿

3C30 8EAE 式 識 鴫 竺 軸 宍 雫 七 叱 執 失 嫉 室 悉 湿 漆

3C40 8EBE 疾 質 実 蔀 篠 偲 柴 芝 屡 蕊 縞 舎 写 射 捨 赦

3C50 8ECE 斜 煮 社 紗 者 謝 車 遮 蛇 邪 借 勺 尺 杓 灼 爵

3C60 8EDE 酌 釈 錫 若 寂 弱 惹 主 取 守 手 朱 殊 狩 珠 種

3C70 8EEE 腫 趣 酒 首 儒 受 呪 寿 授 樹 綬 需 囚 収 周

3D20 8F3F 宗 就 州 修 愁 拾 洲 秀 秋 終 繍 習 臭 舟 蒐

3D30 8F4F 衆 襲 讐 蹴 輯 週 酋 酬 集 醜 什 住 充 十 従 戎

3D40 8F5F 柔 汁 渋 獣 縦 重 銃 叔 夙 宿 淑 祝 縮 粛 塾 熟

3D50 8F6F 出 術 述 俊 峻 春 瞬 竣 舜 駿 准 循 旬 楯 殉 淳

3D60 8F80 準 潤 盾 純 巡 遵 醇 順 処 初 所 暑 曙 渚 庶 緒

3D70 8F90 署 書 薯 藷 諸 助 叙 女 序 徐 恕 鋤 除 傷 償

Page 221: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 4.CHARACTER CODE (KANJI, HIRAGANA AND OTHERS)

-211-

JIS Shift JIS 0 1 2 3 4 5 6 7 8 9 A B C D E F

3E20 8F9E 勝 匠 升 召 哨 商 唱 嘗 奨 妾 娼 宵 将 小 少

3E30 8FAE 尚 庄 床 廠 彰 承 抄 招 掌 捷 昇 昌 昭 晶 松 梢

3E40 8FBE 樟 樵 沼 消 渉 湘 焼 焦 照 症 省 硝 礁 祥 称 章Kan

ji

3E50 8FCE 笑 粧 紹 肖 菖 蒋 蕉 衝 裳 訟 証 詔 詳 象 賞 醤

3E60 8FDE 鉦 鍾 鐘 障 鞘 上 丈 丞 乗 冗 剰 城 場 壌 嬢 常

3E70 8FEE 情 擾 条 杖 浄 状 畳 穣 蒸 譲 醸 錠 嘱 埴 飾

3F20 903F 拭 植 殖 燭 織 職 色 触 食 蝕 辱 尻 伸 信 侵

3F30 904F 唇 娠 寝 審 心 慎 振 新 晋 森 榛 浸 深 申 疹 真

3F40 905F 神 秦 紳 臣 芯 薪 親 診 身 辛 進 針 震 人 仁 刃

3F50 906F 塵 壬 尋 甚 尽 腎 訊 迅 陣 靭 笥 諏 須 酢 図 厨

3F60 9080 逗 吹 垂 帥 推 水 炊 睡 粋 翠 衰 遂 酔 錐 錘 随

3F70 9090 瑞 髄 崇 嵩 数 枢 趨 雛 据 杉 椙 菅 頗 雀 裾

4020 909E 澄 摺 寸 世 瀬 畝 是 凄 制 勢 姓 征 性 成 政

4030 90AE 整 星 晴 棲 栖 正 清 牲 生 盛 精 聖 声 製 西 誠

4040 90BE 誓 請 逝 醒 青 静 斉 税 脆 隻 席 惜 戚 斥 昔 析

4050 90CE 石 積 籍 績 脊 責 赤 跡 蹟 碩 切 拙 接 摂 折 設

4060 90DE 窃 節 説 雪 絶 舌 蝉 仙 先 千 占 宣 専 尖 川 戦

4070 90EE 扇 撰 栓 栴 泉 浅 洗 染 潜 煎 煽 旋 穿 箭 線

4120 913F 繊 羨 腺 舛 船 薦 詮 賎 践 選 遷 銭 銑 閃 鮮

4130 914F 前 善 漸 然 全 禅 繕 膳 糎 噌 塑 岨 措 曾 曽 楚

4140 915F 狙 疏 疎 礎 祖 租 粗 素 組 蘇 訴 阻 遡 鼠 僧 創

4150 916F 双 叢 倉 喪 壮 奏 爽 宋 層 匝 惣 想 捜 掃 挿 掻

4160 9180 操 早 曹 巣 槍 槽 漕 燥 争 痩 相 窓 糟 総 綜 聡

4170 9190 草 荘 葬 蒼 藻 装 走 送 遭 鎗 霜 騒 像 増 憎

4220 919E 臓 蔵 贈 造 促 側 則 即 息 捉 束 測 足 速 俗

4230 91AE 属 賊 族 続 卒 袖 其 揃 存 孫 尊 損 村 遜 他 多

4240 91BE 太 汰 詑 唾 堕 妥 惰 打 柁 舵 楕 陀 駄 騨 体 堆

4250 91CE 対 耐 岱 帯 待 怠 態 戴 替 泰 滞 胎 腿 苔 袋 貸

4260 91DE 退 逮 隊 黛 鯛 代 台 大 第 醍 題 鷹 滝 瀧 卓 啄

4270 91EE 宅 托 択 拓 沢 濯 琢 託 鐸 濁 諾 茸 凧 蛸 只

4320 923F 叩 但 達 辰 奪 脱 巽 竪 辿 棚 谷 狸 鱈 樽 誰

4330 924F 丹 単 嘆 坦 担 探 旦 歎 淡 湛 炭 短 端 箪 綻 耽

4340 925F 胆 蛋 誕 鍛 団 壇 弾 断 暖 檀 段 男 談 値 知 地

4350 926F 弛 恥 智 池 痴 稚 置 致 蜘 遅 馳 築 畜 竹 筑 蓄

4360 9280 逐 秩 窒 茶 嫡 着 中 仲 宙 忠 抽 昼 柱 注 虫 衷

4370 9290 註 酎 鋳 駐 樗 瀦 猪 苧 著 貯 丁 兆 凋 喋 寵

4420 929E 帖 帳 庁 弔 張 彫 徴 懲 挑 暢 朝 潮 牒 町 眺

4430 92AE 聴 脹 腸 蝶 調 諜 超 跳 銚 長 頂 鳥 勅 捗 直 朕

4440 92BE 沈 珍 賃 鎮 陳 津 墜 椎 槌 追 鎚 痛 通 塚 栂 掴

4450 92CE 槻 佃 漬 柘 辻 蔦 綴 鍔 椿 潰 坪 壷 嬬 紬 爪 吊

4460 92DE 釣 鶴 亭 低 停 偵 剃 貞 呈 堤 定 帝 底 庭 廷 弟

4470 92EE 悌 抵 挺 提 梯 汀 碇 禎 程 締 艇 訂 諦 蹄 逓

4520 933F 邸 鄭 釘 鼎 泥 摘 擢 敵 滴 的 笛 適 鏑 溺 哲

4530 934F 徹 撤 轍 迭 鉄 典 填 天 展 店 添 纏 甜 貼 転 顛

4540 935F 点 伝 殿 澱 田 電 兎 吐 堵 塗 妬 屠 徒 斗 杜 渡

Page 222: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

4.CHARACTER CODE (KANJI, HIRAGANA AND OTHERS) B- 64183EN/01

-212-

JIS Shift JIS 0 1 2 3 4 5 6 7 8 9 A B C D E F

4550 936F 登 菟 賭 途 都 鍍 砥 砺 努 度 土 奴 怒 倒 党 冬

4560 9380 凍 刀 唐 塔 塘 套 宕 島 嶋 悼 投 搭 東 桃 梼 棟

4570 9390 盗 淘 湯 涛 灯 燈 当 痘 祷 等 答 筒 糖 統 到 Kan

ji

4620 939E 董 蕩 藤 討 謄 豆 踏 逃 透 鐙 陶 頭 騰 闘 働

4630 93AE 動 同 堂 導 憧 撞 洞 瞳 童 胴 萄 道 銅 峠 鴇 匿

4640 93BE 得 徳 涜 特 督 禿 篤 毒 独 読 栃 橡 凸 突 椴 届

4650 93CE 鳶 苫 寅 酉 瀞 噸 屯 惇 敦 沌 豚 遁 頓 呑 曇 鈍

4660 93DE 奈 那 内 乍 凪 薙 謎 灘 捺 鍋 楢 馴 縄 畷 南 楠

4670 93EE 軟 難 汝 二 尼 弐 迩 匂 賑 肉 虹 廿 日 乳 入

4720 943F 如 尿 韮 任 妊 忍 認 濡 禰 祢 寧 葱 猫 熱 年

4730 944F 念 捻 撚 燃 粘 乃 廼 之 埜 嚢 悩 濃 納 能 脳 膿

4740 945F 農 覗 蚤 巴 把 播 覇 杷 波 派 琶 破 婆 罵 芭 馬

4750 946F 俳 廃 拝 排 敗 杯 盃 牌 背 肺 輩 配 倍 培 媒 梅

4760 9480 楳 煤 狽 買 売 賠 陪 這 蝿 秤 矧 萩 伯 剥 博 拍

4770 9490 柏 泊 白 箔 粕 舶 薄 迫 曝 漠 爆 縛 莫 駁 麦

4820 949E 函 箱 硲 箸 肇 筈 櫨 幡 肌 畑 畠 八 鉢 溌 発

4830 94AE 醗 髪 伐 罰 抜 筏 閥 鳩 噺 塙 蛤 隼 伴 判 半 反

4840 94BE 叛 帆 搬 斑 板 氾 汎 版 犯 班 畔 繁 般 藩 販 範

4850 94CE 釆 煩 頒 飯 挽 晩 番 盤 磐 蕃 蛮 匪 卑 否 妃 庇

4860 94DE 彼 悲 扉 批 披 斐 比 泌 疲 皮 碑 秘 緋 罷 肥 被

4870 94EE 誹 費 避 非 飛 樋 簸 備 尾 微 枇 毘 琵 眉 美

4920 953F 鼻 柊 稗 匹 疋 髭 彦 膝 菱 肘 弼 必 畢 筆 逼

4930 954F 桧 姫 媛 紐 百 謬 俵 彪 標 氷 漂 瓢 票 表 評 豹

4940 955F 廟 描 病 秒 苗 錨 鋲 蒜 蛭 鰭 品 彬 斌 浜 瀕 貧

4950 956F 賓 頻 敏 瓶 不 付 埠 夫 婦 富 冨 布 府 怖 扶 敷

4960 9580 斧 普 浮 父 符 腐 膚 芙 譜 負 賦 赴 阜 附 侮 撫

4970 9590 武 舞 葡 蕪 部 封 楓 風 葺 蕗 伏 副 復 幅 服

4A20 959E 福 腹 複 覆 淵 弗 払 沸 仏 物 鮒 分 吻 噴 墳

4A30 95AE 憤 扮 焚 奮 粉 糞 紛 雰 文 聞 丙 併 兵 塀 幣 平

4A40 95BE 弊 柄 並 蔽 閉 陛 米 頁 僻 壁 癖 碧 別 瞥 蔑 箆

4A50 95CE 偏 変 片 篇 編 辺 返 遍 便 勉 娩 弁 鞭 保 舗 鋪

4A60 95DE 圃 捕 歩 甫 補 輔 穂 募 墓 慕 戊 暮 母 簿 菩 倣

4A70 95EE 俸 包 呆 報 奉 宝 峰 峯 崩 庖 抱 捧 放 方 朋

4B20 963F 法 泡 烹 砲 縫 胞 芳 萌 蓬 蜂 褒 訪 豊 邦 鋒

4B30 964F 飽 鳳 鵬 乏 亡 傍 剖 坊 妨 帽 忘 忙 房 暴 望 某

4B40 965F 棒 冒 紡 肪 膨 謀 貌 貿 鉾 防 吠 頬 北 僕 卜 墨

4B50 966F 撲 朴 牧 睦 穆 釦 勃 没 殆 堀 幌 奔 本 翻 凡 盆

4B60 9680 摩 磨 魔 麻 埋 妹 昧 枚 毎 哩 槙 幕 膜 枕 鮪 柾

4B70 9690 鱒 桝 亦 俣 又 抹 末 沫 迄 侭 繭 麿 万 慢 満

4C20 969E 漫 蔓 味 未 魅 巳 箕 岬 密 蜜 湊 蓑 稔 脈 妙

4C30 96AE 粍 民 眠 務 夢 無 牟 矛 霧 鵡 椋 婿 娘 冥 名 命

4C40 96BE 明 盟 迷 銘 鳴 姪 牝 滅 免 棉 綿 緬 面 麺 摸 模

Page 223: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B- 64183EN/01 4.CHARACTER CODE (KANJI, HIRAGANA AND OTHERS)

-213-

JIS Shift JIS 0 1 2 3 4 5 6 7 8 9 A B C D E F

4C50 96CE 茂 妄 孟 毛 猛 盲 網 耗 蒙 儲 木 黙 目 杢 勿 餅

4C60 96DE 尤 戻 籾 貰 問 悶 紋 門 匁 也 冶 夜 爺 耶 野 弥

4C70 96EE 矢 厄 役 約 薬 訳 躍 靖 柳 薮 鑓 愉 愈 油 癒 Kan

ji

4D20 973F 諭 輸 唯 佑 優 勇 友 宥 幽 悠 憂 揖 有 柚 湧

4D30 974F 涌 猶 猷 由 祐 裕 誘 遊 邑 郵 雄 融 夕 予 余 与

4D40 975F 誉 輿 預 傭 幼 妖 容 庸 揚 揺 擁 曜 楊 様 洋 溶

4D50 976F 熔 用 窯 羊 耀 葉 蓉 要 謡 踊 遥 陽 養 慾 抑 欲

4D60 9780 沃 浴 翌 翼 淀 羅 螺 裸 来 莱 頼 雷 洛 絡 落 酪

4D70 9790 乱 卵 嵐 欄 濫 藍 蘭 覧 利 吏 履 李 梨 理 璃

4E20 979E 痢 裏 裡 里 離 陸 律 率 立 葎 掠 略 劉 流 溜

4E30 97AE 琉 留 硫 粒 隆 竜 龍 侶 慮 旅 虜 了 亮 僚 両 凌

4E40 97BE 寮 料 梁 涼 猟 療 瞭 稜 糧 良 諒 遼 量 陵 領 力

4E50 97CE 緑 倫 厘 林 淋 燐 琳 臨 輪 隣 鱗 麟 瑠 塁 涙 累

4E60 97DE 類 令 伶 例 冷 励 嶺 怜 玲 礼 苓 鈴 隷 零 霊 麗

4E70 97EE 齢 暦 歴 列 劣 烈 裂 廉 恋 憐 漣 煉 簾 練 聯

4F20 983F 蓮 連 錬 呂 魯 櫓 炉 賂 路 露 労 婁 廊 弄 朗

4F30 984F 楼 榔 浪 漏 牢 狼 篭 老 聾 蝋 郎 六 麓 禄 肋 録

4F40 985F 論 倭 和 話 歪 賄 脇 惑 枠 鷲 亙 亘 鰐 詫 藁 蕨

4F50 986F 椀 湾 碗 腕 The marked character, " ", cannot be used.

Page 224: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL
Page 225: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B-64183EN/01 INDEX

i-1

INDEX <A>

ACCESS TO THE EXTENDED NONVOLATILE

MEMORY.......................................................................76

ACCESS TO THE PMC ADDRESS ..............................55

<C> Change Attribute of the Characters Being Displayed .....89

Character Code................................................................81

CHARACTER CODE (KANJI, HIRAGANA AND

OTHERS)......................................................................207

CHARACTER CODE CONVERSION ........................205

CHARACTER DISPLAY...............................................79

Clear Columns.................................................................86

Clear Lines ......................................................................85

Clear the Event Flag........................................................33

Clear the Graphic Screen ..............................................111

Close the Graphic Screen ..............................................110

Close the Reader / Puncher Interface .................... 127, 141

CNC HARDWARE...........................................................9

CNC PROGRAM.......................................................... 155

CNC WINDOW ............................................................150

CNC Window Function (Read) .....................................150

CNC Window Function (Write) ....................................152

Color Palette for Graphic Display .................................107

Color Palette for the Character Display ..........................79

COMPATIBILITY WITH THE "C LIBRARY FOR

C LANGUAGE BOARD" ..............................................10

Control a Key-in Line .....................................................46

Control the Screen.........................................................101

CONVERSION POINTS ................................................13

Convert Characters from ASCII to ISO Code ...............205

Convert Characters from ISO to ASCII Code ...............206

Coordinates of the Character Screen ...............................80

Coordinates of the Graphic Screen................................108

Create a Semaphore.........................................................35

Create an Event Flag .......................................................29

<E> Delete All CNC Programs..................................... 166, 191

Delete the CNC Program....................................... 168, 193

Delete the CNC Program

(Supported 8 Digits Program Number) .........................167

Delete the CNC Program

(Supported 8 Digits Program Number) .........................192

Delete the Event Flag ......................................................30

Delete the File ....................................................... 136, 148

Delete the Semaphore......................................................36

Disable Custom Keys ......................................................53

Disable Function Keys ....................................................50

Display ASCII Characters ...............................................90

Display Characters (ASCII, Kanji and Hiragana) ..........96

Display Characters

(Kanji, Hiragana and Special Characters) .......................91

Display Cursor ................................................................94

Display Hex Size Characters...........................................93

Display or Hide the Graphic Screen..............................112

Draw an Arc ..................................................................116

Draw Straight Lines ......................................................115

<E> Enable Custom Keys .......................................................54

Enable Function Keys .....................................................51

End DNC Running of the CNC Program ..............163, 188

End Reading of the CNC Program ........................173, 198

End Reading of the Program List .......................... 180, 204

End Registration of the CNC Program..................158, 184

Erase the Entire Screen ...................................................84

Erase the Square............................................................121

External Data Input .......................................................154

<F> FUNCTION LIST ...........................................................19

FUNCTION REFERENCE.............................................18

<G> Get Graphic Screen Status.............................................120

Get Size of the Extended Nonvolatile Memory...............78

Get the File Information........................................134, 147

GETTING STARTED.......................................................1

GRAPHIC DISPLAY....................................................107

<H> HOW TO MAKE APPLICATION ...................................4

Initialize a Character Screen

(80 Columns x 25 Lines or 40 Columns x 16 Lines).......83

Page 226: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

INDEX B-64183EN/01

i-2

<I> Initialize printf() ............................................................106

Initialize the Character Screen

(74 Columns x 27 Lines) ............................................... 104

Initialize the Character Screen

(74 Columns x 30 Lines) ............................................... 105

Initialize the Character Screen

(80 Columns x 30 Lines) .................................................82

INSTALLATION OF THE "C LIBRARY FOR

CONVERSION" ON A PERSONAL COMPUTER .........5

<M> MDI Key Code Table......................................................42

MDI KEYS .....................................................................42

<O> Open the Graphic Screen...............................................109

Open the Reader / Puncher Interface..................... 124, 138

Open the Reader / Puncher Interface

(for FANUC Handy File) ...................................... 130, 144

<P> Paint ..............................................................................118

<R> Read a Function Key.......................................................52

Read a Message in LADDER Program ...........................75

Read CNC Information ...................................................70

Read from the Extended Nonvolatile Memory................76

Read from the PMC Address (bit)...................................56

Read from the PMC Address (char) ................................58

Read from the PMC Address (long)................................60

Read from the PMC Address (short) ...............................59

Read from the PMC Address (unsigned char).................61

Read from the PMC Address (unsigned long).................63

Read from the PMC Address (unsigned short)................62

Read from the Reader / Puncher Interface ............ 128, 142

Read key..........................................................................44

Read Key Status ..............................................................49

Read Symbol and Comment in LADDER Program ........73

Read Symbol and Comment in LADDER Program

(16 characters symbol is available) .................................71

READ SYSTEM INFORMATION.................................70

Read the CNC Program......................................... 171, 196

Read the CNC Program List.................................. 178, 202

Read the CNC Program Memory Information ...... 174, 199

Read the Task Timer Value.............................................25

READER / PUNCHER INTERFACE ..........................123

Register the CNC Program....................................156, 182

RELATED DRAWING NUMBER...................................3

Restore the Character Screen ........................................100

Run the CNC Program (DNC running) .................161, 186

<S> Save the Character Screen...............................................98

Search the CNC Program ......................................165, 190

Search the CNC Program

(Supported 8 Digits Program Number) .................164, 189

Set a Display Attribute ....................................................88

Set a Display Position .....................................................87

Set a Graphic Color .......................................................114

Set a Graphic Line Type ...............................................113

Set Background Color of the Character Screen.............102

Set Palette for Character Screen....................................103

Set Palette for the Graphic Screen.................................122

Set the Event Flag ...........................................................31

Set the Event Flag (Pulse type) .......................................34

Set the Semaphore...........................................................37

Set the Task Timer Value................................................26

Shift...............................................................................119

Start DNC running of the CNC Program...............159, 185

Start Reading of the CNC Program.......................170, 195

Start Reading of the CNC Program

(Supported 8 Digits Program Number) .................169, 194

Start Reading of the CNC Program List ................177, 201

Start Reading of the CNC Program List

(Supported 8 Digits Program Number) .........................175

Start Reading of the CNC Program List

(Supported 8 Digits Program Number) .........................200

Start Registration of the CNC Program.................155, 181

SWITCH SCREEN .........................................................39

Switch to the CNC Screen...............................................41

Switch to the User Application Screen............................39

SYSTEM CALL..............................................................25

<W> Wait for Switching to the User Application Screen ........40

Wait for the Event Flag ...................................................32

Wait for the Semaphore...................................................38

Wait for the Timer Value ................................................27

Wait for Time..................................................................28

Page 227: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

B-64183EN/01 INDEX

i-3

Write to the Extended Nonvolatile Memory ...................77

Write to the PMC Address (bit) ......................................57

Write to the PMC Address (char)....................................64

Write to the PMC Address (long)....................................66

Write to the PMC Address (short)...................................65

Write to the PMC Address (unsigned char).....................67

Write to the PMC Address (unsigned long) ....................69

Write to the PMC Address (unsigned short) ...................68

Write to the Reader / Puncher Interface ................ 129, 143

Page 228: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL
Page 229: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

Rev

isio

n R

ecor

d

FAN

UC

Srie

s 30i/3

00i/3

00is

-MO

DE

L A

, Ser

ies

31i/3

10i/3

10is

-MO

DE

L A

5, S

erie

s 31i/3

10i/3

10is

-MO

DE

L A

, S

erie

s 32i/3

20i/3

20is

-MO

DE

L A

C L

angu

age

Exe

cuto

r Lib

rary

(For

Con

vers

ion

from

PM

C C

Lan

guag

e Fu

nctio

n)

PR

OG

RA

MM

ING

MA

NU

AL

(B-6

4183

EN

)

01

Ju

l., 2

004

Edi

tion

Dat

e C

onte

nts

Edi

tion

Dat

e C

onte

nts

Page 230: C Language Executor Library (For Conversion from … MANUAL B-64183EN/01 C Language Executor Library (For Conversion from PMC C Language Function) FANUC Series 30*/300*/300*s-MODEL

Recommended