Glossary · CNC and machine tools
Modal command
Also known as: Modal function, Modal code
German: Modaler Befehl
In CNC programming, a modal command is a function or value that stays in effect after the block in which it is programmed until it is canceled or replaced by another command of the same group.
- CNC
- Standards
In one sentence
A modal command stays in effect in a CNC program until it is canceled or replaced, for example G01 or a programmed feed rate.
Example
After G01 F200 in block N10, the following blocks move linearly at 200 mm/min without repeating G01 or F until G00 is programmed.
How it applies
- Programming: Interpolation mode, plane selection, unit system, feed rate and the active Work offset are typically modal. Programmers must know the active modal state at every block, especially after a program restart in the middle of a program.
- Operation: Many controls show the active modal G-codes on the screen. When a program is restarted at a block, the control or the operator has to restore the correct modal state first.
- Documentation: Programming guidelines should list which commands are modal on the specific control and recommend a safe start block that sets all relevant modal states explicitly. This is a typical content for a reference topic in the machine's programming manual.
Modal vs. nonmodal command
A Nonmodal command acts only in the block where it is written, such as a dwell. A modal command changes the control's state; its effect is best understood with a State model: the command is a transition, the active mode is the state.