Series 30i/300i/300is/31i/310i/310is/32i/320i/320is-MODEL A Additional Manual Page 200

Additional Manual
Series 30i/ 31i/ 32i-A
C executor library for conversion
Programming manual
01 04.05.06
S. Hasegawa
New registration
B-64183EN/01
EDIT
DATE
DESIG.
DESCRIPTION
200/226
DRAW.NO.
- 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()

Contents Summary of Series 30i/300i/300is/31i/310i/310is/32i/320i/320is-MODEL A Additional Manual

  • Page 1Series 30i/ 300i/ 300is/ 31i/ 310i/ 310is/ 32i/ 320i/ 320is-MODEL A C language executor library (for conversion from PMC C language function) Programming manual Type of applied technical documents Series 30i/ 300i/ 300is/ 31i/ 310i/ 310is/ 32i/ 320i/ 320is-MODEL A Name C language executor library (f
  • Page 2Series 30i/ 300i/ 300is/ 31i/ 310i/ 310is/ 32i/ 320i/ 320is-MODEL A C language executor library (for conversion from PMC C language function) Programming manual Contents 1 GETTING STARTED ................................................................................................................
  • Page 33.4.4 Read Key Status...................................................................................................................... 57 3.4.5 Disable Function Keys ............................................................................................................. 58 3.4.6 Enable Fun
  • Page 43.8.23 Initialize the Character Screen (74 Columns x 30 Lines) ................................................. 114 3.8.24 Initialize printf()................................................................................................................... 115 3.9 GRAPHIC DISPLAY..................
  • Page 53.12.16 Read the CNC Program Memory Information................................................................. 184 3.12.17 Start Reading of the CNC Program List (Supported 8 Digits Program Number)............ 186 3.12.18 Start Reading of the CNC Program List .......................................
  • Page 61 GETTING STARTED Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 6/226
  • Page 71.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 lang
  • Page 81.2 APPLIED SOFTWARE The "C library for conversion" is applied to the following software. Software Drawing number Series Edition Series 30i/ 300i/ 300is-MODEL A A02B-0303-H501#G001 G001 WA or later CNC System Software A02B-0303-H501#G011 G011 A02B-0303-H501#G021 G021 A02B-0303-H501#G00A G00A 01 or l
  • Page 91.3 RELATED DRAWING NUMBER The related drawing number is shown below. Drawing number Name Contents A02B-0303-J734 Macro executor + This is the execution option for C executor. C language executor A02B-0303-J738#1M Custom software size 1 MB This is the memory option for C executor. A02B-0303-J738#2M
  • Page 102 HOW TO MAKE APPLICATION Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 10/226
  • Page 112.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
  • Page 12Modification 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 "make
  • Page 13# 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 $(
  • Page 14#------------------------------------------------------------------------------ .\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 $(FC
  • Page 15#------------------------------------------------------------------------------ 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)\t
  • Page 162.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/ 32i Series 16i/ 18i/ 21i Series 15i C executor C language board C
  • Page 172.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" becaus
  • Page 18・ 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() - - Switch scree
  • Page 19・ 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() - Reader / puncher interface The baud rate setting "19200 bps" is unavailable. The simultaneous us
  • Page 202.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 15i/ 16i/ 18i/ 21i Conversion Points C executor C language board Diab C/C++ INTEL i-C286 The addressing
  • Page 21Tasks 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 15i/ 16i/ 18i/ 21i C executor C language board Number of tasks 5 in the maximum 16 in the maximum Task priority Fixed Programmable Execution cycle Fi
  • Page 22(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 CNC system software. The
  • Page 23You should select a RS-232C process that is only executed on user screen too. (2) You should describe above classified process to following each task on C executor. Classification Tasks in (1) 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)
  • Page 24(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(). PMC address The byte order is different between "C executor" an
  • Page 253 FUNCTION REFERENCE Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 25/226
  • Page 263.1 FUNCTION LIST SYSTEM CALL No. Name Content Available task 3.2.1 os_show_tim() Error! Not a valid link. MWAC 3.2.2 os_set_tim() Error! Not a valid link. MWAC 3.2.3 os_sync_tim() Error! Not a valid link. MWAC 3.2.4 os_wait_tim() Error! Not a valid link. MWAC 3.2.5 os_make_flg() Error! Not a valid
  • Page 27SWITCH SCREEN No. Name Content Available task 3.3.1 pl_pcmdi() Error! Not a valid link. MWAC 3.3.2 pl_pcmdi_wait() Error! Not a valid link. M 3.3.3 pl_ncmdi() Error! Not a valid link. MWAC M: Main Task, W: Window Task, A: Alarm Task, C: Communication Task, H: High-level Task, -: Not supported MDI KE
  • Page 28- 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 t
  • Page 293.8.19 pl_dspcntl() Error! Not a valid link. MW 3.8.20 pl_backcolor() Error! Not a valid link. MW 3.8.21 pl_dsppalette() Error! Not a valid link. MW 3.8.22 pl_dspopen2() Error! Not a valid link. M 3.8.23 pl_dspopen3() Error! Not a valid link. M 3.8.24 initreq_printf() Error! Not a valid link. MW M:
  • Page 30Error! Not a valid link. No. Name Content Available task 3.9.3 pl_grpopen() Error! Not a valid link. M 3.9.4 pl_grpclose() Error! Not a valid link. M 3.9.5 pl_grpclr() Error! Not a valid link. MW 3.9.6 pl_grpdspon() Error! Not a valid link. MW 3.9.7 pl_grplntyp() Error! Not a valid link. MW 3.9.8 pl
  • Page 31Error! Not a valid link. No. Name Content Available task 3.11.1 pl_nc_windr() Error! Not a valid link. No. 23, 24, 25, 26, 27, 28, 29, 30, 31, 34, 50, 153 MWACH Others MWAC 3.11.2 pl_nc_windw() Error! Not a valid link. MWAC - pl_exin() Error! Not a valid link. - M: Main Task, W: Window Task, A: Alar
  • Page 32- pl_nc_vrfend() Error! Not a valid link. - 3.12.24 pl_nc_dncstart() Error! Not a valid link. MWAC 3.12.25 pl_nc_dnc() Error! Not a valid link. MWAC 3.12.26 pl_nc_dncend() Error! Not a valid link. MWAC 3.12.27 pl_nc_search_8d() Error! Not a valid link. MWAC 3.12.28 pl_nc_search() Error! Not a valid
  • Page 333.2 SYSTEM CALL 3.2.1 Read the Task Timer Value [Name] os_show_tim [Syntax] #include 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 = eigh
  • Page 343.2.2 Set the Task Timer Value [Name] os_set_tim [Syntax] #include 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 rea
  • Page 353.2.3 Wait for the Timer Value [Name] os_sync_tim [Syntax] #include 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
  • Page 363.2.4 Wait for Time [Name] os_wait_tim [Syntax] #include 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 o
  • Page 373.2.5 Create an Event Flag [Name] os_make_flg [Syntax] #include 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 alre
  • Page 383.2.6 Delete the Event Flag [Name] os_delt_flg [Syntax] #include 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 doe
  • Page 393.2.7 Set the Event Flag [Name] os_sign_flg [Syntax] #include 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) Ev
  • Page 403.2.8 Wait for the Event Flag [Name] os_wait_flg [Syntax] #include 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
  • Page 413.2.9 Clear the Event Flag [Name] os_clar_flg [Syntax] #include 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) Even
  • Page 423.2.10 Set the Event Flag (Pulse type) [Name] os_puls_flg [Syntax] #include 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: (0x
  • Page 433.2.11 Create a Semaphore [Name] os_make_sem [Syntax] #include 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 er
  • Page 443.2.12 Delete the Semaphore [Name] os_delt_sem [Syntax] #include 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
  • Page 453.2.13 Set the Semaphore [Name] os_sign_sem [Syntax] #include 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 exi
  • Page 463.2.14 Wait for the Semaphore [Name] os_wait_sem [Syntax] #include 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) Semaph
  • Page 473.3 SWITCH SCREEN 3.3.1 Switch to the User Application Screen [Name] pl_pcmdi [Syntax] #include 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 c
  • Page 483.3.2 Wait for Switching to the User Application Screen [Name] pl_pcmdi_wait() [Syntax] #include 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 fo
  • Page 493.3.3 Switch to the CNC Screen [Name] pl_ncmdi [Syntax] #include 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 ex
  • Page 503.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 *2 1 SKV2 F1 2 SKV3*1 F2*2 3 SKV4*1 F3
  • Page 51NOTE 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
  • Page 523.4.2 Read key [Name] pl_mdikey [Syntax] #include 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 charact
  • Page 53os_wait_tim(32 /*msec*/ / 8); } if (ret == INPUT_KEY) { number = strtol(buf, NULL, 0); } else { number = 0; } return number; } [Related Function] getchar(), getch() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN
  • Page 543.4.3 Control a Key-in Line [Name] pl_keydef [Syntax] #include 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 positio
  • Page 55key-in line (0 to 60). If 0, a negative value, or a value greater than 60 is set, the specification of 60 is assumed. 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:
  • Page 56[Return] 0: Normal completion. [Description] This function sets the key-in line setting. [Example] #include 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); } Series 30i/ 31i/ 32i
  • Page 573.4.4 Read Key Status [Name] pl_keysts [Syntax] #include 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.
  • Page 583.4.5 Disable Function Keys [Name] pl_fkey_ign [Syntax] #include 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 ca
  • Page 593.4.6 Enable Function Keys [Name] pl_fkey_avail [Syntax] #include 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
  • Page 603.4.7 Read a Function Key [Name] pl_fkey_sts [Syntax] #include 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
  • Page 613.4.8 Disable Custom Keys [Name] pl_fcustom_ign [Syntax] #include 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(),
  • Page 623.4.9 Enable Custom Keys [Name] pl_fcustom_avail [Syntax] #include 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() o
  • Page 633.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 unavailab
  • Page 643.5.1 Read from the PMC Address (bit) [Name] pl_membrd2 [Syntax] #include 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:
  • Page 653.5.2 Write to the PMC Address (bit) [Name] pl_membwrt2 [Syntax] #include 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 addr
  • Page 663.5.3 Read from the PMC Address (char) [Name] pl_memcrd2 [Syntax] #include 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 *e
  • Page 673.5.4 Read from the PMC Address (short) [Name] pl_memsrd2 [Syntax] #include 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
  • Page 683.5.5 Read from the PMC Address (long) [Name] pl_memlrd2 [Syntax] #include 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 *e
  • Page 693.5.6 Read from the PMC Address (unsigned char) [Name] pl_memucrd2 [Syntax] #include 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 addr
  • Page 703.5.7 Read from the PMC Address (unsigned short) [Name] pl_memusrd2 [Syntax] #include 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 ad
  • Page 713.5.8 Read from the PMC Address (unsigned long) [Name] pl_memulrd2 [Syntax] #include 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 addr
  • Page 723.5.9 Write to the PMC Address (char) [Name] pl_memcwrt2 [Syntax] #include 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
  • Page 733.5.10 Write to the PMC Address (short) [Name] pl_memswrt2 [Syntax] #include 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: Wr
  • Page 743.5.11 Write to the PMC Address (long) [Name] pl_memlwrt2 [Syntax] #include 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: Writ
  • Page 753.5.12 Write to the PMC Address (unsigned char) [Name] pl_memucwrt2 [Syntax] #include 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 addre
  • Page 763.5.13 Write to the PMC Address (unsigned short) [Name] pl_memuswrt2 [Syntax] #include 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 add
  • Page 773.5.14 Write to the PMC Address (unsigned long) [Name] pl_memulwrt2 [Syntax] #include 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 addre
  • Page 783.6 READ SYSTEM INFORMATION 3.6.1 Read CNC Information [Name] pl_sysinfrd [Syntax] #include short pl_sysinfrd(unsigned short id) [Arguments] Input id: Read data type ID ID Data type Return Description (id) value 0 CNC model 0 Series 30i MODEL-A 1 CNC type 0-0x0f Machining system 0x10-0x1f
  • Page 79The 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() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/
  • Page 803.6.2 Read Symbol and Comment in LADDER Program (16 characters symbol is available) [Name] pl_symcmt2 [Syntax] #include unsigned short pl_symcmt2(unsigned char id, unsigned char type, unsigned short offset, unsigned short bit, unsigned char * symbol, unsigned char * comment, unsigned char
  • Page 81At 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. If no symbol or comment is defined, a NULL character
  • Page 823.6.3 Read Symbol and Comment in LADDER Program [Name] pl_symcmt [Syntax] #include 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 AD
  • Page 83not smaller than 7 characters. For a "comment", set a pointer to an array not smaller than 31 characters. 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 PM
  • Page 843.6.4 Read a Message in LADDER Program [Name] pl_message [Syntax] #include 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
  • Page 853.7 ACCESS TO THE EXTENDED NONVOLATILE MEMORY 3.7.1 Read from the Extended Nonvolatile Memory [Name] pl_kpmrd [Syntax] #include 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
  • Page 863.7.2 Write to the Extended Nonvolatile Memory [Name] pl_kpmwrt [Syntax] #include 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 compl
  • Page 873.7.3 Get Size of the Extended Nonvolatile Memory [Name] pl_kpmsiz [Syntax] #include 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 t
  • Page 883.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 Color R G B number 0 Black 0 0 0 1 Red 0x3f 0 0 2 Green 0
  • Page 893.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 Series 30i/ 31i/ 32i-A C executor library for con
  • Page 903.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)". Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New regi
  • Page 913.8.4 Initialize the Character Screen (80 Columns x 30 Lines) [Name] pl_dspopen4 [Syntax] #include 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 initial
  • Page 923.8.5 Initialize a Character Screen (80 Columns x 25 Lines or 40 Columns x 16 Lines) [Name] pl_dspopen [Syntax] #include short pl_dspopen(void); [Arguments] Input --- Output --- [Return] 0: Normal completion. [Description] This function initializes the character screen. On a display unit
  • Page 933.8.6 Erase the Entire Screen [Name] pl_dspclr [Syntax] #include 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 follow
  • Page 943.8.7 Clear Lines [Name] pl_dspclrl [Syntax] #include 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 cle
  • Page 953.8.8 Clear Columns [Name] pl_dspclrc [Syntax] #include 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. [De
  • Page 963.8.9 Set a Display Position [Name] pl_dsppos [Syntax] #include 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
  • Page 973.8.10 Set a Display Attribute [Name] pl_dspcolor [Syntax] #include 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
  • Page 983.8.11 Change Attribute of the Characters Being Displayed [Name] pl_dspattr [Syntax] #include 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 c
  • Page 993.8.12 Display ASCII Characters [Name] pl_dspstr [Syntax] #include 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
  • Page 1003.8.13 Display Characters (Kanji, Hiragana and Special Characters) [Name] pl_dspstrw [Syntax] #include 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 chara
  • Page 101size: 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. [Descri
  • Page 1023.8.14 Display Hex Size Characters [Name] pl_dsptrblr [Syntax] #include 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 characte
  • Page 1033.8.15 Display Cursor [Name] pl_cursor [Syntax] #include 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
  • Page 104[Related Function] 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)
  • Page 1053.8.16 Display Characters (ASCII, Kanji and Hiragana) [Name] pl_dspchar [Syntax] #include 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[
  • Page 106However, it is recommended that the 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 fun
  • Page 1073.8.17 Save the Character Screen [Name] pl_dspsave [Syntax] #include 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
  • Page 108temporarily save or restore the character screen. Cursor display is not saved. [Related Function] crt_gettextimg(), crt_puttextimg() [Example] #include short ret; unsigned char buf[80*30*4]; ret = pl_dspsave(0, NULL, buf); if (ret != 0) { /* error handling */ } ret = pl_dspresave(0, buf);
  • Page 1093.8.18 Restore the Character Screen [Name] pl_dspresave [Syntax] #include 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 scr
  • Page 1103.8.19 Control the Screen [Name] pl_dspcntl [Syntax] #include 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
  • Page 1113.8.20 Set Background Color of the Character Screen [Name] pl_backcolor [Syntax] #include 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 set
  • Page 1123.8.21 Set Palette for Character Screen [Name] pl_dsppalette [Syntax] #include 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 0 at
  • Page 1133.8.22 Initialize the Character Screen (74 Columns x 27 Lines) [Name] pl_dspopen2 [Syntax] #include 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 fun
  • Page 1143.8.23 Initialize the Character Screen (74 Columns x 30 Lines) [Name] pl_dspopen3 [Syntax] #include 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 fun
  • Page 1153.8.24 Initialize printf() [Name] initreq_printf [Syntax] #include 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 v
  • Page 1163.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 Color R G B number 0 Black 0 0 0 1 Red 0x3f 0 0 2 Green 0 0x3f 0 3 Y
  • Page 1173.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) Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06
  • Page 1183.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
  • Page 1193.9.4 Close the Graphic Screen [Name] pl_grpclose [Syntax] #include 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. [
  • Page 1203.9.5 Clear the Graphic Screen [Name] pl_grpclr [Syntax] #include 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] _cle
  • Page 1213.9.6 Display or Hide the Graphic Screen [Name] pl_grpdspon [Syntax] #include 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
  • Page 1223.9.7 Set a Graphic Line Type [Name] pl_grplntyp [Syntax] #include 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
  • Page 1233.9.8 Set a Graphic Color [Name] pl_grpcolor [Syntax] #include 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
  • Page 1243.9.9 Draw Straight Lines [Name] pl_grpline [Syntax] #include 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 t
  • Page 1253.9.10 Draw an Arc [Name] pl_grparc [Syntax] #include 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
  • Page 1262: The "size" is invalid. [Description] This function draws an arc on the graphic screen. [Related Function] _arc() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 126/226
  • Page 1273.9.11 Paint [Name] pl_paint [Syntax] #include 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
  • Page 1283.9.12 Shift [Name] pl_grpsft [Syntax] #include 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 b
  • Page 1293.9.13 Get Graphic Screen Status [Name] pl_grpstatus [Syntax] #include 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:
  • Page 1303.9.14 Erase the Square [Name] pl_grpclr2 [Syntax] #include 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 Outpu
  • Page 1313.9.15 Set Palette for the Graphic Screen [Name] pl_grppalette [Syntax] #include 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 0 at
  • Page 1323.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
  • Page 1333.10.1 Open the Reader / Puncher Interface [Name] pl_rsopen2 [Syntax] #include 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 c
  • Page 134Set 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 communic
  • Page 135[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 clos
  • Page 1363.10.2 Close the Reader / Puncher Interface [Name] pl_rsclose2 [Syntax] #include 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. [Descriptio
  • Page 1373.10.3 Read from the Reader / Puncher Interface [Name] pl_rsrd2 [Syntax] #include 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
  • Page 1383.10.4 Write to the Reader / Puncher Interface [Name] pl_rswrt2 [Syntax] #include 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.
  • Page 1393.10.5 Open the Reader / Puncher Interface (for FANUC Handy File) [Name] pl_fopen2 [Syntax] #include 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 Cha
  • Page 140Set 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 th
  • Page 141Note 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 fo
  • Page 1423.10.6 Get the File Information [Name] pl_fdir2 [Syntax] #include 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 *fil
  • Page 143[Related Function] fca_readdir() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 143/226
  • Page 1443.10.7 Delete the File [Name] pl_fdel2 [Syntax] #include 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. Wh
  • Page 145pl_rsclose(), after the calling of pl_fdel2(). If you 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 r
  • Page 1463.10.8 Open the Reader / Puncher Interface [Name] pl_rsopen [Syntax] #include 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 cnt
  • Page 147output 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
  • Page 148When 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 f
  • Page 1493.10.9 Close the Reader / Puncher Interface [Name] pl_rsclose [Syntax] #include 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 i
  • Page 1503.10.10 Read from the Reader / Puncher Interface [Name] pl_rsrd [Syntax] #include 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
  • Page 1513.10.11 Write to the Reader / Puncher Interface [Name] pl_rswrt [Syntax] #include 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
  • Page 1523.10.12 Open the Reader / Puncher Interface (for FANUC Handy File) [Name] pl_fopen [Syntax] #include 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 Chan
  • Page 153Set 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
  • Page 1545: 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 c
  • Page 1553.10.13 Get the File Information [Name] pl_fdir [Syntax] #include 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
  • Page 1563.10.14 Delete the File [Name] pl_fdel [Syntax] #include 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
  • Page 157When 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() Series 30i/ 31i/ 32i-A C executor libra
  • Page 1583.11 CNC WINDOW 3.11.1 CNC Window Function (Read) [Name] pl_nc_windr [Syntax] #include 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 a
  • Page 159cntl[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 nu
  • Page 1603.11.2 CNC Window Function (Write) [Name] pl_nc_windw [Syntax] #include 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 n
  • Page 1610: 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. 2: The length cntl[2] is invalid. 3: The number
  • Page 1623.11.3 External Data Input [Name] pl_exin [Syntax] #include 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 w
  • Page 1633.12 CNC PROGRAM 3.12.1 Start Registration of the CNC Program [Name] pl_nc_dwnstart2 [Syntax] #include 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
  • Page 1643.12.2 Register the CNC Program [Name] pl_nc_download2 [Syntax] #include 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 progr
  • Page 1652: 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. - When a TV check is enabled, a block that includes odd number of characters is detected. - The ma
  • Page 1663.12.3 End Registration of the CNC Program [Name] pl_nc_dwnend2 [Syntax] #include 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.
  • Page 1673.12.4 Start DNC running of the CNC Program [Name] pl_nc_dncstart2 [Syntax] #include 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 comple
  • Page 168When 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() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hase
  • Page 1693.12.5 Run the CNC Program (DNC running) [Name] pl_nc_dnc2 [Syntax] #include 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 progra
  • Page 170- 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_dncsta
  • Page 1713.12.6 End DNC Running of the CNC Program [Name] pl_nc_dncend2 [Syntax] #include 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.
  • Page 1723.12.7 Search the CNC Program (Supported 8 Digits Program Number) [Name] pl_nc_search2_8d [Syntax] #include 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: Th
  • Page 173[Related Function] cnc_search() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 173/226
  • Page 1743.12.8 Search the CNC Program [Name] pl_nc_search2 [Syntax] #include 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 progr
  • Page 1753.12.9 Delete All CNC Programs [Name] pl_nc_delall2 [Syntax] #include 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: Rejecte
  • Page 1763.12.10 Delete the CNC Program (Supported 8 Digits Program Number) [Name] pl_nc_delete2_8d [Syntax] #include 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
  • Page 1773.12.11 Delete the CNC Program [Name] pl_nc_delete2 [Syntax] #include 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 prog
  • Page 1783.12.12 Start Reading of the CNC Program (Supported 8 Digits Program Number) [Name] pl_nc_upstart2_8d [Syntax] #include 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
  • Page 179[Related Function] cnc_upstart(), cnc_upload(), cnc_upend() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 179/226
  • Page 1803.12.13 Start Reading of the CNC Program [Name] pl_nc_upstart2 [Syntax] #include 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
  • Page 1813.12.14 Read the CNC Program [Name] pl_nc_upload2 [Syntax] #include 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 ar
  • Page 182You 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
  • Page 1833.12.15 End Reading of the CNC Program [Name] pl_nc_upend2 [Syntax] #include 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:
  • Page 1843.12.16 Read the CNC Program Memory Information [Name] pl_nc_dir2 [Syntax] #include 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 t
  • Page 185cnc_rdproginfo() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 185/226
  • Page 1863.12.17 Start Reading of the CNC Program List (Supported 8 Digits Program Number) [Name] pl_nc_pdirstart2_8d [Syntax] #include 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
  • Page 187When 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() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DR
  • Page 1883.12.18 Start Reading of the CNC Program List [Name] pl_nc_pdirstart2 [Syntax] #include 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:
  • Page 189When 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() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DR
  • Page 1903.12.19 Read the CNC Program List [Name] pl_nc_progdir2 [Syntax] #include 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 poin
  • Page 191- 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. [Descr
  • Page 1923.12.20 End Reading of the Program List [Name] pl_nc_pdirend2 [Syntax] #include 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.
  • Page 1933.12.21 Start Registration of the CNC Program [Name] pl_nc_dwnstart [Syntax] #include 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
  • Page 1943.12.22 Register the CNC Program [Name] pl_nc_download [Syntax] #include 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" i
  • Page 195- 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 C
  • Page 1963.12.23 End Registration of the CNC Program [Name] pl_nc_dwnend [Syntax] #include 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 ca
  • Page 1973.12.24 Start DNC running of the CNC Program [Name] pl_nc_dncstart [Syntax] #include 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.
  • Page 198[Related Function] cnc_dncstart(), cnc_dnc(), cnc_dncend() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 198/226
  • Page 1993.12.25 Run the CNC Program (DNC running) [Name] pl_nc_dnc [Syntax] #include 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 pr
  • Page 200- 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 enabl
  • Page 2013.12.26 End DNC Running of the CNC Program [Name] pl_nc_dncend [Syntax] #include 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 characte
  • Page 2023.12.27 Search the CNC Program (Supported 8 Digits Program Number) [Name] pl_nc_search_8d [Syntax] #include 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: Reje
  • Page 2033.12.28 Search the CNC Program [Name] pl_nc_search [Syntax] #include 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, th
  • Page 2043.12.29 Delete All CNC Programs [Name] pl_nc_delall [Syntax] #include 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, Ve
  • Page 2053.12.30 Delete the CNC Program (Supported 8 Digits Program Number) [Name] pl_nc_delete_8d [Syntax] #include 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: Reje
  • Page 2063.12.31 Delete the CNC Program [Name] pl_nc_delete [Syntax] #include 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, th
  • Page 2073.12.32 Start Reading of the CNC Program (Supported 8 Digits Program Number) [Name] pl_nc_upstart_8d [Syntax] #include 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
  • Page 2083.12.33 Start Reading of the CNC Program [Name] pl_nc_upstart [Syntax] #include 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
  • Page 2093.12.34 Read the CNC Program [Name] pl_nc_upload [Syntax] #include 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 si
  • Page 210When 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() Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Has
  • Page 2113.12.35 End Reading of the CNC Program [Name] pl_nc_upend [Syntax] #include 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
  • Page 2123.12.36 Read the CNC Program Memory Information [Name] pl_nc_dir [Syntax] #include 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: R
  • Page 2133.12.37 Start Reading of the CNC Program List (Supported 8 Digits Program Number) [Name] pl_nc_pdirstart_8d [Syntax] #include 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: Rea
  • Page 2143.12.38 Start Reading of the CNC Program List [Name] pl_nc_pdirstart [Syntax] #include 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
  • Page 2153.12.39 Read the CNC Program List [Name] pl_nc_progdir [Syntax] #include 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
  • Page 216- 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_
  • Page 2173.12.40 End Reading of the Program List [Name] pl_nc_pdirend [Syntax] #include 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
  • Page 2183.13 CHARACTER CODE CONVERSION 3.13.1 Convert Characters from ASCII to ISO Code [Name] pl_asciso [Syntax] #include 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 *
  • Page 2193.13.2 Convert Characters from ISO to ASCII Code [Name] pl_isoasc [Syntax] #include 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] --
  • Page 2204 CHARACTER CODE (KANJI, HIRAGANA AND OTHERS) The marked character, " ", cannot be used. Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 220/226
  • Page 221The marked character, " ", cannot be used. Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 221/226
  • Page 222The marked character, " ", cannot be used. Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 222/226
  • Page 223The marked character, " ", cannot be used. Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 223/226
  • Page 224Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 224/226
  • Page 225Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 225/226
  • Page 226The marked character, " ", cannot be used. Series 30i/ 31i/ 32i-A C executor library for conversion Programming manual 01 04.05.06 S. Hasegawa New registration DRAW.NO. B-64183EN/01 EDIT DATE DESIG. DESCRIPTION 226/226