TOC PREV NEXT INDEX

National Institute of Standards and Technology


Appendix C. Sample Programs


This appendix includes three sample programs. This section is intended to be useful to NC programmers and machine operators. Others will probably not find it useful. Additional sample programs are given in Table 6 (hole probing), Table 12 and Table 13 (cutter radius compensation). A transcript of a session using the SAI with keyboard input is shown in Table 10. Table 12 and Table 13 are only sections of programs and need a line at the beginning (to select tool, change tool, start spindle, and set feed and speed rates) and a line at the end (an M2 to end the program).

C.1 Sample Simple Program

The classical simple computer program prints "Hello world". Here it is in RS274/NGC. The program may be safely run on a machining center.

C.2 Sample Program to Test Expressions

This file is to test the interpretation of expressions. It tests all unary and binary functions implemented. It also tests parameter setting and referencing. The last few lines test more complicated expressions. This program is not intended to be run on a machining center. The tool path is just random back and forth on the X-axis.

C.3 Sample Program to Test Canned Cycles

This file tests canned cycles. It is not intended to be run on a machining center.


TOC PREV NEXT INDEX