Skip to content

Excellon

Excellon is the NC drill format that comes with the Gerber files of a printed circuit board. LinkCAD imports Excellon drill and route programs, so the holes, slots and routed outlines of a board can be converted together with its copper layers. To write drill files, see Drill Output.

Format Summary

PropertyValue
Extensions.drl, .drd, .xln, .exc, .ncd, .nc
EncodingASCII
Import✓
Export— (see Drill Output)
LicenseGerber/ODB++
LayersOne layer per tool
Command-line nameExcellon

Import Options

The settings apply where a drill file does not declare its units, zero suppression or number format.

Number Format

OptionDescriptionDefault
UnitsInches or Millimeters, for a file that declares neither INCH nor METRIC (or M72/M71)Inches
FormatInteger and decimal digits of a coordinate written without a decimal point. Automatic is 2.4 for inches and 3.3 for millimetersAutomatic
Zero suppressionLeading zeros omitted (TZ) or Trailing zeros omitted (LZ)Leading zeros omitted (TZ)
CoordinatesAbsolute or Incremental, until the file gives G90, G91 or ICIAbsolute
Use these settings even where the file declares its ownOverrides the units, zero suppression and format of the file, for a file whose header is wrongOff

Tools

OptionDescriptionDefault
Tool tableAn Excellon tool table (T01C0.8 lines, optionally with INCH or METRIC) for tools the program selects without definingNone

What Is Imported

  • Layers — each tool becomes a layer named after its number and diameter, such as T01 0.800mm, followed by PTH or NPTH where the file says whether the tool’s holes are plated. When several files are read together, the layer names start with the file name, such as board-NPTH T01 3.200mm NPTH.
  • Holes — circles of the tool’s diameter.
  • Slots and routing — G85 slots and routed paths (G00–G03 between M15 and M16/M17, with arcs given by A or I/J) become round-ended polylines and arcs as wide as the tool.
  • Canned cycles — G84 canned circles become discs of their diameter. M97/M98 canned text is drilled with the current tool in a 5 × 7 dot font, for A–Z, 0–9, +, - and space.
  • Repeats — R repeats, M25…M01 patterns repeated by M02 (swapped by M70, mirrored by M80/M90), and origin moves by G93 and G92.

Header and Comments

LinkCAD reads the header (M48 to % or M95) with INCH/METRIC, LZ/TZ, a digit template such as METRIC,TZ,000.000, FMAT, ICI and VER, and also reads files without a header. The number format is also taken from the ;FILE_FORMAT=2:5 comment written by Altium and others and from KiCad’s ;FORMAT={3:3/ ...} comment. Plating is taken from ;TYPE=PLATED and ;TYPE=NON_PLATED, from KiCad’s file and aperture attributes, and from Allegro’s ;T1 Holesize ... PLATED MILS comments, which also give the tool sizes of a file that defines none. Tools may be defined in the body of the program, and T0102 selects tool 1 with tool offset 2.

Drill Files in a Gerber Batch

The Gerber RS-274X import reads a file whose first lines are an Excellon program as a drill file, with the options above. The drill files of a board therefore need no separate conversion: select them together with the Gerber files.

Technical Notes

  • Codes the reader does not support, such as G32–G35 routed circles, G87 routed step slots and G41/G42 cutter compensation, are reported in the import log with their count and first line, and skipped. A block with an unsupported G code draws nothing, but its coordinates still move the tool.
  • Repeats add at most 1,000,000 holes and cuts to a program; a repeat beyond that is reported and skipped. Coordinates more than 1000 km from the origin are reported and skipped.
  • M00 (machine stop) does not end reading; M30 ends the program.
  • An undefined tool, a tool of size zero, holes before any tool is selected, a file with no declared number format and an M47 operator message are reported in the import log.

Common Workflows

Excellon → GDSII or DXF

Combine the drill holes of a board with its copper layers for a mask, a stencil or a mechanical drawing.

CLI / Command-File Options

These option keys can be used on the command line or in command files.

KeyValuesDescription
ExcellonInUnitsinch, mmUnits; default inch
ExcellonInFormatauto, N.MFormat, for example 3.3; default auto
ExcellonInZeroSuppressionleading, trailingZero suppression: leading is the header’s TZ, trailing its LZ; default leading
ExcellonInCoordinatesabsolute, incrementalCoordinates; default absolute
ExcellonInOverrideFileflagUse these settings even where the file declares its own
ExcellonInToolTablepathTool table file; empty for none
Terminal window
linkcad -i board-PTH.drl --input-format Excellon -o board-drill.gds --output-format GDSII \
--ExcellonInUnits mm --ExcellonInFormat 3.3 --quit --no-save-settings