The Excellon drill format is a subset of RS274D and is used by the drilling and routing machines made by the Excellon corporation. Because of Excellon's long history and dominance of the PCB drilling business for many years their format is a defacto industry standard.
Almost every PCB layout software can produce this format. However we have noticed that many PCB layout tools do not take full advantage of the header information which makes reading the drill file more difficult than it should be.
At the beginning of the file, the first few lines are typically a header. This contains general information about the job and the data to follow. While in principle the header is optional, one should never write a drill file without a header. Here are the most common header commands along with their function and use by the reading software:
Command |
Explanation |
M48 |
indicates the start of the header. should always be the first line in the header |
INCH,LZ |
this actually has two pieces of information; INCH indicates that coordinates that follow are in inches and LZ indicates that the leading zeros in the coordinate data are included. (This implies that the trailing zeros are suppressed. The reading software needs to know both the units and where to re-insert the decimal point; therefore one must have either leading or trailing zeros or a decimal point in the coordinate data. If the data is in millimeters then the command would be METRIC,LZ. If the trailing zeros are included then the command would be INCH,TZ. |
ICI |
Incremental input of program coordinates. This is very rare nowadays; if not present assume the coordinates are absolute. |
VER,1 |
Use version 1 X and Y axis layout. (As opposed to Version 2) |
FMAT,2 |
Use Format 2 commands; alternative would be FMAT,1 |
T01C0.020 |
Defines tool 01 as having a diameter of 0.020 inch. For each tool used in the data the diameter should be defined here. There are additional parameters but if you are a PCB designer it is not up to you to specify feed rates and such. |
M95 |
End of the header. Data that follows will be drill and/or route commands. |
R# |
This command drills a series of equally spaced holes from the previously specified hole. The number following the R specifies the number of repeats. An X and/or Y coordinate must be used to define the spacing between hole centers. |
M97 |
It is possible to drill a series of holes that spell out words or numbers. The M97 and M98 commands allow you to program the CNC-7 to write a message on the board. This feature can be used to identify a company or product, supply a part number etc.. |
% | Rewind. This is often used instead of M95. It stops the machine and tells it to wait for a command to continue. |
There are a large number of other possible header commands but they are almost all related to the control the machine and have no effect on the actual layout data that one is trying to extract from the drill file in the software world.
Over the years there has been some evolution of the Excellon file format and you will find knocking about files that use FMAT 1 commands and files that use FMAT 2 commands. The table below defines the command syntax for each.
FMAT 1 |
FMAT 2 |
Explanation |
G81 |
G05 |
turn on drill mode. |
M02 |
M00 |
End of Program |
M24 |
M01 |
End of Pattern |
M26 |
M02 |
Repeat Pattern Offset (this is followed by a #X#Y to indicate the number of repeats in X and Y |
M01 |
M06 |
Optional Stop |
M27 |
M08 |
End of Step and Repeat |
M00 |
M09 |
Stop for Inspection |
M26X#Y#M21 |
M02X#Y#M80 |
|
M26#Y#M22 |
M02X#Y#M90 |
|
R#M26 |
R#M22 |
|