PCBServices
Customize PCB file generation for PCB manufacturing service
Description
Use the PCBServices
object to customize printed circuit
board (PCB) file generation for a PCB manufacturing service.
Creation
Description
creates a Gerber file based on the type of service specified in
w
= PCBServices.servicetype
servicetype
.
Input Arguments
servicetype
— Type of manufacturing service from PCB services list
character vector
Type of manufacturing service from PCB services list, 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
w
— PCB manufacturing service
object
PCB manufacturing service, returned as an object.
Properties
BoardProfileFile
— File type for board profile
'legend'
| 'profile'
File type for board profile, specified as 'legend'
or
'profile'
.
Example: w = PCBServices.SunstoneWriter
;
w.BoardProfileFile = 'profile'
.
Data Types: char
| string
BoardProfileLineWidth
— Width of line
1
| positive scalar
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
CoordPrecision
— Precision of X and Y coordinates written to file
[2 6]
| 1-by-2 vector
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
CoordUnits
— Units of X and Y coordinate
'in'
| 'mm'
Units of X and Y coordinates, specified as inches or millimeters.
Example: w = PCBServices.SunstoneWriter
;
w.CoordUnits = 'mm'
Data Types: char
| string
CreateArchiveFile
— Creates single archive file with all Gerber files
1
(default) | 0
Creates single archive file with all Gerber files, specified as
1
or 0
.
Example: w = PCBServices.SunstoneWriter
;
w.CreateArchiveFile = 0
Data Types: logical
DefaultViaDiameter
— Via drill diameter
3.0000e-04
| positive scalar
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
DrawArcsUsingLines
— Force arcs to be drawn using lines
0
| 1
Force arcs to be drawn using lines, specified as 1
or
0
.
Example: w = PCBServices.SunstoneWriter
;
w.DrawArcsUsingLines = 0
Data Types: logical
ExtensionLevel
— Feature content for Gerber file format
1
(default) | 2
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
Filename
— Name of all files containing Gerber design
'untitled'
(default) | character vector
Name of all files containing Gerber design, specified as a character vector.
Example: w = PCBServices.SunstoneWriter
;
w.Filename = 'antenna_design'
.
Data Types: char
| string
Files
— Define stack of PCB files
character vector
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
IncludeRootFolderInZip
— Include top-level folder in zip archive
1
| 0
Include top-level folder in zip archive, specified as 1
or 0
.
Example: w = PCBServices.SunstoneWriter
;
w.IncludeRootFolderInZip = 0
Data Types: logical
PostWriteFcn
— Function to invoke after a successful write operation
function handle (default)
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
SameExtensionForGerberFiles
— Use .gbr
to be file extension for all Gerber files
0
| 1
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
UseExcellon
— Generate Excellon drill files
1
| 0
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
PCB Using Mayhew Labs 3-D Viewer
Create a coplanar inverted F antenna.
fco = invertedFcoplanar(Height=14e-3,GroundPlaneLength=100e-3,...
GroundPlaneWidth=100e-3);
Use this antenna in creating a PCB stack object.
p = pcbStack(fco); figure show(p)
Use a Mayhew Writer with a profile
board for viewing the PCB in 3D.
s = PCBServices.MayhewWriter;
s.BoardProfileFile = "profile"
s = MayhewWriter with properties: BoardProfileFile: "profile" BoardProfileLineWidth: 1 CoordPrecision: [2 6] CoordUnits: 'in' CreateArchiveFile: 0 DefaultViaDiam: 3.0000e-04 DrawArcsUsingLines: 1 ExtensionLevel: 1 Filename: 'untitled' Files: {} IncludeRootFolderInZip: 0 PostWriteFcn: @(obj)sendTo(obj) SameExtensionForGerberFiles: 0 UseExcellon: 1
Create an antenna design file using PCBWriter
.
PW = PCBWriter(p,s);
Use the gerberWrite
method to create Gerber files from the antenna design files.
gerberWrite(PW)
The location of the folder and the Mayhew labs website opens automatically.
To view the board, drag and drop the files. Click Done.
Version History
Introduced in R2017b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)