
B–62073E–2/03
A.MACRO PROGRAM EXAMPLE
147
00120 #143 = 100 ;
00130 M98 P0011 ;
00140 #100 = 0 ; Cursor display position pointer
00150 #146 = 2 ; X axis direction cursor position
00160 N001 #142 = #8501 ; Key input control variable save
00170 IF [ #142 EQ 0 ] GOTO 20 ; Key input presence determination
00180 IF [ #142 NE 1 ] GOTO 10 ; If cursor “±”, pointer+1
00190 #100 = #100 + 1 ;
00200 N10 IF [ #142 NE 2 ]GOTO 20 ; If cursor “°”, pointer–1
00210 #100 = #100 – 1 ;
00220 N20 #100 = #100 + 6 ;
00230 #100 = #100 – [ FIX[ #100 / 6 ]]
*
6 ;
00240 #147 = #100 + 3 ; Actual Y axis cursor position
00250 G230 X#146 Y#147 L1 ; Cursor display on
00260 IF [ #142 NE 16 ]GOTO 100 ; Returns to menu if end key is pressed
00270 #8500 = 1 ;
00280 M99 ;
00290 N100 M99 P1 ;
00010 O0030 ; Character display test
00020 G202 P3 ; Screen clear
00030 #8502 = 0 ; No key input
00040 G230 L0 ; Cursor OFF
00050 #143 = 100 ;
00060 M98 P0011 ;
00070 N1 #100 = 1234.567 ;
00080 X0 Y0 (DISPLAY TEST) ; Title display
00090 X0 Y1 (FANUC 15 SERIES MACRO COMPILER) ;
00100 X0 Y5 (
*
3C 20 3441 2438 493D 3C28 00C3 00BD 00C4 20 3E
*
) ;
00110 X3 Y7 (
*
352D 3966 2F40 2F48 2F79 2F53
*
) ;
00120 M98 P0032 ; Blink test subprogram
00130 X0 Y13 (
*
3C
*
DATA DISPLAY TEST 1234.567
*
3E
*
) ;
00140 X3 Y15 (
*
28
*
LEADING ZERO SUPPRESS
*
29
*
) ;
00150 X6 Y16 Z1 F8.3 (F8.3 ) D#100 ;
00160 X6 Y17 Z1 F5.2 (F5.2 ) D#100 ;
00170 X3 Y18 (
*
28
*
NOT LEADING ZERO SUPPRESS
*
29
*
) ;
00180 X6 Y19 Z0 F8.3 (F8.3 ) D#100 ;
00190 X6 Y20 Z0 F5.2 (F5.2 ) D#100 ;
00200 X39 Y5 (
*
3C
*
STRINGS DISPLAY TEST
*
3E
*
) ;
00210 X41 Y7 P10 ; Displays sequence No. 10 character array
00220 X41 Y8 P20 ; Displays sequence No. 20 character array
00230 X41 Y9 P30 ; Displays sequence No. 30 character array
00240 X39 Y11 (
*
3C
*
3
*
475C 4A38 2438
*
*
3E
*
) ;
00250 X41 Y13 A3 B0 (3 MULTI) ; Displays triple characters
00260 #142 = #8501 ; Saves key input variable
00270 IF [ #142 NE 16 ]GOTO 100 ; Returns to menu if software key ends
00280 #8500 = 1 ;
00290 M99 ;
00300 N100 M99 P1 ;
00010 O0032 ; Blink display
00020 G243 X0 Y9 A1 B0 (
*
3C
*
BLINK TEST
*
3E
*
) ;
00030 N001 G243 X3 Y11 A1 B1 (BLINK) ; BLINK display on
00040 G243 B0 ; BLINK display OFF
00050 M99 ;
00010 O0033 ; Display character data
00020 N10 (ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;
00030 N20 (0123456789) ;
00040 N30 (FANUC TECHNICAL TRAINING CENTER) ;
00050 N100 ( ) ;
00060 N101 ( ) ;
00070 N102 ( ) ;
00080 N103 ( ) ;
Software key display
Pointer position calculator
Encloses characters to be displayed in ()
Software key display