Structure of NC control data: NC programs
Definitions for understanding:
NC programs are part of the NC control data in addition to tool data, zero offset data etc. NC programs describe the flow of machining processes.
Separating characters indicate the end of a sequence of characters (character string). The decoder evaluates the following separating characters:
CR | LF | ETX | TAB | \0 | Blank | ( | ; | " | ] | , | # | $ |
Notice
These characters may not be used in file names or as part of % program names by the NC main program or subroutines (local, global); otherwise an error is output.
Comments contain non-decodable ASCII information which must be placed between the characters "(" and ")” or after the character ";”. If an additional "(" is found within a comment, a matching ")” is expected. The block end character and the file end character end the comments.
Mathematical expressions are composed of numerals, parameters, operators, functions, etc. They are evaluated by an integrated calculation function.
Examples: "100", "100+20", "100+P10", "100+PP10", "100*[2+P3]", "DEXP[2]", "100+SIN[P10+PP20]".
An NC program consists of:
- Comments
- Definitions of local subroutines, consisting of:
- String "%L" followed by a subroutine name
- A number of NC program blocks
- A code identifying subroutine end (M17 or M29)
- Definition of the main program, consisting of:
- String "%" followed by a main program name
- A number of NC blocks
- A code identifying main program end (M02 or M30).
Notice
If a file outside the comments contains a first character that is neither a separating character nor a "%", the character is evaluated as the first character of an unnamed main program. It also means that no block numbers may be programmed in front of "%".