Skip to main content
CNC.wiki

G08 Advanced Preview and Look-Ahead G-Code Programming Guide

Master G08 Advanced Preview and Look-Ahead control for Fanuc, Siemens, and Mitsubishi. Learn parameters, prevent alarms, and avoid turret collisions.

Hakan Gündoğdu
Hakan Gündoğdu

CNC CARE Co-founder

Introduction

Attempting to modify tool length compensation or activating look-ahead control while a milling cutter is directly engaged in raw stock will cause an instantaneous feedrate drop. This sudden deceleration leaves deep, permanent gouges on the workpiece surface, resulting in a ruined scrap part. In more severe cases, attempting coordinate offset changes with active offsets can drive the tool turret straight into a rotating workpiece chuck or a fixture clamp, causing a catastrophic hard collision that bends the machine spindle and shuts down production.

To prevent these quality defects and mechanical hazards, CNC systems support G08 Advanced Preview and Look-Ahead control. This function allows the control to read ahead multiple blocks of G-code coordinates to calculate acceleration and deceleration transitions before the axes begin physical interpolation. By planning these speed curves in advance, the control maintains high feedrates through complex multi-axis contours, preventing servo lag errors and reducing tool wear.

Technical Summary

SpecificationDetails
Command CodeG08 (Fanuc, Mitsubishi) / G64, CYCLE832 (Siemens equivalent)
Modal GroupGroup 00 (Fanuc), Group 13 (Mitsubishi driver), Group 10/Cycle (Siemens)
Brands SupportedFanuc, Siemens, Mitsubishi
Critical ParametersFanuc: Parameter 5040 Bit 3, Parameter 3401/3402. Siemens: ADIS, MD20734, CYCLE832 tolerance. Mitsubishi: Parameters #2110, #2109, #1148, #8040.
Main ConstraintG08 must be programmed alone in an independent block. Tool length compensation must be canceled before modifying Parameter 5040 Bit 3 on Fanuc. Mitsubishi restricts simultaneous use of high-accuracy mode to a maximum of two part systems.

Quick Read

  • Program G08 P1 or G08 P0 in an independent block with no movements or auxiliary functions.
  • Transition G08 states only when the cutter is safely separated from the workpiece to prevent abrupt deceleration and surface marks.
  • Deactivate tool length compensation before modifying Parameter 5040 Bit 3 (TCT) on Fanuc to avoid Alarm PS0368.
  • Set Siemens machine data parameter MD20734 ($MC_EXTERN_FUNCTION_MASK) Bit 3 to 1 to bypass scanner errors when executing ISO Dialect G08 codes.
  • Configure Mitsubishi parameter #8040 to enable high-accuracy control on no more than two part systems simultaneously to prevent Y51 0032 alarm.
  • Verify feedrate clamp settings in Mitsubishi parameters #2109 and #2110 to prevent unintentional feed clamping during high-accuracy execution.
  • Perform first-article dry runs in the air to verify tool paths and check that the tool tip safely clears all vise jaws and fixture clamps.

Basic Concepts

Look-ahead and advanced preview control functions by pre-reading multiple blocks of coordinates from the buffer to calculate acceleration and deceleration curves before interpolation. When executing short-segment G-code contours at high cutting feedrates, standard servo response delays can cause path tracking errors. By planning the velocity transitions across block boundaries, the CNC control minimizes servo lag and structural machine vibration, preserving surface finish on 3D mold profiles and complex geometry.

However, command placement requires strict programmer discipline. Because a deceleration check occurs exactly at the G08 block, activating or canceling look-ahead control during an active cutting path causes the feedrate to instantly drop to zero. This velocity drop leaves dwell marks on the material and creates scrap parts. Programmers must ensure G08 P1 and G08 P0 commands are executed only when the cutter is safely separated from the raw stock.

In addition, coordinate offsets and length compensations must be tightly managed during look-ahead operations. Changing tool length compensations or shift parameters while coordinate offsets are active alters coordinate registers unpredictably. This path deviation can drive the turret directly into a rotating chuck or fixture clamp. Using virtual Chuck Barriers and Tailstock Barriers protects the machine by halting motion if a boundary is violated, while performing first-article dry runs in the air ensures the cutter safely clears all workholding fixtures.

Command Structure

Activating advanced preview or look-ahead control requires specifying the G08 command with parameter P1. In Fanuc and Mitsubishi systems, G08 P1 switches the interpolation buffer to read blocks ahead, optimizing speed transition curves. The cancellation is performed by specifying G08 with P0. Both of these G-code commands must be programmed in their own independent blocks. Unrecognized codes or additional movements in the same block will halt execution.

For Siemens systems, there is no native G08 command. Instead, look-ahead is managed using G64 continuous-path mode G-codes or CYCLE832. However, if the controller is in ISO Dialect mode (G291), it can parse G08 P1 and G08 P0, provided the external language option is enabled and the parser mask is configured correctly. This allows shops to run unified G-code programs across different machine controls without rewriting block structures.

; Fanuc and Mitsubishi G08 Syntax
G08 P1 ; Enable Advanced Preview Control (independent block)
...
G08 P0 ; Disable Advanced Preview Control (independent block)

The control systems use specific machine parameters to govern look-ahead, system state clearance, and ISO translator behavior:

BrandParameterDescriptionValue Range
FanucParameter No. 5040 Bit 3 (TCT)Controls tool length compensation shift type.Binary (0 or 1)
FanucParameter No. 3401 Bits 7/6Selects G-code system (A, B, or C) to determine G08 availability.Binary (0 or 1)
FanucParameter No. 3402 Bit 6Defines cleared modal state at power-up/reset.Binary (0 or 1)
SiemensADIS / ADISPOSRounding distance before corner blending path.Positive real number
SiemensMD20734 ($MC_EXTERN_FUNCTION_MASK)Bit 3 bypasses ISO scanner errors; Bit 2 dictates dwell scaling.Bit-masked value
SiemensCYCLE832 Tolerance (_TOL)Contour tolerance for high-speed machining.Positive real number
MitsubishiParameter #2110 (Clamp H-precision)Cutting feed clamp speed. If 0, clamped by #2002.Feedrate range
MitsubishiParameter #2109 (Rapid H-precision)Rapid traverse rate. If 0, clamped by #2001.Feedrate range
MitsubishiParameter #1148 (Initial hi-precis)Default modal state at power-on.0 to 4
MitsubishiParameter #8040 (High-SpeedAcc)Limits simultaneous look-ahead usage to 2 part systems.Binary (0 or 1)

Brand Applications

Fanuc

Fanuc G08 Advanced Preview Control processes short motion segments smoothly by pre-reading block data to optimize velocity and acceleration curves before interpolation. Activating G08 while the cutter is engaged in raw stock causes a sudden speed drop, leaving severe tool marks and creating a scrap part. Operators must manage Parameter No. 5040 Bit 3 (TCT) and Parameter No. 3401 to ensure availability.

To program, write G08 P1; alone in an independent block to activate. Write G08 P0; alone to deactivate.

CategoryDetails
ParametersParameter No. 5040 Bit 3 (TCT) for compensation shift, Parameter No. 3401 for G-code system configuration, Parameter No. 3402 Bit 6 (CLR) for clear state.
AlarmsAlarm PS0368 (tool offset active during parameter change), Alarm PS0306 (mismatch axis with chamfer/rounding), Alarm PS0051 (invalid sign at coordinates).
VersionsSeries 15 program format disables standard roughing cycles when Parameter No. 0001 Bit 1 FCV is active (1).

Warning: Modifying Parameter 5040 Bit 3 while tool length compensations are active triggers Alarm PS0368 and causes unexpected coordinate shift register changes, risking turret collisions.

Siemens

Siemens controls do not natively utilize G08, managing look-ahead through continuous-path modes (G64) and CYCLE832. However, G291 ISO Dialect mode allows processing G08 P1 and G08 P0, using parameter MD20734 Bit 3 to bypass legacy scanner checks and prevent unnecessary alarms.

Write G291; followed by G08 P1; in an independent block to activate look-ahead in ISO mode. Use G08 P0; to deactivate before returning to native G290 mode.

CategoryDetails
ParametersADIS / ADISPOS for blending, MD20734 Bit 3 for scanner bypass, MD20734 Bit 2 for dwell scaling, CYCLE832 _TOL (tolerance) and _TECH (dynamic groups).
AlarmsAlarm 12080 (unrecognized ISO command in G291), Alarm 14800 (transition to cutting with zero feedrate), Alarm 22280 (thread cutting run-in/run-out too short).
VersionsSINUMERIK 840D sl supports G93 inverse-time feedrate and writeable work area limits (MD10604), which are unavailable/read-only on the 802D sl.

Warning: Deactivating work area limits on 802D sl is read-only. Ensure all axes remain within physical constraints before executing continuous-path programs.

Mitsubishi

Mitsubishi implements G08 as a direct modal driver for G-code Group 13, shifting the system state to high-accuracy modal G61.1. It also integrates a multi-part system limit where exceeding two active systems triggers Alarm Y51 0032.

To program, write G08 P1; in an independent block to shift Group 13 to G61.1. Write G08 P0; in a separate block to return the mode to G64.

CategoryDetails
ParametersParameter #2110 (Clamp H-precision) for feed clamp, Parameter #2109 (Rapid H-precision) for rapid limit, Parameter #1148 (Initial hi-precis) for default state, Parameter #8040 (High-SpeedAcc) for system limits.
AlarmsProgram Error P129 (high-accuracy with #8040 set to 0), MCP Alarm Y51 0032 (3+ systems using high-speed/accuracy), Program Error P123 (high-accuracy software disabled), Program Error P29 (G08 P0 during active spline), Program Error P33 (G08 not alone in block).
VersionsM8 Series sequence number N supports 8 digits, while C80 Series is limited to 6 digits. M80V TypeB triggers errors P930, P940, P950 if G08 is combined with multi-axis transformations.

Warning: Attempting to cancel look-ahead via G08 P0 while high-accuracy spline interpolation (G61.2 or G61.3) is active triggers Program Error P29. Cancel spline interpolation first.

Brand Comparison

TopicFanucSiemensMitsubishi
Command SyntaxG08 P1 (ON), G08 P0 (OFF)G64 (Continuous Path), CYCLE832(...), or G291; G08 P1;G08 P1 (ON), G08 P0 (OFF)
Modality and GroupNon-modal (Group 00)Modal (Group 10) / Cycle SettingsModally drives G-code Group 13 (G61.1 / G64)
Multi-System Limits— (no source)Channel-specific machine dataMax 2 systems simultaneously (Parameter #8040)
ISO Scanner Bypass— (no source)Configurable via MD20734 Bit 3 (0 or 1)— (no source)

Technical Analysis

Several distinct behaviors clearly differentiate Siemens Look-Ahead and velocity control from Fanuc and Mitsubishi systems. Siemens does not natively support G08. Instead, it natively manages look-ahead and continuous-path velocity optimization using G64 continuous-path mode G-codes, where buffer calculation and rounding tolerance parameters are defined directly in channel-specific machine data. Furthermore, Siemens features a proprietary bilingual transition architecture via G290 and G291. This allows standard ISO G-code programs containing G08 structures to switch into native Siemens mode (G290) to run highly optimized cycles or parametric transformations in the same file, and then return to the ISO path.

Siemens also differs by managing dynamic dynamic group selection. Using CYCLE832 (High-Speed Settings), look-ahead tolerances and axial filters are dynamically updated in GUD7 variables (e.g., _TOLV and _TOLT) based on the technology selection (DYNROUGH, DYNSEMIFIN, DYNFINISH, and DYNNORM). Fanuc and Mitsubishi, in contrast, rely on static parameter sets configured globally within the controller.

Mitsubishi controls feature a highly integrated, nested Look-Ahead Priority and Recovery system. On Fanuc, activating a higher-tier mode like G05.1 Q1 when G08 is active can trigger syntax alerts or force the operator to write cancel blocks. On Mitsubishi, if G05 P10000 or G05.1 Q1 is commanded while G08 is active, the control automatically transitions into the higher mode. Once that higher mode is canceled, the G08 high-accuracy control state is automatically restored in the G-code stream without requiring an explicit restart block. Additionally, Mitsubishi's G08 directly drives Group 13 modal state (G61.1), whereas Fanuc's G08 remains a Group 00 non-modal toggle.

Program Examples

Fanuc Example

; Fanuc G08 Look-Ahead Example
G90 G17 G40 G49 ; Safety block
G00 X0 Y0 Z50.0 ; Rapid approach
G08 P1 ; Activate Advanced Preview Control
G01 Z-5.0 F1000 ; Feed to depth
X100.0 Y50.0 F1500 ; Cut contour
G08 P0 ; Deactivate Advanced Preview Control
G00 Z100.0 ; Retract axis

Dry run: Execute the program in dry run mode with the tool positioned safely above the workpiece to test coordinate sweeps in the air. Ensure G08 P1 is programmed alone in an independent block with no movement commands. Check that the tool tip safely clears all vise jaws and clamping fixtures before running the actual raw stock.

Siemens Example

; Siemens G08 / CYCLE832 Example
G291 ; Enable ISO Dialect mode
G08 P1 ; Activate look-ahead via ISO command
G01 X150.0 Y75.0 F1200.0 ; Cutting path
G08 P0 ; Deactivate look-ahead
G290 ; Switch to native Siemens mode
CYCLE832(0.01, 1) ; Native high-speed setup (tolerance 0.01, semi-finishing)
G642 ; Axial precision rounding active

Dry run: Verify the coordinate path in the Siemens simulation panel first. When executing on the machine, ensure Dry Run Feedrate (DRY) is deactivated before cutting the workpiece to prevent tool shattering and turret collision. Use Reduced Rapid Traverse (RG0) during first-article dry runs to verify transitions between G291 and G290 modes.

Mitsubishi Example

; Mitsubishi G08 Look-Ahead Example
G90 G17 G40 ; Safety commands
G00 X0 Y0 Z50.0 ; Position safely
G08 P1 ; Enable high-accuracy control (shifts Group 13 to G61.1)
G01 X120.0 Z-45.0 F1200.0 ; Machining profile
G08 P0 ; Disable high-accuracy control (returns Group 13 to G64)
G00 Z100.0 ; Retract tool

Dry run: Position the tool safely in the air and execute a dry run. Ensure that the G08 command block contains no other G-code movements or auxiliary functions. Verify that Parameter #8040 is correctly configured for the active part system to avoid Program Error P129, and check that the tool path clears all clamps.

Error Analysis

Brand & Alarm CodeTrigger ConditionOperator SymptomRoot Cause / Fix
Fanuc Alarm PS0368Modifying Parameter No. 5040 Bit 3 (TCT) while tool offsets are active.Control halts and displays Alarm PS0368.Offsets active during compensation shift type parameter modification. Fix: Cancel tool length compensation/offsets (G49) before changing the parameter.
Siemens Alarm 12080ISO Dialect Mode (G291) encounters an unrecognized G-code while MD20734 Bit 3 is set to 0.Program translation stops and the control displays the alarm.Scanner error checking is active. Fix: Set MD20734 Bit 3 to 1 to bypass scanner errors, or remove unrecognized commands.
Mitsubishi MCP Alarm Y51 0032Attempting to activate high-accuracy/high-speed mode on three or more part systems simultaneously.CNC halts immediately with a hardware-level alarm.System limits exceeded. Fix: Limit simultaneous activation to at most two systems under Parameter #8040.
Siemens Alarm 14800Transition to cutting interpolation with F0 or omitted feedrate, when "Fixed feedrates" is inactive.Program execution halts, cycle start turns red, and the control displays the alarm.Zero feedrate evaluation. Fix: Program a non-zero feedrate F in the first motion block.
Mitsubishi Program Error P33Command G08 P1 or G08 P0 is not programmed in its own independent block.Syntax error halts program execution.G08 combined with motion or M-codes. Fix: Program the G08 command in a separate, isolated block.

Application Note

Activating look-ahead control or modifying parameters like Parameter No. 5040 Bit 3 (TCT) on Fanuc while the tool is engaged in cutting raw stock will trigger an abrupt feedrate drop, leaving deep dwell marks on the contour and creating a ruined scrap part. Operators must transition G08 P1/P0 states only when the tool tip is safely separated from the workpiece. In multi-part setups, trying to activate high-accuracy control on more than two part systems simultaneously under Mitsubishi's Parameter #8040 triggers MCP Alarm Y51 0032, halting all operations. Operators must configure barriers for Chuck and Tailstock (such as G22/G23) to prevent the turret from colliding with the chuck, tailstock, or workholding clamps. Additionally, testing coordinate paths "in the air" via dry run and reduced rapid traverse is essential to verify that the tool tip clears all vise jaws and fixture clamps before actual cutting.

In addition, zero offset suppressions like G53 or SUPA on Siemens must be managed carefully alongside parameter MD10760. If MD10760 is configured to retain tool compensations during coordinate suppressions, the tool may retract along an unexpected path, driving the turret into the workpiece chuck or a fixture clamp. Operators must verify their code in the simulation panel and ensure DRY (Dry Run Feedrate) is deactivated before machining actual stock to prevent severe tool shattering.

Related Command Network

  • G05 P10000: High-speed high-accuracy control II on Fanuc and Mitsubishi, which internally activates advanced preview functions.
  • g05-high-speed-precision-contour-control: A related high-speed machining command that provides advanced path control on Fanuc and Mitsubishi controls.
  • g05-1-ai-contour-control: Activates AI Contour Control Type I for processing complex 3D tool paths.
  • mitsubishi-look-ahead-block-count: Configures the buffer depth for look-ahead processing on Mitsubishi controls.
  • CYCLE832: Siemens high-speed dynamic settings cycle that manages contour tolerances and technology dynamic groups.

Conclusion

Executing G08 advanced preview control requires isolating activation and cancellation G-codes in independent blocks and planning transitions when the cutter is clear of the workpiece. Precise configuration of control parameters, such as Fanuc Parameter 5040 Bit 3 and Mitsubishi Parameter #8040, combined with physical Chuck and Tailstock barrier setups, prevents hard collisions and surface defects. Verifying programs through simulation and first-article dry runs remains the most effective safeguard for CNC machinery and workholding equipment.

Frequently Asked Questions

How does G08 P1 prevent axis vibration during high-speed milling?

G08 P1 activates look-ahead control, which pre-reads motion blocks to calculate optimal velocity and acceleration transitions. This prevents the axes from experiencing sudden decelerations or structural vibrations at sharp corners. Operators should activate G08 P1 in a separate block before beginning a contour cut to ensure smooth motion.

Why does Mitsubishi trigger Alarm Y51 0032 when using G08?

Alarm Y51 0032 is a multi-system hardware-level constraint triggered when more than two part systems simultaneously attempt to run high-accuracy or high-speed machining. To resolve this, operators must inspect Parameter #8040 (High-SpeedAcc) and ensure it is active (1) on a maximum of two part systems, disabling it on secondary channels.

What is the purpose of Siemens MD20734 Bit 3 in ISO Dialect mode?

Parameter MD20734 ($MC_EXTERN_FUNCTION_MASK) Bit 3 controls scanner behavior during G291 ISO Dialect mode. When set to 1, it allows the Siemens interpreter to bypass parser errors when unrecognized legacy codes (such as G08) are scanned, forwarding them to the native translator rather than triggering Alarm 12080. Operators should set this bit to 1 when importing programs from Fanuc controls.

Still not resolved?

Ask our AI assistant about this topic in natural language. Grounded in verified sources, no hallucinations.

Ask AI Assistant
Hakan Gündoğdu
Hakan Gündoğdu
  • CNC CARE Co-Founder (May 2025 - Present)
  • Mitsubishi Electric NC Sales & Service Section Manager (2008 - 2025)
  • Reis CNC Service Engineer (2003 - 2008)
  • Ören Kalıp CNC Mold Line Team Leader (1999 - 2002)

With over 25 years of experience working in all areas of the CNC machine industry, I continue my activities as a co-founder of CNC CARE, where we offer brand-independent consulting, engineering, and original spare parts services.

Related Articles

Other articles on this topic