8 Basic CNC Programming
8.4 NC Codes
125
Info Table: Special Codes for Use With M105
Code
Function
!
Displays the message and performs a pause requiring operator intervention to continue.
~
Displays the message as a Warning Message.
\b
Beeps when the message is shown.
The M105 code is used with special codes as in the format below:
M105 (alternate character plus the message) ;comment
For example:
Example Code: Use of M105 with Special Codes
M105 (~WARNING); Warning Message, doesn’t pause
M105 ( ) ; Clears current message
M105 (!Please stop and read this!) ; Normal Message, pauses
M105(~!I Proceed with Caution!) ; Warning Message, pauses
M105 (\b\b\b) ; Clears current message, beeps 3 times, and doesn’t pause
8.4.13.
N Code: Block Number
N codes have two uses:
To provide destination references for Goto codes (M99) elsewhere in the program.
To clearly show the organization of the code and improve readability.
Using the N code is optional; however, when you do use the N code, it must be the first character in the
block.
Apart from the uses listed above, N codes are ignored by the control software. Their presence, absence,
or sequential value does not affect the execution of the NC program in any way, unless the target of a
Goto is missing.
You may have N codes on some blocks and not on others. N code sequence numbers do not have to be
in order, but regular sequential order does make it easier to follow and reference sections of the
program.
You can automatically number, renumber, or remove numbering from the program using the control
software. Click
Edit
|
Renumber
in the Main Menu.
8.4.14.
O Code: Subprogram Block Number
The O code is used to indicate the start of a subprogram, and must be followed by a number which
identifies the subprogram. The O code replaces the N code in the first block of the subprogram.
To call a subprogram, use the M98 code using the P code to specify which subprogram to execute. To
return from the subprogram, use the M99 code. See
9.7 Subprogram Programming, pg. 143.
Only the first block in the subprogram contains the O code. The remaining blocks may contain N codes.
The O and N code numbers may be used to help identify and set apart the subprogram to improve
readability, for example: