Documentos de Académico
Documentos de Profesional
Documentos de Cultura
G códigos
Estos son los códigos estándar predeterminados que se utilizan en nuestras máquinas virtuales
normales. Tenga en cuenta que las máquinas personalizadas pueden tener otros códigos y
formatos.
Las siguientes tablas darán una breve explicación de los diversos códigos G, M y otros
reconocidos por el intérprete de CNCSimulator. En la columna Formato, verá el formato esperado
por el programa. Si un código se escribe entre corchetes como este [X #], significa que el código
no es obligatorio y se puede omitir si no es necesario. El signo # significa que el CNCSimulator
espera un número y el signo $ significa que está esperando una cadena de texto entre comillas.
Ejemplo:
G12[X#][Y#]Z#R#Q#S#SA#AS#RA#H#
Esto significa que el código G12 acepta las coordenadas X e Y, pero no son obligatorias y se
pueden omitir. Por otro lado, debe especificar los códigos Z, R, Q, S, SA, AS, RA y H para evitar
una alarma en el tiempo de ejecución.
G03 Exactamente como G02, pero el G03[X#] G03 X10 Todas las
XY-machines movimiento circular va en sentido [Y#][Z#] Y10 I10 J0 maquinas
contrario a las agujas del reloj. [I#][J#] F200
[K#][R#]
Lathe [F#]
G04 P2000
G04 Morar en milisegundos. Esto
(Two Todas las
mantendrá los ejes inmóviles durante G04 P# seconds maquinas
el período de tiempo especificado por delay)
el número P.
Forzará a la máquina a hacer una
parada completa antes de continuar
G09 Todas las
G09 con el siguiente movimiento. Esta es
maquinas
una variante no modal de G61 y, por
lo tanto, no tiene que ser cancelada.
G17
Selecciona el plano XY para
G17 Solo
movimientos circulares (ver G02 y G17
Fresadoras
G03).
Solo
Selecciona el plano XZ para Fresadoras
movimientos circulares (ver G02 y G18 G18
G03)
Todas las
G41
Activa la compensación del cortador G41[D#] maquinas
G41
del lado izquierdo (o la compensación [P#] excepto
More info
del radio de la punta en un torno). impresora
3D
G42
Todas las
Activates right side cutter G42[D#] G42 maquinas
compensation (or nose radius [P#] More info except the
compensation in a lathe).
3D Printer
G54-G59 Fixture (work) offsets. A typical use of G54 G00 G54 Todas las
these G-codes is to establish a local X0 Y0 Z3 maquinas
coordinate system for each workpiece
when using multiple ones. You need to
setup the offsets in the Zero Points
Data table in the Inventory Browser
(F2).
G54 corresponds to offset registry
index 0, G55 to index number 1 etc…
G65 P#
Direct call of a macro. P is the macro A...
G65 P1005 Todas las
G65 number to be called. For more B...
A180 maquinas
information, see Macro programming. C...
etc.
or
G68
A(center
in X)
B(center
in Y)
R(angle)
Finishing Cycle.
G73
Peck drilling canned cycle. The cycle
is intended for deep drilling or chip
breaking milling operations. The cycle
retracts the tool to break chips. Code G73 [X#]
letter Q is used for peck size. R is [Y#][Z#] G73 Z-20 Milling
starting plane and Z is total depth. [R#][Q#] R1 Q1 machines
[P#] P100 only
Parameter P is used for dwell at each
peck. Please note that at the end of
the cycle, the return position in Z is
controlled by G98 and G99.
G76 [X#]
Generic drilling/boring/tapping canned [Y#][Z#] Solo
G76
cycle. See G74-G75 above. [R#] Fresadoras
Milling and
Cancels any canned cycle. Please
G80 turning
G80 note that G00 – G03 also cancels G80
machines
canned cycles.
only
G81
Use to reposition the origin point (zero G92[X#] G92 X20 Todas las
G92 [Y#][Z#] Y20 Z10
point). maquinas
Milling and
G94 Set feed in millimeter or inch per G94 turning
G94
minute. machines
only
Milling and
G95 turning
G95 Set feed per revolution mode. G95
machines
only
G96[S#] Turning
G96 Constant surface speed control. G96 S300
machines
Cancel constant surface speed G97 Turning
G97 G97
control. machines
G98
Milling and
G98 G81 G98 turning
Initial level return at the end of a
Z-7 R2 machines
canned cycle.
only
G99
Milling and
R level return at the end of a canned G99 G81 G99 turning
cycle. Z-7 R2 machines
only
6.2. M codes
These are the default standard codes that are used in our normal virtual machines. Please note
that customized machines may have other codes and formats.
M-code
(codes valid from Explanation Format Example Machine type
V1.0.6.5)
Optional stop (pause). Will pause the
M00 execution of the CNC program if the
“Op.Stop” switch on the virtual CNC Todas las
Controller is activated. Click start or play to M00 M00
maquinas
continue.
M02
M02 Todas las
Program end. Simulation will stop. M02
maquinas
M03
Milling and
Start of spindle clockwise. The rotation M03 M03
turning
speed is controlled by the S code letter. S2500
machines only
M04
Start of spindle counterclockwise. The Milling and
M04 M04
rotation speed is controlled by the S code turning
S2500
letter. machines only
M05
Milling and
Spindle stop. M05 M05 turning
machines only
M06
Execute a tool change. The number of the Milling and
tool has to be preselected with the T code M06 T17 M06 turning
letter. machines only
M08
Milling and
Turn on coolant. M08 M08 turning
machines only
M09
Milling and
Turn off coolant. M09 M09 turning
machines only
M20
Todas las
Open machine doors. M20 M20 maquinas with
doors
M21
Todas las
Close machine doors. M21 M21 maquinas with
doors
M30
M30 Todas las
Program end. Simulation will stop. M30
maquinas
M99
Return from a macro, subroutine or M99 Todas las
M99
subprogram. More info maquinas
6.3. $-commands and regions
These are the default standard codes that are used in our normal virtual machines. Please note
that customized machines may have other codes and formats.
The $-commands are special simulation commands for controlling the various aspects of the
simulation. They have nothing to do with CNC codes and should not be transferred to a real CNC
controller. $-commands can be put within parenthesis and will still be read by the simulator. Blocks
of $-commands can be hidden from the CNC code by encapsulating them in a region making the
block collapsible.
Do you notice the little - (minus) sign before the region command at the first line? If you click it, the
region will be collapsed hiding the block of $-commands.
A collapsed region will show three dots and a + (plus) sign. If you click the plus sign, the region will
expand.
You can see what a collapsed region hides without expanding it by hover the mouse pointer over it.
When you open a CNC program from the disk, it always loads with its regions collapsed.
In the following table we list and give a brief explanation of all built in $-commands. Please not that
many of them are not for common use but rather made for special use in examples or when
creating portable programs. We have colored the commands you will likely use in red. If you are
not an advanced user that wants to learn all aspect of the CNCSimulator, you can skip over the
commands colored in black. Not even all red command is a must to know. As a minimum, you have
to know the $AddRegPart command as you will need it to place workpieces on the table (or in the
chuck). If you are a 3D Printer only user, you can ignore the $-commands.
Note that these commands works even when they are inside parentheses. It is normally good to
keep them in parentheses to avoid confusion with other software or CNC controllers.