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
| Property | Value |
|---|---|
| Extensions | .drl, .drd, .xln, .exc, .ncd, .nc |
| Encoding | ASCII |
| Import | ✓ |
| Export | — (see Drill Output) |
| License | Gerber/ODB++ |
| Layers | One layer per tool |
| Command-line name | Excellon |
Import Options
The settings apply where a drill file does not declare its units, zero suppression or number format.
Number Format
| Option | Description | Default |
|---|---|---|
| Units | Inches or Millimeters, for a file that declares neither INCH nor METRIC (or M72/M71) | Inches |
| Format | Integer and decimal digits of a coordinate written without a decimal point. Automatic is 2.4 for inches and 3.3 for millimeters | Automatic |
| Zero suppression | Leading zeros omitted (TZ) or Trailing zeros omitted (LZ) | Leading zeros omitted (TZ) |
| Coordinates | Absolute or Incremental, until the file gives G90, G91 or ICI | Absolute |
| Use these settings even where the file declares its own | Overrides the units, zero suppression and format of the file, for a file whose header is wrong | Off |
Tools
| Option | Description | Default |
|---|---|---|
| Tool table | An Excellon tool table (T01C0.8 lines, optionally with INCH or METRIC) for tools the program selects without defining | None |
What Is Imported
- Layers — each tool becomes a layer named after its number and diameter, such as
T01 0.800mm, followed byPTHorNPTHwhere 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 asboard-NPTH T01 3.200mm NPTH. - Holes — circles of the tool’s diameter.
- Slots and routing —
G85slots and routed paths (G00–G03betweenM15andM16/M17, with arcs given byAorI/J) become round-ended polylines and arcs as wide as the tool. - Canned cycles —
G84canned circles become discs of their diameter.M97/M98canned text is drilled with the current tool in a 5 × 7 dot font, for A–Z, 0–9,+,-and space. - Repeats —
Rrepeats,M25…M01patterns repeated byM02(swapped byM70, mirrored byM80/M90), and origin moves byG93andG92.
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–G35routed circles,G87routed step slots andG41/G42cutter 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;M30ends 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
M47operator 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.
| Key | Values | Description |
|---|---|---|
ExcellonInUnits | inch, mm | Units; default inch |
ExcellonInFormat | auto, N.M | Format, for example 3.3; default auto |
ExcellonInZeroSuppression | leading, trailing | Zero suppression: leading is the header’s TZ, trailing its LZ; default leading |
ExcellonInCoordinates | absolute, incremental | Coordinates; default absolute |
ExcellonInOverrideFile | flag | Use these settings even where the file declares its own |
ExcellonInToolTable | path | Tool table file; empty for none |
linkcad -i board-PTH.drl --input-format Excellon -o board-drill.gds --output-format GDSII \ --ExcellonInUnits mm --ExcellonInFormat 3.3 --quit --no-save-settings