Main Content

PCBServices

Customize PCB file generation for PCB manufacturing service

Since R2021b

Description

Use the PCBServices object to customize printed circuit board (PCB) file generation for a PCB manufacturing service.

Creation

Description

w = PCBServices.serviceType creates a Gerber file based on the type of service specified in serviceType.

example

Input Arguments

expand all

Type of service from PCB services package, specified as one of the following:

  • AdvancedCircuitsWriter – Configure Gerber file generation for Advanced Circuits manufacturing.

  • CircuitPeopleWriter – Configure Gerber file generation for CircuitPeople online viewer.

  • DirtyPCBsWriter – Configure Gerber file generation for Dirty PCBs manufacturing.

  • EuroCircuitsWriter – Configure Gerber file generation for EuroCircuits online viewer.

  • GerberLookWriter – Configure Gerber file generation for GerbLook online viewer.

  • GerberViewerWriter – Configure Gerber file generation for GerberViewer online viewer.

  • MayhewWriter – Configure Gerber file generation for Mayhew Labs online 3-D viewer.

  • OSHParkWriter – Configure Gerber file generation for OSH Park PCB manufacturing.

  • PCBWayWriter – Configure Gerber file generation for PCBWay PCB manufacturing.

  • ParagonWriter – Configure Gerber file generation for Paragon Robotics online viewer.

  • SeeedWriter – Configure Gerber file generation for Seeed Fusion PCB manufacturing.

  • SunstoneWriter – Configure Gerber file generation for Sunstone PCB manufacturing.

  • ZofzWriter – Configure Gerber file generation for Zofz 3-D viewer.

Example: w = PCBServices.SunstoneWriter creates Gerber files configured to use Sunstone PCB manufacturing service.

Output Arguments

expand all

PCB manufacturing service, returned as an object.

Properties

expand all

File type for board profile, specified as 'legend' or 'profile'.

Example: w = PCBServices.SunstoneWriter; w.BoardProfileFile = 'profile'.

Data Types: char | string

Width of line, specified as a positive scalar in mils.

PCB manufacturers vary on board profile. The most common line width is zero of a fraction width in the chosen unit, for example, 0.1 mil.

Example: w = PCBServices.SunstoneWriter; w.BoardProfileLineWidth = 0.1

Data Types: double

Precision of X and Y coordinates written to file, specified as a 1-by2 vector [I F], where,

  • I – Number of digits in the integer part, 0<=I<=6.

  • F – Number of digits in the fractional part, 4<=F<=6.

Example: w = PCBServices.SunstoneWriter; w.CoordPrecision = [1 3]

Data Types: double

Units of X and Y coordinates, specified as inches or millimeters.

Example: w = PCBServices.SunstoneWriter; w.CoordUnits = 'mm'

Data Types: char | string

Creates single archive file with all Gerber files, specified as 1 or 0.

Example: w = PCBServices.SunstoneWriter; w.CreateArchiveFile = 0

Data Types: logical

Via drill diameter, specified as a positive scalar in meters. PCB manufacturers also call it minimum drilling hole diameter.

Example: w = PCBServices.SunstoneWriter; w.DefaultViaDiameter = 0.1

Data Types: double

Force arcs to be drawn using lines, specified as 1 or 0.

Example: w = PCBServices.SunstoneWriter; w.DrawArcsUsingLines = 0

Data Types: logical

Feature content for Gerber file format, specified as:

  • 1 - Extension 1 is the most compatible setting for downstream PCB manufacturing tools.

  • 2 - Extension 2 adds file attributes %TF.<attr>*%" to the header and footer of Gerber files.

Example: w = PCBServices.SunstoneWriter; w.ExtensionLevel = 2

Data Types: double

Name of all files containing Gerber design, specified as a character vector.

Example: w = PCBServices.SunstoneWriter; w.Filename = 'pcb_design'.

Data Types: char | string

Define stack of PCB files, specified as a character vector. This definition includes:

  • Multiples files describing one PCB.

  • A "file" as a memory object containing buffers that describe or hold the file content before the file is written.

  • Cell vector of Gerber.FileFunction objects, one per file.

Data Types: cell | char | string

Include top-level folder in zip archive, specified as 1 or 0.

Example: w = PCBServices.SunstoneWriter; w.IncludeRootFolderInZip = 0

Data Types: logical

Function to invoke after a successful write operation, specified as a function handle. In this case, it is the sendTo function. This property makes sure that the location of the Gerber files and the website of the manufacturing service is open after a successful write function.

Example: w = PCBServices.SunstoneWriter; w.PostWriteFcn = @(obj)sendTo(obj)

Data Types: function_handle

Use .gbr to be file extension for all Gerber files, specified as 0 or 1.

Example: w = PCBServices.SunstoneWriter; w.SameExtensionForGerberFiles = 1

Data Types: logical

Generate Excellon drill files, specified as 0 or 1.

Example: w = PCBServices.SunstoneWriter; w.UseExcellon = 1, generates Gerber format drill files with 'x2' extension.

Data Types: logical

Examples

collapse all

Create a PCB component with default values.

 p = pcbComponent;

Use 2 Cinch SMA connectors and the Mayhew Labs PCB viewer.

 W = PCBServices.MayhewWriter;
 C1 = PCBConnectors.SMA_Cinch;
 C2 = PCBConnectors.SMA_Cinch;

Generate the Gerber-format files.

[A,g] = gerberWrite(p,W,{C1,C2})
A = 
  PCBWriter with properties:

                        Design: [1x1 struct]
                        Writer: [1x1 PCBServices.MayhewWriter]
                     Connector: {[1x1 PCBConnectors.SMA_Cinch]  [1x1 PCBConnectors.SMA_Cinch]}
           UseDefaultConnector: 0
    ComponentBoundaryLineWidth: 8
         ComponentNameFontSize: []
            DesignInfoFontSize: []
                          Font: 'Arial'
                     PCBMargin: 5.0000e-04
                    Soldermask: 'both'
                   Solderpaste: 1

   See info for details
g = 
'/tmp/Bdoc24b_2725827_2091970/tpda353a1d/rfpcb-ex06685827/untitled'

Version History

Introduced in R2021b