MyHaas Welcome,
!
Haas Tooling Guest Order History MyHaas/HaasConnect Sign In Register Haas Tooling My Account Order History Return History MyHaas/HaasConnect Sign Out Welcome, My Machines Latest Activity My Quotes My Account My Users Sign Out
0
Find Your Distributor
  1. Select Language
    1. English
    2. Deutsch
    3. Español - España
    4. Español - México
    5. Français
    6. Italiano
    7. Português
    8. Český
    9. Dansk
    10. Nederlands
    11. Magyar
    12. Polski
    13. Svenska
    14. Türkçe
    15. 中文
    16. Suomi
    17. Norsk
    18. الإنجليزية
    19. български
    20. Hrvatski
    21. Ελληνικά
    22. Română
    23. Slovenský
    24. Slovenščina
    25. 한국어
    26. 日本語
    27. Українська
  • machines Main Menu
    • Haas Vertical Mills Vertical Mills
      Vertical Mills
      Vertical Mills View All
      • Vertical Mills
      • VF Series
      • Universal Machines
      • VR Series
      • VP-5 Prismatic
      • Pallet-Changing VMCs
      • Mini Mills
      • Mold Machines
      • High-Speed Drill Centers
      • Drill/Tap/ Mill Series
      • Toolroom Mills
      • Compact Mills
      • Gantry Series
      • SR Sheet Routers
      • Extra-Large VMC
      • Double-Column Mills
      • Control Simulator
      • Mill Automatic Parts Loader
      • VMC/UMC Side-Loading Automatic Parts Loader
      • Compact Automatic Parts Loader
    • Product Image Multi-Axis Solutions
      Multi-Axis Solutions
      Multi-Axis Solutions View All
      • Multi-Axis Solutions
      • Y-Axis Lathes
      • 5-Axis Mills
    • Haas Lathes Lathes
      Lathes
      Lathes View All
      • Lathes
      • ST Series
      • Dual-Spindle
      • Box Way Series
      • Toolroom Lathes
      • Chucker Lathe
      • Haas Bar Feeder V2
      • Lathe Automatic Parts Loader
    • Haas Horizontal Mills Horizontal Mills
      Horizontal Mills
      Horizontal Mills View All
      • Horizontal Mills
      • 50-Taper
      • 40-Taper
    • Haas Rotaries & Indexers Rotaries & Indexers
      Rotaries & Indexers
      Rotaries & Indexers View All
      • Rotaries & Indexers
      • Rotary Tables
      • Indexers
      • 5-Axis Rotaries
      • Extra-Large Rotaries
    • Special Series
      Special Series
      Special Series View All
      • Special Series
      • EU_Series_Redirect
    • Product Image Automation Systems
      Automation Systems
      Automation Systems View All
      • Automation Systems
      • Mill Automation
      • Lathe Automation
      • Automation Models
    • Haas Drill Centers Desktop Machines
      Desktop Machines
      Desktop Machines View All
      • Desktop Machines
      • Desktop Mill
      • Desktop Lathe
    • Haas Shop Equipment Shop Equipment
      Shop Equipment
      Shop Equipment View All
      • Shop Equipment
      • Bandsaw
      • Knee Mill
      • Surface Grinder, 2550
      • Surface Grinder, 3063
      • Laser Cutting Machine
    • QUICK LINKS Special Series  Special Series 
      EU SERIES EU SERIES BUILD & PRICE | PRICE LIST BUILD & PRICE | PRICE LIST In-Stock Machines In-Stock Machines WHAT’S NEW WHAT’S NEW YOUR FIRST CNC YOUR FIRST CNC
      SHOPPING TOOLS
      • Build & Price a Haas
      • Price List
      • Available Inventory
      • CNCA Financing
      WANT TO TALK TO SOMEONE?

      A Haas Factory Outlet (HFO) can answer your questions, and walk you through your best options.

      CONTACT YOUR DISTRIBUTOR >
  • Options Main Menu
    • Product Image Spindles
      Spindles
      Spindles View All
      • Spindles
    • Product Image Tool Changers
      Tool Changers
      Tool Changers View All
      • Tool Changers
    • Product Image 4th- | 5th-Axis
      4th- | 5th-Axis
      4th- | 5th-Axis View All
      • 4th- | 5th-Axis
    • Product Image Turrets & Live Tooling
      Turrets & Live Tooling
      Turrets & Live Tooling View All
      • Turrets & Live Tooling
    • Product Image Probing
      Probing
      Probing View All
      • Probing
    • Haas Chip & Coolant Management Chip & Coolant Management
      Chip & Coolant Management
      Chip & Coolant Management View All
      • Chip & Coolant Management
    • The Haas Control The Haas Control
      The Haas Control
      The Haas Control View All
      • The Haas Control
    • Product Image Product Options
      Product Options
      Product Options View All
      • Product Options
    • Product Image Tooling & Fixturing
      Tooling & Fixturing
      Tooling & Fixturing View All
      • Tooling & Fixturing
    • Product Image Workholding
      Workholding
      Workholding View All
      • Workholding
    • Product Image 5-Axis Solutions
      5-Axis Solutions
      5-Axis Solutions View All
      • 5-Axis Solutions
      • 5 Easy Steps to 5-Axis
    • QUICK LINKS Special Series  Special Series 
      EU SERIES EU SERIES BUILD & PRICE | PRICE LIST BUILD & PRICE | PRICE LIST In-Stock Machines In-Stock Machines WHAT’S NEW WHAT’S NEW YOUR FIRST CNC YOUR FIRST CNC
      SHOPPING TOOLS
      • Build & Price a Haas
      • Price List
      • Available Inventory
      • CNCA Financing
      WANT TO TALK TO SOMEONE?

      A Haas Factory Outlet (HFO) can answer your questions, and walk you through your best options.

      CONTACT YOUR DISTRIBUTOR >
  • Why Haas Main Menu
      Discover the Haas Difference
    • Why Haas
    • MyHaas
    • Education Community
    • Industry 4.0
    • Haas Certification
    • Customer Testimonials
  • Service Main Menu
      Welcome to Haas Service
      SERVICE HOME Operator’s Manuals How-To Procedures Troubleshooting Guides Preventive Maintenance Haas Parts Haas Tooling Videos
  • Videos Main Menu
  • Main Menu
    • View All
    • View All
      • Fiber Laser
    • View All
    • View All
      • HTEC Curriculum Support
    • View All
      • Haas 10 kg Cobot Package
      • Cobot Kits
    • View All
    • View All
      • 4 - AUTOMATION SYSTEMS
      • Mill Toolholding
      • Carousel-V2
    • View All
    • View All
    • View All
      • VF-4SS
    • View All
    • QUICK LINKS Special Series  Special Series 
      EU SERIES EU SERIES BUILD & PRICE | PRICE LIST BUILD & PRICE | PRICE LIST In-Stock Machines In-Stock Machines WHAT’S NEW WHAT’S NEW YOUR FIRST CNC YOUR FIRST CNC
      SHOPPING TOOLS
      • Build & Price a Haas
      • Price List
      • Available Inventory
      • CNCA Financing
      WANT TO TALK TO SOMEONE?

      A Haas Factory Outlet (HFO) can answer your questions, and walk you through your best options.

      CONTACT YOUR DISTRIBUTOR >
  • Haas Tooling Main Menu
      Automation Accessories Shop Support Mill Toolholding Mill Cutting Tools Boring Systems Mill Workholding Lathe Toolholding Lathe Cutting Tools Lathe Workholding Package Kits ER Collets & Chucks Holemaking Threading Broaching Tombstones & Kits Manual Chucks For Milling Deburring & Abrasives Tool Presetter & Heat Shrinkers Storage & Handling Machine Maintenance Tooling Accessories Apparel & Accessories Measuring & Inspection Winner's Circle Winner's Circle Clearance Today's Hot Deals
    • Haas Tooling
    • Winner's Circle
      Winner's Circle Shop All
      • WINNERS_CIRCLE-1Y
    • Winner's Circle
      Winner's Circle Shop All
      • WC-1Y-EU
    • Today’s Hot Deals
      Today’s Hot Deals Shop All
      • Mill Toolholding
      • Mill Tooling
      • Measuring & Inspection
      • Boring Systems
      • Mill Workholding
      • Shell Mill Kits
      • Lathe Toolholding
      • Lathe Tooling
      • Lathe Workholding
      • ER Collets & Chucks
      • Holemaking
      • Threading
      • Broaching
      • Tool Storage
      • Apparel & Accessories
    • Clearance
      Clearance Shop All
    • Measuring & Inspection
      Measuring & Inspection Shop All
      • Probe Kits & Accessories
      • Edge & Center Finders
      • Comparative Measuring Gauges
      • Height Gauges
      • Calipers
      • Threaded Plug & Ring Gauges
      • Gauge Blocks
      • Pin Gauges
      • Drop Indicators
      • Dial Test Indicators
      • Bore Gauges
      • Indicator Accessories
      • V Blocks
      • Setup Blocks
      • Depth Measuring
      • Micrometers
      • Micrometer Accessories
      • Micrometer Kits
      • Bore Gauge Kits
      • Starter Kits
      • Indicator Kits
      • Caliper Kits
      • Toolholder Check Station
      • Height Setters
      • Coordinate Measuring Machines
    • Automation Accessories
      Automation Accessories Shop All
      • Cobot Kits
      • Cobot Kits
      • Protective Barriers
      • Grippers
      • Robot Cell Accessories
    • Shop Support
      Shop Support Shop All
      • Air Compressors
      • Laser Marking Machines
      • Bandsaw Blades
      • Bandsaw Accessories
      • Surface Grinding Wheels
      • Shop Equipment Accessories
    • Mill Toolholding
      Mill Toolholding Shop All
      • End Mill Holders
      • Shell Mill Holders
      • Shrink Fit Holders
      • ER Collet Chucks
      • Milling Chucks & Collets
      • NC Drilling Chucks
      • Pull Studs / Retention Knobs
      • Rotary Tool Holder & Tool Chuck Kits
      • Hydraulic Milling Chucks & Collets
      • Toolholder Attachments & Wrenches
      • Mill Broaching Holders
    • Mill Tooling
      Mill Tooling Shop All
      • Shell Mill Bodies
      • Milling Inserts
      • End Mills
      • Chamfer Mills & Inserts
      • Indexable End Mill Bodies
      • Ball End Mills
      • Chamfer End Mills
      • Roughing End Mills
      • Indexable Ball End Mills & Inserts
      • Shell Mill Kits
      • Chamfer Mill Kits
      • Indexable End Mill Kits
      • Dovetail Cutters
      • Indexable Dovetail Cutters
      • Engraving End Mills
      • Rotary Burrs / Die Grinding Bits
      • Keyseat Cutters
      • Corner Rounding End Mills
      • Slot Mill Bodies
      • CNC Router Bits For Wood
    • Boring Systems
      Boring Systems Shop All
      • Boring Heads & Cartridges
      • Boring Holders & Extensions
    • Mill Workholding
      Mill Workholding Shop All
      • Fixed-Jaw Vises
      • Self-Centering Vises
      • Adapter Plates
      • Vise Jaws
      • Vise Mounts & Fixtures
      • Vise Kits
      • Vise Parallels
      • Rotary Vise Kits
      • Fixture Clamps & Rails
      • Automated Workholding Kits
      • Tooling Fixture Subplates
      • Toolmakers' Vises
      • Clamp Force Gauges
      • Collet Fixtures
      • Angle Plates
    • Lathe Toolholding
      Lathe Toolholding Shop All
      • TL & CL Static Turning Holders
      • BOT Static Turning Holders
      • BMT Static Turning Holders
      • Live / Driven Turning Holders
      • Turning Holder Reduction Sleeves / Bushings
      • VDI Static Turning Holders
      • Turning Holder Accessories
    • Lathe Tooling
      Lathe Tooling Shop All
      • Cut-Off Tool Blocks & Blades
      • Cut-Off Tooling Kits
      • Turning Inserts
      • Grooving & Cut-Off Tools
      • Internal (ID) Grooving & Threading Tools
      • Threading Inserts
      • Threading Tools
      • Boring Bars / Internal (ID) Turning Tools
      • External (OD) Turning Tools
      • Cermet Turning Inserts
      • CBN Turning Inserts
      • Haas Notch Grooving & Threading Inserts
      • Haas Notch Grooving & Threading Tools
      • Micro Turning Tools
      • Desktop Lathe Tools
    • Lathe Workholding
      Lathe Workholding Shop All
      • Live Centers
      • Spindle Reduction Sleeves / Liners
      • Quick-Change Collets
      • Quick-Change Collet Chucks
      • 5C Collets
      • 5C Collet Sets
      • Lathe Jaw Boring Rings
      • Lathe Jaws
      • Bar Pullers
      • Scroll Chucks
      • Guide Pins
      • Collet Accessories
    • Package Kits
      Package Kits Shop All
      • Chip Clearing Fan Kits
      • Cutting Tool Kits
      • Indexable End Mill Kits
      • Cut-Off Tool Block & Blade Kits
      • Drill & Tap Kits
      • Indexable Drilling Kits
      • Shell Mill Kits
      • Chamfer Mill Kits
      • Rotary Tool Holder & Tool Chuck Kits
      • Lathe Starter Kits
      • Workholding Kits
      • Rotary Vise Kits
      • Vise Kits
      • 3-Jaw Chuck Kits for Mills
      • Tombstone Kits
      • Reduction Sleeve Kits
      • Automated Workholding Kits
      • Measuring & Inspection Kits
      • Starter Kits
      • Bore Gauge Kits
      • Caliper Kits
      • Indicator Kits
      • Micrometer Kits
    • ER Collets & Chucks
      ER Collets & Chucks Shop All
      • ER Straight-Bore Collets
      • ER Sealed Collets
      • ER Tap Collets
      • ER Collet Sets & Accessories
      • ER Collet Chucks
      • Straight Shank ER Collet Chucks
      • Straight Shank Keyless NC Drilling Chucks
    • Holemaking
      Holemaking Shop All
      • Carbide Drills
      • Indexable Drill Bodies
      • Indexable Drill Inserts
      • Modular Drill Bodies
      • Modular Drill Heads
      • Cobalt Drills & Sets
      • Center Drills
      • Reamers
      • Indexable Drilling Kits
      • Spot Drills
      • Spade Drill Bodies
      • Spade Drill Inserts
      • Countersinks
    • Threading
      Threading Shop All
      • Taps
      • Threading Inserts
      • Threading Tools
      • Thread Mills
      • Pipe Taps
      • Drill Tap Kits
    • Broaching
      Broaching Shop All
      • Broaching Tools
      • Broaching Inserts
    • Tombstones
      Tombstones Shop All
      • Tombstones
      • Tombstone Kits
      • Vise Cluster Towers
    • Manual Chucks For Milling
      Manual Chucks For Milling Shop All
      • 3-Jaw Chucks & Mounts for Mills
    • Deburring & Abrasives
      Deburring & Abrasives Shop All
      • Abrasive Pads
      • Deburr Tools
      • Deburr Wheels
      • Abrasive Sheets & Rolls
      • Sharpening / Lapping Stones
    • Tool Presetter & Heat Shrinkers
      Tool Presetter & Heat Shrinkers Shop All
      • Tool Presetting Machines
      • Shrink Fit Machines
    • Tool Storage
      Tool Storage Shop All
      • Tool Carts
      • Tool Tray
      • Tool Bags
    • Machine Maintenance
      Machine Maintenance Shop All
      • Spindle Test Bars
      • Levels
      • Refractometers
      • Machine Additives & Supplies
      • Machine Accessories
      • Machine Maintenance Kits
    • Tooling Accessories
      Tooling Accessories Shop All
      • Spindle & Toolholder Taper Cleaners
      • Haas Shop Lift
      • Toolholder Fixtures
      • CNC Chip Clearing Fans
      • Hammers & Mallets
      • Anti-Fatigue Mats
      • Layout Tools
      • Wrenches
      • Magnetic Tools
      • Torque Screwdrivers
      • Hand Cutting Tools
      • Shop Stools
      • Lifting Magnets
      • Safety Apparel
      • Cutting Tool Sharpeners
    • Apparel & Accessories
      Apparel & Accessories Shop All
      • Accessories
      • Apparel
    • HAAS TOOLING QUICK LINKS
      NEW PRODUCTS NEW PRODUCTS NEW PRODUCTS NEW PRODUCTS
      MOST POPULAR MOST POPULAR
      TOOLING PROMOS TOOLING PROMOS
      FINANCING & OPEN TERMS FINANCING & OPEN TERMS PAY BY INVOICE PAY BY INVOICE
      FAQs FAQs
      KITS CREATED FOR YOU KITS CREATED FOR YOU
  • Haas Service Parts Main Menu
      Automatic Pallet Changer Lathe Turret Tool Changer Chip Management Coolant Counterbalance Electrical Cabinet Enclosure Hydraulics Lubrication Maintenance Pendant Probing Rotary Spindle Tailstock
    • Haas Service Parts
    • Automatic Pallet Changer
      Automatic Pallet Changer Shop All
      • HMC - Automatic Pallet Changer
      • VMC - Automatic Pallet Changer
    • Lathe Turret
      Lathe Turret Shop All
      • Lathe - Turret
      • Live Tooling
    • Tool Changer
      Tool Changer Shop All
      • Side Mount
      • Umbrella
    • Chip Management
      Chip Management Shop All
      • Multi Auger
      • Single Auger
    • Coolant
      Coolant Shop All
      • Auxiliary Filter
      • HPC-300 (Lathe)
      • HPC-1000 (Lathe)
      • Oil Skimmer
      • Standard Coolant
      • TSC-300 (Mill)
      • TSC-1000 (Mill)
      • Coolant Refill
      • Loc-Line
    • Counterbalance
      Counterbalance Shop All
      • Charge & Discharge Hose
    • Electrical Cabinet
      Electrical Cabinet Shop All
      • Fans
      • Filters
      • Upgrade Kits
    • Enclosure
      Enclosure Shop All
      • Accessories
      • Air Nozzle
      • Decals
      • Door Bumpers
      • Lighting
      • Windows, Gaskets, & Weather Strip
      • Chip & Coolant Management
    • Hydraulics
      Hydraulics Shop All
      • Filters
      • Gauges
      • Heat Exchanger
      • Hoses
    • Lubrication
      Lubrication Shop All
      • Bijur Mechanical Lubrication
      • Minimum Lubrication
    • Maintenance
      Maintenance Shop All
      • Grease, Oil, & Sealants
    • Pendant
      Pendant Shop All
      • Floppy Disk & USB
      • Keypad
      • Keys
      • Lens
      • Gaskets & Seals
    • Probing
      Probing Shop All
      • Mill Probing
      • Lathe Tool Presetter
    • Rotary
      Rotary Shop All
      • Rotary Gaskets & Seals
    • Spindles
      Spindles Shop All
      • Couplings
      • Gaskets & Seals
      • Spindle Motor Drive
      • Gearbox Drive
      • Tool Release Piston
    • Tailstock
      Tailstock Shop All
      • Handles
×

Search Results

Web Pages

Images

    • <
    • 1
    • >
Use the up and down arrows to select a result. Press enter to go to the selected search result. Touch device users can use touch and swipe gestures.
MyHaas Welcome,
!
Haas Tooling Guest Order History MyHaas/HaasConnect Sign In Register Haas Tooling My Account Order History Return History MyHaas/HaasConnect Sign Out Welcome, My Machines Latest Activity My Quotes My Account My Users Sign Out
0
Find Your Distributor
  1. Select Language
    1. English
    2. Deutsch
    3. Español - España
    4. Español - México
    5. Français
    6. Italiano
    7. Português
    8. Český
    9. Dansk
    10. Nederlands
    11. Magyar
    12. Polski
    13. Svenska
    14. Türkçe
    15. 中文
    16. Suomi
    17. Norsk
    18. الإنجليزية
    19. български
    20. Hrvatski
    21. Ελληνικά
    22. Română
    23. Slovenský
    24. Slovenščina
    25. 한국어
    26. 日本語
    27. Українська
×

Search Results

Web Pages

Images

    • <
    • 1
    • >

12 - Mill - Programming

Mill Operator's Manual


  • 0 - Mill - Table of Contents
  • 1 - Mill - Introduction
  • 2 - Mill - Legal Information
  • 3 - Mill - Safety
  • 4 - Mill - Control Pendant
  • 5 - Mill - Control Display
  • 6 - Mill - Device Manager
  • 7 - Mill - TouchScreen Feature
  • 8 - Mill - Part Setup
  • 9 - Mill - Umbrella Tool Changer
  • 10 - Mill - SMTC
  • 11 - Mill - Operation
  • 12 - Mill - Programming
  • 13 - Mill - Macros
  • 14 - Mill - Control Icons
  • 15 - Mill - Remote Jog Handle
  • 16 - Mill - Options Programming
  • 17 - Mill - G-Codes
  • 18 - Mill - M-Codes
  • 19 - Mill - Settings
  • 20 - Mill - Other Equipment

Go To :

  • 12.1 Basic Programming
  • 12.2 Absolute / Incremental Positioning
  • 12.3 Tool / Work Offsets Calls
  • 12.4 SubPrograms

12.1 Basic Programming

Basic Programming

A typical CNC program has (3) parts:

1) Preparation: This portion of the program selects the work and tool offsets, selects the cutting tool, turns on the coolant, sets spindle speed, and selects absolute or incremental positioning for axis motion.

2) Cutting: This portion of the program defines the tool path and feed rate for the cutting operation.

3) Completion: This portion of the program moves the spindle out of the way, turns off the spindle, turns off the coolant, and moves the table to a position from where the part can be unloaded and inspected.

This is a basic program that makes a 0.100" (2.54 mm) deep cut with Tool 1 in a piece of material along a straight line path from X = 0.0, Y = 0.0 to X = - 4.0, Y = - 4.0.

NOTE: A program block can contain more than one G-code, as long as those G-codes are from different groups. You cannot place two G-codes from the same group in a program block. Also note that only one M-code per block is allowed.

%
O40001 (Basic program) ;
(G54 X0 Y0 is top right corner of part) ;
(Z0 is on top of the part) ;
(T1 is a 1/2" end mill) ;
(BEGIN PREPARATION BLOCKS) ;
T1 M06 (Select tool 1) ;
G00 G90 G17 G40 G49 G54 (Safe startup) ;
X0 Y0 (Rapid to 1st position) ;
S1000 M03 (Spindle on CW) ;
G43 H01 Z0.1 (Tool offset 1 on) ;
M08 (Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G01 F20. Z-0.1 (Feed to cutting depth) ;
X-4. Y-4. (linear motion) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z0.1 M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
G53 Y0 (Y home) ;
M30 (End program) ;
%

Preparation

These are the preparation code blocks in the sample program O40001:

Preparation Code Block Description
% Denotes the beginning of a program written in a text editor.
O40001 (Basic program) ; O40001 is the name of the program. Program naming convention follows the Onnnnn format: The letter “O”, or “o” is followed by a 5-digit number.
(G54 X0 Y0 is top right corner of part) ; Comment
(Z0 is on top of the part) ; Comment
(T1 is a 1/2" end mill) ; Comment
(BEGIN PREPARATION BLOCKS) ; Comment
T1 M06 (Select tool 1) ; Selects tool T1 to be used. M06 commands the tool changer to load Tool 1 (T1) into the spindle.
G00 G90 G17 G40 G49 G54 (Safe startup) ;

This is referred to as a safe startup line. It is good machining practice to place this block of code after every tool change. G00 defines axis movement following it to be completed in Rapid Motion mode. 

G90 defines axis movements that will be completed in absolute mode (refer to Absolute vs. Incremental Positioning (G90, G91) for more information).

G17 defines the cutting plane as the XY plane. G40 cancels Cutter Compensation. G49 cancels tool length compensation. G54 defines the coordinate system to be centered on the Work Offset stored in G54 on the Offset display.

X0 Y0 (Rapid to 1st position) ; X0 Y0 commands the table to move to the position X = 0.0 and Y = 0.0 in the G54 coordinate system.
S1000 M03 (Spindle on CW) ;

M03 turns the spindle on in a clockwise direction. It takes the address code Snnnn, where nnnn is the desired spindle RPM. 

On machines with a gearbox, the control automatically selects high gear or low gear, based on the commanded spindle speed. You can use an M41 or M42 to override this. Refer to page M41 Low Gear Override / M42 High Gear Override for more information on these M-codes.

On machines with a gearbox, the control automatically selects high gear or low gear, based on the commanded spindle speed. You can use an M41 or M42 to override this. Refer to M41 / M42 Low / High Gear Override for more information on these M-codes.

G43 H01 Z0.1 (Tool offset 1 on) ; G43 H01 turns on Tool Length Compensation +. The H01 specifies to use the length stored for Tool 1 in the Tool Offset display. Z0.1 commands the Z Axis to Z=0.1. 
M08 (Coolant on) ; M08commands the coolant to turn on.

Cutting

These are the cutting code blocks in the sample program O40001:

Cutting Code Block Description
G01 F20. Z-0.1 (Feed to cutting depth) ; G01 F20. defines axis movements after it to be completed in a straight line. G01 requires the address code Fnnn.nnnn. The address code F20. specifies that the feed rate for the motion is 20" (508 mm) / min. Z-0.1 commands the Z Axis to Z = - 0.1.
X-4. Y-4. (linear motion) ; X-4. Y-4. commands the X Axis to move to X = - 4.0 and commands the Y Axis to move to Y = - 4.0.

Completion

Completion Code Block Description
G00 Z0.1 M09 (Rapid retract, Coolant off) ; G00 commands the axis motion to be completed in rapid motion mode. Z0.1 Commands the Z Axis to Z = 0.1. M09 commands the coolant to turn off.
G53 G49 Z0 M05 (Z home, Spindle off) ; G53 defines axis movements after it to be with respect to the machine coordinate system. G49 cancels tool length compensation. Z0 is a command to move to Z = 0.0. M05 turns the spindle off.
G53 Y0 (Y home) ; G53 defines axis movements after it to be with respect to the machine coordinate system. Y0 is a command to move to Y = 0.0.
M30 (End program) ; M30 ends the program and moves the cursor on the control to the top of the program.
% Denotes the end of a program written in a text editor.

12.2 Absolute / Incremental Positioning

Absolute vs. Incremental Positioning (G90, G91)

Absolute (G90) and incremental positioning (G91) define how the control interprets axis motion commands.

When you command axis motion after a G90 code, the axes move to that position relative to the origin of the coordinate system currently in use.

When you command axis motion after a G91, the axes move to that position relative to the current position.

Absolute programming is useful in most situations. Incremental programming is more efficient for repetitive, equally spaced cuts.

Figure Figure 1 shows a part with 5 equally spaced Ø0.25" (13 mm) diameter holes. The hole depth is 1.00" (25.4 mm) and the spacing is 1.250" (31.75 mm) apart.

Figure 1 shows a part with 5 equally spaced Ø0.25" (13 mm) diameter holes. The hole depth is 1.00" (25.4 mm) and the spacing is 1.250" (31.75 mm) apart.

Absolute / Incremental Sample Program. G54 X0. Y0. for Incremental [1], G54 for Absolute [2]

Below are two example programs that drill the holes as shown in the drawing, with a comparison between absolute and incremental positioning.

We start the holes with a center drill, and finish drilling the holes with a 0.250" (6.35 mm) drill bit. We use a 0.200" (5.08 mm) depth of cut for the center drill and 1.00" (25.4 mm) depth of cut for the 0.250" drill. G81, Drill Canned Cycle, is used to drill the holes.

Mill Incremental Positioning Example

%
O40002 (Incremental ex-prog) ;
N1 (G54 X0 Y0 is center left of part) ;
N2 (Z0 is on top of the part) ;
N3 (T1 is a center drill) ;
N4 (T2 is a drill) ;
N5 (T1 PREPARATION BLOCKS) ;
N6 T1 M06 (Select tool 1) ;
N7 G00 G90 G40 G49 G54 (Safe startup) ;
N8 X0 Y0 (Rapid to 1st position) ;
N9 S1000 M03 (Spindle on CW) ;
N10 G43 H01 Z0.1(Tool offset 1 on) ;
N11 M08(Coolant on) ;
N12 (T1 CUTTING BLOCKS) ;
N13 G99 G91 G81 F8.15 X1.25 Z-0.3 L5 ;
N14 (Begin G81, 5 times) ;
N15 G80 (Cancel G81) ;
N16 (T1 COMPLETION BLOCKS) ;
N17 G00 G90 G53 Z0. M09 (rapid retract, clnt off);
N18 M01 (Optional stop) ;
N19 (T2 PREPARATION BLOCKS) ;
N20 T2 M06 (Select tool 2) ;
N21 G00 G90 G40 G49 (Safe startup) ;
N22 G54 X0 Y0 (Rapid to 1st position) ;
N23 S1000 M03 (Spindle on CW) ;
N24 G43 H02 Z0.1(Tool offset 2 on) ;
N25 M08(Coolant on) ;
N26 (T2 CUTTING BLOCKS) ;
N27 G99 G91 G81 F21.4 X1.25 Z-1.1 L5 ;
N28 G80 (Cancel G81) ;
N29 (T2 COMPLETION BLOCKS) ;
N30 G00 Z0.1 M09 (Rapid retract, clnt off) ;
N31 G53 G90 G49 Z0 M05 (Z home, spindle off) ;
N32 G53 Y0 (Y home) ;
N33 M30 (End program) ;
%

Mill Absolute Positioning Example

The absolute program method needs more lines of code than the incremental program. The programs have similar preparation and completion sections.

Look at line N13 in the incremental programming example, where the center drill operation begins. G81 uses the loop address code, Lnn, to specify the number of times to repeat the cycle. The address code L5 repeats this process (5) times. Each time the canned cycle repeats, it moves the distance that the optional X and Y values specify. In this program, the incremental program moves 1.25" in X from the current position with each loop, and then does the drill cycle.

For each drill operation, the program specifies a drill depth 0.1" deeper than the actual depth, because motion starts from 0.1" above the part.

In absolute positioning, G81 specifies the drill depth, but it does not use the loop address code. Instead, the program gives the position of each hole on a separate line. Until G80 cancels the canned cycle, the control does the drill cycle at each position.

The absolute positioning program specifies the exact hole depth, because the depth starts at the part surface (Z=0).

1

%
O40003 (Absolute ex-prog) ;
N1 (G54 X0 Y0 is center left of part) ;
N2 (Z0 is on top of the part) ;
N3 (T1 is a center drill) ;
N4 (T2 is a drill) ;
N5 (T1 PREPARATION BLOCKS) ;
N6 T1 M06 (Select tool 1) ;
N7 G00 G90 G40 G49 G54 (Safe startup) ;
N8 X1.25 Y0 (Rapid to 1st position) ;
N9 S1000 M03 (Spindle on CW) ;
N10 G43 H01 Z0.1 (Tool offset 1 on) ;
N11 M08 (Coolant on) ;
N12 (T1 CUTTING BLOCKS) ;
N13 G99 G81 F8.15 X1.25 Z-0.2 ;
N14 (Begin G81, 1st hole) ;
N15 X2.5 (2nd hole) ;
N16 X3.75 (3rd hole) ;
N17 X5. (4th hole) ;
N18 X6.25 (5th hole) ;
N19 G80 (Cancel G81) ;
N20 (T1 COMPLETION BLOCK) ;
N21 G00 G90 G53 Z0. M09 (Rapid retract, clnt off);
N22 M01 (Optional Stop) ;
N23 (T2 PREPARATION BLOCKS) ;
N24 T2 M06 (Select tool 2) ;
N25 G00 G90 G40 G49 (Safe startup) ;
N26 G54 X1.25 Y0 (Rapid to 1st position) ;
N27 S1000 M03 (Spindle on CW) ;
N28 G43 H02 Z0.1 (Tool offset 2 on) ;
N29 M08 (Coolant on) ;
N30 (T2 CUTTING BLOCKS) ;
N31 G99 G81 F21.4 X1.25 Z-1. (1st hole) ;
N32 X2.5 (2nd hole) ;
N33 X3.75 (3rd hole) ;
N34 X5. (4th hole) ;
N35 X6.25 (5th hole) ;
N36 G80 (Cancel G81) ;
N37 (T2 COMPLETION BLOCKS) ;
N38 G00 Z0.1 M09 (Rapid retract, Clnt off) ;
N39 G53 G49 Z0 M05 (Z home, Spindle off) ;
N40 G53 Y0 (Y home) ;
N41 M30 (End program) ;
%

12.3 Tool / Work Offsets Calls

G43 Tool Offset

The G43 Hnn Tool Length Compensation command should be used after every tool change. It adjusts the Z-Axis position to account for the length of the tool. The Hnn argument specifies which tool length to use. For more information see Setting Tool Offsets on the Operation section.

CAUTION: The tool length nn value should match the nn value from the M06 Tnn tool change command to avoid a possible collision.

Setting 15 - H & T Code Agreement controls whether the nn value needs to match in the Tnn and Hnn arguments. If Setting 15 is ON and the Tnnand Hnn do not match, Alarm 332 - H and T Not Matched is generated.

G54 Work Offsets

Work Offsets define where a work piece is located on the table.

Work Offsets available are G54-G59, G110-G129, and G154 P1-P99. G110-G129 and G154 P1-P20 refer to the same Work Offsets.

A useful feature is to set up multiple work pieces on the table and machining multiple parts in one machine cycle. This is accomplished by assigning each work piece to a different Work Offset.

For more information, reference the G-code section of this manual. Below is an example of machining multiple parts in one cycle. The program uses M97 Local Sub-Program Call in the cutting operation.

%
O40005 (Work offsets ex-prog) ;
(G54 X0 Y0 is center left of part) ;
(Z0 is on top of the part) ;
(T1 is a drill) ;
(BEGIN PREPARATION BLOCKS) ;
T1 M06 (Select tool 1) ;
G00 G90 G40 G49 G54(Safe startup) ;
X0 Y0 ;
(Move to first work coordinate position-G54) ;
S1000 M03 (Spindle on CW) ;
G43 H01 Z0.1 (Tool offset 1 on) ;
M08 (Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
M97 P1000 (Call local Subprogram) ;
G00 Z3. (Rapid retract) ;
G90 G110 G17 G40 G80 X0. Y0. ;
(Move to second work coordinate position-G110) ;
M97 P1000 (Call local Subprogram) ;
G00 Z3. (Rapid Retract) ;
G90 G154 P22 G17 G40 G80 X0. Y0. ;
(Move to third work coordinate position-G154 P22) ;
M97 P1000 (Call local Subprogram) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z0.1 M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
G53 Y0 (Y home) ;
M30 (End program) ;
N1000 (Local subprogram) ;
G81 F41.6 X1. Y2. Z-1.25 R0.1 (Begin G81) ;
(1st hole) ;
X2. Y2. (2nd hole) ;
G80 (Cancel G81) ;
M99 ;
%

12.4 Subprograms

Subprograms

Subprograms:

  • Are usually a series of commands that are repeated several times in a program.
  • Are written in a separate program, instead of repeating the commands many times in the main program.
  • Are called in the main program with an M97 or M98 and a P code.
  • Can include an L for repeat count. The subprogram call repeats L times before the main program continues with the next block.

When you use M97:

  • The P code (nnnnn) is the same as the block number (Nnnnnn) of the local subprogram.
  • The subprogram must be within the main program

When you use M98:

  • The P code (nnnnn) is the same as the program number (Onnnnn) of the subprogram.
  • If the subprogram is not in memory, the file name must be Onnnnn.nc. The file name must contain the O, leading zeros and .nc for the machine to find the subprogram.
  • The subprogram must reside in the active directory, or in a location specified in Settings 251/252. Refer to page 5 for more information on subprogram search locations.

Canned Cycles are the most common use of subprograms. For example, you might put the X and Y locations of a series of holes in a separate program. Then you can call that program as a subprogram with a canned cycle. Instead of writing the locations once for each tool, you write the locations only once for any number of tools.

Setting Up Search Locations

When program calls a subprogram, the control first looks for the subprogram in the active directory. If the control cannot find the subprogram, the control uses Settings 251 and 252 to determine where to look next. Refer to those settings for more information.

To build a list of search locations in Setting 252:

  1. In the Device Manager (LIST PROGRAM), select the directory that you want to add to the list.
  2. Press F3.
  3. Highlight the SETTING 252 option in the menu, and then press ENTER.

    The control adds the current directory to the list of search locations in Setting 252.

Result: 

To see the list of search locations, look at the values of Setting 252 on the Settings page.

Local Subprogram (M97)

A local subprogram is a block of code in the main program that is referenced several times by the main program. Local subprograms are commanded (called) using an M97 and Pnnnnn, which refers to the N line number of the local subprogram.

The local subprogram format is to end the main program with an M30 then enter the local subprograms after the M30. Each subprogram must have an N line number at the start and a M99 at the end that will send the program back to the next line in the main program.

%
O40009 (Local subprogram ex-prog) ;
(G54 X0 Y0 is at the top left corner of part) ;
(Z0 is on top of the part) ;
(T1 is a spot drill) ;
(T2 is a drill) ;
(T3 is a tap) ;
(BEGIN PREPARATION BLOCKS) ;
T1 M06 (Select tool 1) ;
G00 G90 G40 G49 G54(Safe startup) ;
X1.5 Y-0.5 (Rapid to 1st position) ;
S1406 M03 (Spindle on CW) ;
G43 H01 Z1.(Tool offset 1 on) ;
M08(Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G81 G99 Z-0.26 R0.1 F7. (Begin G81) ;
M97 P1000 (Call local subprogram) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z0.1 M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
M01 (Optional stop) ;
(BEGIN PREPARATION BLOCKS) ;
T2 M06 (Select tool 2) ;
G00 G90 G40 G49 (Safe startup) ;
G54 X1.5 Y-0.5 (Rapid back to 1st position) ;
S2082 M03 (Spindle on CW) ;
G43 H02 Z1. (Tool offset 2 on) ;
M08(Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G83 G99 Z-0.75 Q0.2 R0.1 F12.5 (Begin G83) ;
M97 P1000 (Call local subprogram) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z0.1 M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
M01 (Optional stop) ;
(BEGIN PREPARATION BLOCKS) ;
T3 M06 (Select tool 3) ;
G00 G90 G40 G49 (Safe startup) ;
G54 X1.5 Y-0.5 ;
(Rapid back to 1st position) ;
S750 M03 (Spindle on CW) ;
G43 H03 Z1.(Tool offset 3 on) ;
M08(Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G84 G99 Z-0.6 R0.1 F37.5 (Begin G84) ;
M97 P1000 (Call local subprogram) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z0.1 M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
G53 Y0 (Y home) ;
M30 (End program) ;
(LOCAL subprogram) ;
N1000 (Begin local subprogram) ;
X0.5 Y-0.75 (2nd position) ;
Y-2.25 (3rd position) ;
G98 X1.5 Y-2.5 (4th position) ;
(Initial point return) ;
G99 X3.5 (5th position) ;
(R-plane return) ;
X4.5 Y-2.25 (6th position) ;
Y-0.75 (7th position) ;
X3.5 Y-0.5 (8th position) ;
M99 ;
%

External Subprogram (M98)

An external subprogram is a separate program that the main program references. Use M98 to command (call) an external subprogram, with Pnnnnn to refer to the program number you want to call.

When your program calls an M98 subprogram, the control looks for the subprogram in the main program’s directory. If the control cannot find the subprogram in the main program’s directory, it then looks in the location specified in Setting 251. Refer to page5 for more information. An alarm occurs if the control cannot find the subprogram.

In this example, the subprogram (program O40008) specifies (8) positions. It also includes a G98 command at the move between positions 4 and 5. This causes the Z Axis to return to the initial starting point instead of the R plane, so the tool passes over the workholding.

The main program (Program O40007) specifies (3) different canned cycles:

  1. G81 Spot drill at each position
  2. G83 Peck drill at each position
  3. G84 Tap at each position

Each canned cycle calls the subprogram and does the operation at each position.

%
O40007 (External subprogram ex-prog) ;
(G54 X0 Y0 is center left of part) ;
(Z0 is on top of the part) ;
(T1 is a spot drill) ;
(T2 is a drill) ;
(T3 is a tap) ;
(BEGIN PREPARATION BLOCKS) ;
T1 M06 (Select tool 1) ;
G00 G90 G40 G49 G54 (Safe startup) ;
G00 G54 X1.5 Y-0.5 (Rapid to 1st position) ;
S1000 M03 (Spindle on CW) ;
G43 H01 Z1. (Tool offset 1 on) ;
M08 (Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G81 G99 Z-0.14 R0.1 F7. (Begin G81) ;
M98 P40008 (Call external subprogram) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z1. M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
M01 (Optional stop) ;
(BEGIN PREPARATION BLOCKS) ;
T2 M06 (Select tool 2) ;
G00 G90 G40 G49 G54 (Safe startup) ;
G00 G54 X1.5 Y-0.5 (Rapid to 1st position) ;
S2082 M03 (Spindle on CW) ;
G43 H02 Z1. (Tool offset 1 on) ;
M08 (Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G83 G99 Z-0.75 Q0.2 R0.1 F12.5 (Begin G83) ;
M98 P40008 (Call external subprogram) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z1. M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
M01 (Optional stop) ;
(BEGIN PREPARATION BLOCKS) ;
T3 M06 (Select tool 3) ;
G00 G90 G40 G49 G54 (Safe startup) ;
G00 G54 X1.5 Y-0.5 (Rapid to 1st position) ;
S750 M03 (Spindle on CW) ;
G43 H03 Z1. (Tool offset 3 on) ;
M08 (Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G84 G99 Z-0.6 R0.1 F37.5 (Begin G84) ;
M98 P40008 (Call external subprogram);
(BEGIN COMPLETION BLOCKS) ;
G00 Z1. M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
G53 Y0 (Y home) ;
M30 (End program) ;
%

Subprogram
%
O40008 (Subprogram) ;
X0.5 Y-0.75 (2nd position) ;
Y-2.25 (3rd position) ;
G98 X1.5 Y-2.5 (4th position) ;
(Initial point return) ;
G99 X3.5 (5th position) ;
(R plane return) ;
X4.5 Y-2.25 (6th position);
Y-0.75 (7th position) ;
X3.5 Y-0.5 (8th position) ;
M99 (sub program return or loop) ;
%

Feedback

Recently Viewed Items

You Have No Recently Viewed Items Yet

Feedback
Haas Logo

美元价格不包括关税、报关费用、保险费、增值税及运费。
USD prices DO NOT include customs duty, customs fees, insurance, VAT, or freight.

人民币价格包含关税、报关费用、货运保险和增值税, 但不包括运费。
CNY prices include customs duty, customs fees, insurance, and VAT. DOES NOT include freight.

Haas Delivered Price

This price includes shipping cost, export and import duties, insurance, and any other expenses incurred during shipping to a location in France agreed with you as a buyer. No other mandatory costs can be added to the delivery of a Haas CNC Product.

KEEP UP WITH THE LATEST HAAS TIPS AND TECHNOLOGY...

Sign up now!   

HAAS TOOLING ACCEPTS THE FOLLOWING:

  • Service & Support
  • Owners
  • Request Service
  • Operator Manuals
  • Haas Parts
  • Rotary Repair Request
  • Pre-Install Guides
  • Shopping Tools
  • Build & Price a New Haas
  • Available Inventory
  • The Haas Price List
  • CNCA Financing
  • About Haas
  • DNSH Statement
  • Careers
  • Certifications & Safety
  • Contact Us
  • History
  • Terms & Conditions
  • Haas Tooling Terms & Conditions
  • Privacy
  • Warranty
  • Haas Community
  • Haas Certification Program
  • Haas Motorsports
  • Gene Haas Foundation
  • Haas Technical Education Community
  • Events
  • Join the Conversation
  • Facebook
  • X
  • Flickr
  • YouTube
  • LinkedIn
  • Instagram
  • TikTok
© 2025 Haas Automation, Inc – CNC Machine Tools

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

2800 Sturgis Rd., Oxnard, CA 93030
Toll Free: (888) 817-4446 / Fax: 805-278-8554