Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
3. Distance mode is set to MODE_ABSOLUTE (like G90).
4. Feed rate mode is set to UNITS_PER_MINUTE (like G94).
5. Feed and speed overrides are set to ON (like M48).
6. Cutter compensation is turned off (like G40).
7. The spindle is stopped (like M5).
8. The current motion mode is set to G_1 (like G1).
9. Coolant is turned off (like M9).
No more lines of code in an RS274/NGC file will be executed after the M2 or M30 command is
executed. Pressing cycle start will start the program back at the beginning of the file.
"""
####################################################################################################
class M3_M4_M5:
"""**Spindle Control — M3, M4, M5**
To start the spindle turning clockwise at the currently programmed speed, program M3.
To start the spindle turning counterclockwise at the currently programmed speed, program M4.
To stop the spindle from turning, program M5.
It is OK to use M3 or M4 if the spindle speed is set to zero. If this is done (or if the speed
override switch is enabled and set to zero), the spindle will not start turning. If, later, the
spindle speed is set above zero (or the override switch is turned up), the spindle will start
turning. It is OK to use
M3 or M4 when the spindle is already turning or to use M5 when the spindle is already stopped.
"""
####################################################################################################
class M6:
"""**Tool Change — M6**
To change a tool in the spindle from the tool currently in the spindle to the tool most recently
selected (using a T word — see Section 3.7.3), program M6. When the tool change is complete:
* The spindle will be stopped.
* The tool that was selected (by a T word on the same line or on any line after the previous
tool change) will be in the spindle. The T number is an integer giving the changer slot of the
tool (not its id).
* If the selected tool was not in the spindle before the tool change, the tool that was in the
spindle (if there was one) will be in its changer slot.
* The coordinate axes will be stopped in the same absolute position they were in before the tool
change (but the spindle may be re-oriented).
* No other changes will be made. For example, coolant will continue to flow during the tool
change unless it has been turned off by an M9.
The tool change may include axis motion while it is in progress. It is OK (but not useful) to
program a change to the tool already in the spindle. It is OK if there is no tool in the
selected slot; in that case, the spindle will be empty after the tool change. If slot zero was
last selected, there will definitely be no tool in the spindle after a tool change.
"""
####################################################################################################
class M7_M8_M9:
"""**Coolant Control — M7, M8, M9**
* To turn mist coolant on, program M7.
* To turn flood coolant on, program M8.
* To turn all coolant off, program M9.
It is always OK to use any of these commands, regardless of what coolant is on or off.
"""
####################################################################################################
class M48_M48:
"""**Override Control — M48 and M49**
To enable the speed and feed override switches, program M48. To disable both switches, program
M49. See Section 2.2.1 for more details. It is OK to enable or disable the switches when they
are already enabled or disabled.
"""
####################################################################################################
# **Other Input Codes**
####################################################################################################
class F:
"""**Set Feed Rate — F**
To set the feed rate, program F… . The application of the feed rate is as described in Section
2.1.2.5, unless inverse time feed rate mode is in effect, in which case the feed rate is as
described in Section 3.5.19.
"""
####################################################################################################
class S:
"""**Set Spindle Speed — S**
To set the speed in revolutions per minute (rpm) of the spindle, program S… . The spindle will
turn at that speed when it has been programmed to start turning. It is OK to program an S word
whether the spindle is turning or not. If the speed override switch is enabled and not set at
100%, the speed will be different from what is programmed. It is OK to program S0; the spindle
will not turn if that is done.
**It is an error if:**
* the S number is negative.
As described in Section 3.5.16.5, if a G84 (tapping) canned cycle is active and the feed and
speed override switches are enabled, the one set at the lower setting will take effect. The
speed and feed rates will still be synchronized. In this case, the speed may differ from what is
programmed, even if the speed override switch is set at 100%.
"""
####################################################################################################
class T:
"""**Select Tool — T**
To select a tool, program T…, where the T number is the carousel slot for the tool. The tool is
not changed until an M6 is programmed (see Section 3.6.3). The T word may appear on the same
line as the M6 or on a previous line. It is OK, but not normally useful, if T words appear on
two or more lines with no tool change. The carousel may move a lot, but only the most recent T
word will take effect at the next tool change. It is OK to program T0; no tool will be
selected. This is useful if you want the spindle to be empty after a tool change.
**It is an error if:**
* a negative T number is used,
* a T number larger than the number of slots in the carousel is used.
On some machines, the carousel will move when a T word is programmed, at the same time machining
is occurring. On such machines, programming the T word several lines before a tool change will
save time. A common programming practice for such machines is to put the T word for the next
tool to be used on the line after a tool change. This maximizes the time available for the
carousel to move.
"""