1. Blog>
  2. What does D-code Mean in Gerber?

What does D-code Mean in Gerber?

by: Jun 29,2023 551 Views 0 Comments Posted in Help Center

D-code Gerber

Gerber files are a universally accepted data format in the PCB industry, serving as an intermediate medium for designing and manufacturing PCBs. They primarily consist of coordinates and D-codes: coordinates control the length of the graphics, while D-codes control the size and shape of the graphics. Other photoplotting instructions are used to control the drawing of lines or solder pads. During the development of Gerber, two formats emerged: RS-274-D and RS-274-X. The RS-274-D format separates the coordinate file and the D-code file, while the RS-274-X format integrates the D-code file and the coordinate file into a single file, including additional parameters to enhance features such as polygon filling, positive/negative image combinations, custom D-codes, and other functionalities. It also defines the rules for embedding aperture tables in GERBER data files.

Commonly Used D-codes and Their Functions

D codes are instructions for the photoplotter. The first three D codes control the movement of the working table in the X-Y direction.

D01 (D1): Opens the shutter and simultaneously moves the working table to the corresponding X-Y coordinates.

D02 (D2): Closes the shutter and simultaneously moves the working table to the corresponding X-Y coordinates.

D03 (D3): Moves the working table to the specified X-Y position while the shutter remains closed. Then, it quickly opens and closes the shutter, creating an exposure point.

D01 is the command for "drawing" a line, while D02 is the command for moving the table without exposing any film. D01 and D02 correspond to moving the pen down and up on the plotter, respectively.

D03 is the flash command. With the shutter closed, the working table is moved. When the desired X-Y coordinates are reached, the shutter is opened and closed to leave the image of the aperture on the film. The flash command is an effective method for imaging thousands of pads present on most circuit boards.

D01, D02 and D03 commands follow their coordinate data. For example, in the following command sequence:




The table position is moved to 0,0 with the shutter closed. Then, a line is drawn between 0,0 and 450,330 using the D01 command. The flash will occur at 455,300.

Aperture mark, D-code and D10-D999

Unlike D01, D02, and D03, D10 to D999 are data rather than commands, and they are marked on the apertures or aperture wheel. Early photoplotters used aperture wheels with 24 holes/slots, which represented line thickness and shapes used for flashing or drawing.

The following table shows the correspondence between optical apertures and D-codes in early photoplotters:

It can be observed that the sequence of D10 to D19 is normal, followed by D70 and D71, with D20 appearing in the 13th position. The range extends from D20 to D29. By D30, the aperture should be 23, and before D30, D72 and D73 are inserted. Most optical plotting and CAM software require you to input aperture information (shape and size) based on the D-code. Several software programs require input based on the aperture number (in which case, the corresponding table needs to be rearranged accordingly).

There is a special D-code between 3 and 9. It is used to represent special line segments, such as dashed lines. It is rarely used nowadays and is only supported by some outdated photoplotters.

Without the D-code, copper, solder pads, or holes would lack shape and size, as shown in the diagram below:

The outdated Gerber RS-274-D standard format for layout data requires a separate D code list. This list contains information about the geometric shapes (commonly circles, rectangles and annuli) and aperture sizes.

We recommend using the extended Gerber format (RS-274-X) where the D code list is stored in the header of each record. This facilitates automated processing and prevents loss of information during data transfer.

Join us
Wanna be a dedicated PCBWay writer? We definately look forward to having you with us.
  • Comments(0)
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
0 / 10000
    Back to top