G-code
Language standard
System parameters/Variables
1min
in the rs274/ngc language view, a machining center maintains 5999 numerical parameters they can be accessed by #1 #5999 the specific parameters with a dedicated function are listed in the table below other parameters in the range of 1 5999 are free to use in your g code program some of them have a special function and are read only; see the table below parameters in italics are read only parameter number purpose 1 26 used for parameters when overriding m functions in the g code there is e g m999 x100 s1000 and you have in your macro cnc sub m999 msg βthis is my m999 x=β#24β s=β#19 endsub inside the subroutine, the given x and s parameters are at #24 and #19 #1 #26 = a β z parameter value values are negative 1e10 if not provided with m999 in this example 27 4999 free to use , note that 4995 β 4999 are used by the tool length measurement function under user button 2 z#4996 safe height for tool measurement above the fixed tool setter x#4997 y#4998 fixed tool setter position z#4999 chuck height, or zero length tool height, chuck just touches the fixed tool setter at this height z#4995 is used for the tool setter height for zeroing z under user button 1 4000 4999 free to use, persistent , see above some of these are used by tool length measurement and zeroing 5001 5006 position of x β c, interpreter position = work position 5008 current tool number 5009 current tool radius 5010 current tool z offset (length + zdelta) 5011 new tool number during tool change (m6) 5012 current tool x offset (x offset + xdelta) 5013 current g43 z offset (z offset + zdelta) 5014 current g43 x offset (x offset + xdelta) 5015 5050 used in tool change sub routine 5051 5056 probe position x c in machine coordinates 5061 5066 probe position x c in work coordinates 5067 1 if the probe is triggered after g38 2 , 0 otherwise 5068 current probe value 5069 handwheel counter 5070 spindle rate in rev/second 5071 5076 position of x c, interpreter position without offsets = machine position 5081 5086 probe position x c in joint coordinates 5101 5106 mca negative limit x c 5111 5116 mca positive limit x c 5121 5126 home position x c 5131 5133 tca negative limit x z 5141 5143 tca positive limit x z 5150 active kinematics type 1 trivial 2 4 ax acylinder (y > a mapping) 3 virtual c 4 17 system reserved 18 30 custom 1 β custom 12 5151 zhc is active 5152 1 if the spindle is on, 0 if the spindle is off 5161 5166 g28 home x c 5181 5186 g30 home x c 5190 g68 rotation method (0 = off, 1 = on) 5191 5193 g68/g51 rotation point x c 5194 g68 rotation angle xy 5195 g68 rotation angle yz 5196 g68 rotation angle xz 5200 0 if g51 scaling is off, 1 if g51 scaling is on 5204 g51 scaling factor x 5205 g51 scaling factor y 5206 g51 scaling factor z (always 1 0) 5211 5216 g92 offset x c 5220 coordinate system number 5221 5226 coordinate system 1 x c 5241 5246 coordinate system 2 x c 5261 5266 coordinate system 3 x c 5281 5286 coordinate system 4 x c 5301 5306 coordinate system 5 x c 5321 5326 coordinate system 6 x c 5341 5346 coordinate system 7 x c 5361 5366 coordinate system 8 x c 5381 5386 coordinate system 9 x c 5390 spindle selection 0 = m90, 1 = m91, 2 = m92 5391 5393 alternative spindle offset x z 5394 5397 spindle speed max m90 m93 5230, 5250, 5270, 5290, 5310, 5330, 5350, 5370 reserved for rotation coordinate system 5380 simulation mode, 0 controller connected, 1 simulation mode 5397 running mode, 0 running, 1 rendering use e g if you have g38 2 movements in your macro file because during rendering g38 2 always runs until the given end point which may give incorrect tool measurement results always take care that the tool table contains (approx ) correct tool data 5398 return value of dlgmsg (1 = ok, 1 = cancel) 5399 return value for m55 , m56 5401 5499 tool z offset (length) for tools 1 99 5501 5599 tool diameter for tools 1 99 5601 5699 tool x offset (for lathe) for tools 1 99 5701 5799 tool orientation (for turning) for tools 1 99 5801 5899 tool x delta due to wear 5901 5999 tool z delta due to wear