GCode notes

http://www.tormach.com/machine_codes.html

 

Delay seconds

G4 P[seconds]

To set the coordinate values for the origin of a fixture coordinate system, program:
G10 L2 P~ X~ Y~ Z~ A~, where the P number must evaluate to an integer in the range 1 to 255 – the fixture number (Values 1 to 6 corresponding to G54 to G59) – and all axis words are optional. The coordinates of the origin of the coordinate system specified by the P number are reset to the coordinate values given (in terms of the absolute coordinate system). Only those coordinates for which an axis word is included on the line will be reset.

Example:
G10 L2 P1 x3.5 y17.2 sets the origin of the first coordinate system (the one selected by G54) to a point where X is 3.5 and Y is 17.2 (in absolute coordinates). The Z coordinate of the origin (and the coordinates for any rotational axes) are whatever those coordinates of the origin were before the line was executed.

 

G52: trick system into think it is somewhere else, seems (at least with mach3 to be across all offsets unfortunately.

 

G90 = Absolute coordinate positioning. Points based from XYZ zero.
example: G90 G00 X## Y## Z##

G91 = Incremental coordinate positioning. Point to point positioning.
example: G91 G00 X## Y## Z##

G90 and G91 - Distance Mode
Details:
Interpretation of the CS-code can be in one of two distance modes: absolute or incremental.

To go into absolute distance mode, program: G90. In absolute distance mode, axis numbers (X, Y, Z, A) usually represent positions in terms of the currently active coordinate system. Any exceptions to that rule are described explicitly in this section describing G-codes.

To go into incremental distance mode, program: G91. In incremental distance mode, axis numbers (X, Y, Z, A) usually represent increments from the current values of the numbers.

I and J numbers always represent increments, regardless of the distance mode setting. K numbers represent increments.

 

M3, M4 and M5 - Spindle Control
Details:
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 turn mist coolant on, program: M7.

To turn flood coolant on, program: M8.

To turn all coolant off, program: M9.

User Defined M-codes
Details:
If any M-code is used which is not in the above list of built-in codes then the Control Software will attempt to find a file named “Mxx.m1S” in the Macros folder corresponding to the current XML profile name. If it finds the file then it will execute the Visual Basic script program it finds within it.

New macros can be written using an external editor program like Notepad and saved in the Macros folder.

 

Note to self: Use GetParam & SetParam to access:

"ZMachine" = Z Mach Positions (G53 Coordinates)

"XMachine" = X Mach Positions (G53 Coordinates)

"YMachine" = Y Mach Positions (G53 Coordinates)

"XDRO" = current X position per current offset

"YDRO" = current Y position per current offset

http://www.machsupport.com/MachCustomizeWiki/index.php?title=Get/SetParam%28%29_Vars