-
G31: Skip function
Overview
- Performs a linear move to the location specified
- Motion stops on the rising edge of the
Skip signal, and then waits for a Done signal:
- 1-CompassMotionProcessor function block sets
Active to 1 at the start of the G31 move
- 2-iCube code asserts the
Skip signal, triggering motion to stop
- 3-Next, the latched position data is filled in by the PLC, and made available in G-Code
- 4-The position data is read in Machine Coordinate system, saved to NC.SysVars.G31.MCS struct.
- 5-The position data is converted from MCS to the currently active Local Coordinate System and is saved toNC.SysVars.G31.LCS struct.
- 6-Finally, the PLC resets the
Active signal allowing the next block to execute
- 7-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... - Skip Move using Local CS
G31 G1 X... Y... Z... F... - Skip Move using Local CS
G31 G53 X... Y... Z... F... - Skip Move using Machine CS
F...
- Feed rate. If omitted uses the last modal non-rapid feed rate.
X... Y... Z...
- Moves specified axes to the given position until the skip signal is activated or the commanded position is reached
- Errors
- Do not use if G41 or G42 tool radius compensation is active
- Data Structure -
G31SkipMove
-
G31SkipMove.Enabled
- Set to
1 by CompassMotionProcessor function block when G31 block is sent to the firmware
- Reset to
0 by PLC when finished with command
- Prepares and monitors Motion IDs of blocks in motion queue looking for the skip motion block
G31SkipMove.MotionID
- Motion ID of the skip block assigned by the firmware when added.
G31SkipMove.Active
- Set to
1 by CompassMotionProcessor function block when G31 block is motion
- Reset to
0 by PLC when finished with command
G31SkipMove.Skip Signal
- Set to
1 by PLC when probing is triggered
- Reset to
0 by Compass at start of command
- G31SkipMove.PositionsRecorded
- Set after the Skip signal was triggered and the current actual axes positions are recorded to NC.SysVars.G31.MCS.X(y, Z, Aux1) struct.
- Triggers group Stop function
- Finalizes G31 command.
- Skip Move Trigger position access:
- 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>
See PLC Data Structures PLC Data Structures
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
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: