G31: Skip function
Overview
- Performs a linear move to the given position until the skip signal is activated or the commanded position is reached
- Motion stops on the rising edge of the
Skip
signal, and then waits for a
Done
signal:
- CompassMotionProcessor function block sets
Active
to
1
at the start of the G31 move.
- iCube code asserts the
Skip
signal, triggering motion to stop.
- Next, the latched position data is filled in by the PLC, and made available in G-Code.
- The position data is read in Machine Coordinate system, saved to NC.SysVars.G31.MCS struct.
- The position data is converted from MCS to the currently active Local Coordinate System and is saved to NC.SysVars.G31.LCS struct.
- Finally, the PLC resets the
Active
signal allowing the next block to execute.
- It is a blocking command, CompassNC stops processing until G31 command is completed.
- If the final position is reached without triggering the Skip signal, the G31 motion is complete, Active is reset and the next block is executed.
- Motion lookahead stops when encountered to wait for completion of this move.
Command Format
-
Syntax:
G31 X... Y... Z... F...
-
Specifying Coordinate System
- MCS (G53)
G31 G53 X... Y... Z... F...
-
Feed Rate
F...
- If omitted uses the last modal non-rapid feed rate.
Accessing G31 Trigger's Recorded Position
- The positions are recorded in Machine Coordinate System (MCS) and then converted to a Local Coordinate System (LCS) using the active offsets.
-
X Latch Position
- Latch position captured and filled in by PLC
- Available in G-Code as
#<NC.SysVars.G31.MCS.X>
- Available in G-Code as
#<NC.SysVars.G31.LCS.X>
-
Y Latch Position
- Latch position captured and filled in by PLC
- Available in G-Code as
#<NC.SysVars.G31.MCS.Y>
- Available in G-Code as
#<NC.SysVars.G31.LCS.Y>
-
Z Latch Position
- Latch position captured and filled in by PLC
- Available in G-Code as#<NC.SysVars.G31.MCS.Z>
- Available in G-Code as#<NC.SysVars.G31.LCS.Z>
-
Aux1 Latch Position
- Latch position captured and filled in by PLC
- Available in G-Code as
#<NC.SysVars.G31.MCS.Aux1>
- Available in G-Code as
#<NC.SysVars.G31.LCS.Aux1>
Examples
N1 G90 G17 G21
N2 G52 X0 Y0 Z0
N3 G43 P0
N10 G0 X0.0 Y0.0 Z0.0 F12000
N12 G31 X100 F200 // Perform a linear Skip Move in a currently active coordinate system.
#1001 = # <NC.SysVars.G31.LCS.X> // Save recorded X coordinate to a 1001 variable
N14 G1 Y100 F12000
G1 X0 Y0
G1 X[#1001] // Use recorded X position as a target position.
M30
Warnings
Details
- The Skip motion can be commanded in Machine or Local CS, using the same G53 or G1 commands next to the G31, see samples above.
- The position recorded is saved in a MCS struct and then converted and saved to the LCS struct. Both sets are accessable using # <NC.SysVars.G31.LCS.X> (
Y,Z, Aux1
) and # <NC.SysVars.G31.MCS.X> (
Y,Z, Aux1
) commands.; If you have any frames enabled (G54-G59), these positions will be different.
- For example: To measure a tool length using the sensor mounted on the machine frame, command the motion in Machine CS, use G53 G31 motion command and read the value from NC.SysVars.G31.MCS.
- For example: To measure a pocket that was just machined, while in a Local CS, use G1 G31 motion command and read the value from NC.SysVars.G31.LCS.
See Also: