The orientation (see description in ADD) may be any angle in the range R0...R359.9. The S and M flags can't be used here. Note that the coordinates are always defined at an orientation of R0. The possibility of entering an orientation in the RECT command is mainly for use in scripts, where the rectangle data may have been derived through a User Language Program from the UL_RECTANGLE object. When entering a non-zero orientation interactively, the corners of the rectangle may not appear at the actual cursor position. Use the ROTATE command to interactively rotate a rectangle.
In EAGLE it is possible to reverse previous actions with the UNDO command. These actions can be executed again by the REDO command. UNDO and REDO operate with a command memory which exists back to the last EDIT, OPEN or REMOVE command.
UNDO/REDO is completely integrated within Forward&Back Annotation.
REMOVE
See also OPEN,
RENAME,
MODULE
REMOVE name.Sxx
REMOVE name.mod
REMOVE name.Mxx
Symbols and packages can be erased from a library only if not used by a device.
REMOVE in a library clears the UNDO buffer.
REMOVE .S3deletes sheet number 3 from the presently loaded schematic.
If you delete the currently loaded sheet, sheet number 1 will be loaded after the command has been executed. All sheets with a higher number than the one deleted will get a number reduced by one.
REMOVE name.mod REMOVE name.m3
In the library editor the RENAME command is used to change the name of a symbol, device or package in the currently opened library. In the schematic editor modules of the current schematic can be renamed this way.
The names may include extensions (for example RENAME name1.pac name2[.pac] - note that the extension is optional in the second parameter). If the first parameter is given without extension in the library editor, you have to be in the respective mode to rename an object (i.e. editing a package if you want to rename packages). Supported extensions are '.pac', 'sym', '.dev' and '.mod' for packages, symbols, devices and modules.
RENAME clears the UNDO buffer.
REPLACE
See also SET,
UPDATE
REPLACE device_name[@library_name] ..
REPLACE part_name device_name[@library_name] ..
REPLACE package_name ..
REPLACE element_name package_name ..
The REPLACE command can be used to replace a part with a different device (even from a different library). The old and new device must be compatible, which means that their used gates and connected pins/pads must match, either by their names or their coordinates.
Without parameters the REPLACE command opens a dialog from which a device can be selected from all libraries that are currently in use. After such a device has been selected, subsequent mouse clicks on parts will replace those parts' devices with the selected one if possible.
If a device_name is given, that device will be used for the replace operation.
With both a part_name and a device_name, the device of the given part will be replaced (this is useful when working with scripts).
If a library_name is given and it contains blanks, the whole device_name@library_name needs to be enclosed in single quotes.
If only a board is being edited (without a schematic), or if elements in the board are being replaced that have no matching part in the schematic, the REPLACE command has two different modes that are chosen by the SET command.
The first mode (default) is activated by the command:
SET REPLACE_SAME NAMES;In this mode the new package must have the same pad and smd names as the old one. It may be taken from a different library and it may contain additional pads and smds. The position of pads and smds is irrelevant.
The second mode is activated by the command
SET REPLACE_SAME COORDS;In this mode, pads and smds of the new package must be placed at the same coordinates as in the old one (relative to the origin). Pad and smd names may be different. The new package may be taken from a different library and may contain additional pads and smds.
Pads of the old package connected with signals must be present in the new package. If this condition is true the new package may have less pads than the old one.
REPLACE functions only when the appropriate tOrigins/bOrigins layer is displayed.
If there is already a package with the same name (from the same library) in the drawing, and the library has been modified after the original object was added, an automatic library update will be started and you will be asked whether objects in the drawing shall be replaced with their new versions.
Note: A REPLACE operation automatically updates all involved library objects
as necessary. This means that other parts (on other schematic sheets or in
other locations on the board) may be changed, too.
You should always run a Design Rule Check (DRC) and an
Electrical Rule Check (ERC) after a REPLACE operation!
RIPUP
See also DELETE,
GROUP,
POLYGON,
RATSNEST
Changes the display of polygons to "outlines".
RIPUP [ @ ] [ ! ] ..
RIPUP [ @ ] [ ! ] signal_name..
The RIPUP command changes routed wires (tracks) into airwires. That can be done for:
RIPUP signal_name..rips up the complete signal "signal_name" (several signals may be listed, e.g. RIPUP D0 D1 D2;).
RIPUP ..rips up segments selected by the mouse click up to the next pad/smd.
RIPUP;removes only signals which are connected to elements (e.g. board crop marks are not affected). The same applies if RIPUP is used on a group.
Note: in all cases the RIPUP command only acts on objects that are in layers that are currently visible!
| * | matches any number of any characters | |
| ? | matches exactly one character | |
| [...] | matches any of the characters between the brackets |
If any of these characters shall be matched exactly as such, it has to be enclosed in brackets. For example, abc[*]ghi would match abc*ghi and not abcdefghi.
A range of characters can be given as [a-z], which results in any character in the range 'a'...'z'.
The ROTATE command is used to change the orientation of objects.
If orientation (see description in ADD) is given, that value will be added to the orientation of the selected object instead.
Prepending orientation with the character '=' causes the value not to be added, but instead to be set absolutely.
Parts, pads, smds and pins can also be selected by their name, which is especially useful if the object is outside the currently shown window area. For example
ROTATE =MR90 IC1
would set the orientation of element IC1 to MR90, regardless of its previous setting.
Attributes of parts can be selected by entering the concatenation of part name and attribute name, as in R5>VALUE.
The quotes around name are necessary to distinguish it from an orientation parameter as in
ROTATE R45 'R1'They can be left away if the context is clear.
You can use Click&Drag to rotate an object by any angle. Just click on the object and move the mouse (with the mouse button held down) away from the object. After having moved the mouse a short distance, the object will start rotating. Move the mouse until the desired angle has been reached and then release the mouse button. If, at some point, you decide to rather not rotate the object, you can press the ESCape key while still holding the mouse button pressed. The same operation can be applied to a group by using the right mouse button. The group will be rotated around the point where the right mouse button has been pressed down.
Parts cannot be rotated if they are locked, or if any of their connected pads would extend outside the allowed area (in case you are using a limited edition of EAGLE).
Elements can only be rotated if the appropriate tOrigins/bOrigins layer is visible.
If you want to have text that is printed "upside down", you can set the "Spin"
flag for that text.
ROUTE
See also AUTO,
UNDO,
WIRE,
MITER,
SIGNAL,
SET,
RATSNEST
ROUTE name ..
The ROUTE command activates the manual router which allows you to convert airwires (unrouted connections) into real wires.
The first point selects an unrouted connection (a wire in the Unrouted layer) and replaces one end of it by a wire (track). The end which is closer to the mouse cursor will be taken. Now the wire can be moved around (see also WIRE). The right mouse button will change the wire bend and the center mouse button will change the layer. Please note that only those signal layers (1 through 16) are available that have been entered into the layer setup in the Design Rules.
When the final position of the wire is reached, a further click of the left mouse button will place the wire and a new wire segment will be attached to the cursor. If the Shift key is held down in such a situation, a Via will be generated at that point if this is possible and the airwire hasn't already been completely routed. The generated Via will have either the appropriate length or, if such a length can't be determined, will go from layer 1 through 16.
When the layer has been changed and a via-hole is thus necessary, it will be added automatically as the wire is placed. When the complete connection has been routed a 'beep' will be given and the next unrouted connection can be selected for routing.
Only the minimum necessary vias will be set (according to the layer setup in the Design Rules). It may happen that an already existing via of the same signal is extended accordingly, or that existing vias are combined to form a longer via if that's necessary to allow the desired layer change. If a via is placed at the start or end point, and there is an SMD pad at that location, the via will be a micro via if the current routing layer is one layer away from the SMD's layer (this applies only if micro vias have been enabled in the Design Rules).
While the ROUTE command is active the wire width can be entered from the keyboard.
If the curve or @radius parameter is given, an arc can be drawn as part of the track (see the detailed description in the WIRE command).
If the Ctrl key is pressed while selecting the starting point and there is no airwire at that point, a new airwire will be created automatically. The starting point of that airwire will be that point on the selected wire or via that is closest to the mouse cursor (possibly snapped to the nearest grid point). The far end of the airwire will dynamically point to a target segment that is different from the selected one. If the selected signal is already completely routed, the far end will point to the starting point instead. If the selected wire is an arc, the airwire will start at the closest end point of the wire.
If a name is given, the airwire of that signal that is closest to the mouse cursor is selected. If name could be interpreted as a with, curve or @radius it has to be written in single quotes.
When routing an airwire that starts at an already routed wire, the new wire's width is automatically adjusted to that of the existing wire if the Shift key is pressed when selecting the airwire.
SET SNAP_LENGTH distance;where "distance" is the snap radius in the current grid unit.
Wire bend style 8 routes only the shorter side of the selected airwire, while 9 routes both sides. Once the automatic routing process is complete (which may take a while, so be patient), the airwire will be replaced by the actual routed wires and vias. If the routing couldn't be completed (for instance due to Design Rules restrictions), the cursor changes into a "forbidden" sign. With bend style 9 it is possible that only one side of the airwire can be routed, while the other side can't.
Whenever the mouse is moved, any previous result is discarded and a new calculation is started. Once the result is acceptable, just click the left mouse button to place it.
The Follow-me router works by marking the grid point at the current mouse position as a starting point, and uses the Autorouter to find a path from that point to any point along the signal segment at which the selected airwire ends (which is not necessarily the exact end point of the airwire). The starting point also considers the currently selected layer, so don't be surprised if the router places a via at that point. By changing the current layer you can influence the routing result.
The routing grid is taken from the actual grid setting at the time the airwire is selected.
The routing parameters (like cost factors, preferred directions etc.) are those defined in the dialog of the AUTO command.
The following particularities apply:
The following particularities apply:
The RUN command starts the User Language Program from the file file_name.
The optional argument list is available to the ULP through the
Builtin Variables argc and argv.
Started from a context menu the according object is assigned to a group. It can be identified with the builtin function ingroup() for further processing. In case of a wire the group bits are set according to it's selection state (first, second or both endpoints). This allows to find which endpoint has been selected.
The SCRIPT command is used to execute sequences of commands that are stored in a script file. If SCRIPT is typed in at the keyboard and "file_name" has no extension, the program automatically uses ".scr".
| SCRIPT nofill | executes nofill.scr | |
| SCRIPT myscr. | executes myscr (no Suffix) | |
| SCRIPT myscr.old | executes myscr.old |
Please refer to the EXPORT command for different possibilities of script files.
If the SCRIPT command is selected with the mouse, a popup menu will show all of the files which have the extension ".scr" so that they can be selected and executed.
The SCRIPT command provides the ability to customize the program according to your own wishes. For instance:
EDITOR:
where EDITOR is one of SCH, BRD, LBR, DEV, PAC and SYM. This ensures that only the appropriate section is executed in the editor. For example, when a new board is opened, only the section starting with BRD: is executed (until the next label if any). This also offers the possibility for editor specific menus using the MENU command. The label must be at the line beginning.
A dialog in which all the parameters can be set appears if the SET command is entered without parameters.
| Snap function | SET SNAP_LENGTH number; | |
| This sets the limiting value for the snap function in the ROUTE command (using the current unit). | ||
| Default: 20 mil | ||
| If tracks are being laid with the ROUTE command to pads that are not on the grid, the snap function will ensure that a route will be laid to the pad within the snap-length. | ||
| SET CATCH_FACTOR value; | ||
| Defines the distance from the cursor up to which objects are taken into account when clicking with the mouse. The value is entered relative to the height (or width, whichever is smaller) of the presently visible part of the drawing. It applies to a zoom level that displays at least a range of 4 inch and inrceases logarithmically when zooming further in.
Values < 1 are interpreted as factor, values ≥ 1 as percents. Default: 0.05 (5%). | ||
| SET SELECT_FACTOR value; | ||
| This setting controls the distance from the cursor within which nearby objects will be suggested for selection. The value is entered relative to the height (or width, whichever is smaller) of the presently visible part of the drawing.
Values < 1 are interpreted as factor, values ≥ 1 as percents. Default: 0.02 (2%). | ||
| Menu contents | SET USED_LAYERS name | number; | |
| Specifies the layers which will be shown in the associated EAGLE menus. See the example file mylayers.scr. | ||
| The layers Pads, Vias, Unrouted, Dimension, Drills and Holes will in any case remain in the menu, as will the schematic layers. Any used signal layers also remain in the menus. SET Used_Layers All activates all layers. | ||
| SET WIDTH_MENU value..; | ||
| SET DIAMETER_MENU value..; | ||
| SET DRILL_MENU value..; | ||
| SET SMD_MENU value..; | ||
| SET SIZE_MENU value..; | ||
| SET ISOLATE_MENU value..; | ||
| SET SPACING_MENU value..; | ||
| SET MITER_MENU value..; | ||
| The content of the associated popup menus can be configured with the above command for the parameters width etc.. A maximum of 16 values is possible for each menu (16 value-pairs in the SMD menu). Without any values (as in SET WIDTH_MENU;) the program default values will be restored. | ||
| Example: Grid Inch; Set Width_Menu 0.1 0.2 0.3; | ||
| Context menus | SET CONTEXT objecttype text commands; | |
| For selectable object types context menus (right mouse button) can be extended by arbitrary entries. objecttype is not case sensitive. text is the menu text, commands is the command sequence, that is executed after click on the menu entry. Empty spaces are possible if the expression is set into apostrophs. apostrophs inside have to be doubled (see TEXT). Example: | ||
| SET CONTEXT Element Export 'run myexport.ulp'; | ||
| To the context menu for elements the entry Export is added, which starts an according ULP. | ||
| An existing userdefined entry can also be overwritten. | ||
| The settings are stored in the eaglerc file. The number of entries is unlimited. | ||
| Deletion of entries: | ||
| SET CONTEXT objecttype; deletes all entries for this object type. With SET CONTEXT; all user defined menu entries are deleted. | ||
| All selectable object types are supported. These are attribute, circle, dimension, element, frame, gate, hole, instance, junction, label, pad, pin, rectangle, smd, text, via and wire. | ||
| Restriction note on ULP execution: | ||
| In order to have the selected object available for function ingroup() please avoid setting the ';' within the apostrophs (i.e. not 'run myexport.ulp;', but 'run myexport.ulp'). | ||
| Bend angle for wires | SET WIRE_BEND bend_nr; | |
| bend_nr can be one of: | ||
| 0: Starting point - horizontal - vertical - end | ||
| 1: Starting point - horizontal - 45° - end | ||
| 2: Starting point - end (straight connection) | ||
| 3: Starting point - 45° - horizontal - end | ||
| 4: Starting point - vertical - horizontal - end | ||
| 5: Starting point - arc - horizontal - end | ||
| 6: Starting point - horizontal - arc - end | ||
| 7: "Freehand" (arc that fits to wire at start, straight otherwise) | ||
| 8: Route short end of airwire in Follow-me router | ||
| 9: Route both ends of airwire in Follow-me router | ||
| Note that 0, 1, 3 and 4 may contain additional miter wires (see MITER). | ||
| SET WIRE_BEND @ bend_nr ...; | ||
| Defines the bend angles that shall be actually used when switching with the right mouse button. | ||
| SET WIRE_BEND @; | ||
| Switches back to using all bend angles. | ||
| Beep on/off | SET BEEP OFF | ON; |
| Color for grid lines | SET COLOR_GRID color; | |
| Layer color | SET COLOR_LAYER layer color; | |
| Fill pattern for layer | SET FILL_LAYER layer fill; | |
| Grid parameters | SET MIN_GRID_SIZE pixels; | |
| The grid is only displayed if the grid size is greater than the set number of pixels. | ||
| Min. text size shown | SET MIN_TEXT_SIZE size; | |
| Text less than size pixels high is shown as a rectangle on the screen. The setting 0 means that all text will be displayed readably. | ||
| Net wire display | SET NET_WIRE_WIDTH width; | |
| Pad display | SET DISPLAY_MODE REAL | NODRILL; | |
| REAL: Pads are displayed as they will be plotted. NODRILL: Pads are shown without drill hole. | ||
| SET PAD_NAMES OFF | ON; | ||
| Pad names are displayed/not displayed. | ||
| Bus line display | SET BUS_WIRE_WIDTH width; | |
| DRC-Parameter | SET DRC_FILL fill_name; | |
| Polygon calculation | SET POLYGON_RATSNEST OFF | ON; | |
| See POLYGON command. | ||
| Vector font | SET VECTOR_FONT OFF | ON; | |
| See TEXT command. | ||
| Cross-reference labels | SET XREF_LABEL_FORMAT string; | |
| See LABEL command. | ||
| Part cross-references | SET XREF_PART_FORMAT string; | |
| See TEXT command. |
| Package check | SET CHECK_CONNECTS OFF | ON; | |
| The ADD command checks whether every pin has been connected to a pad (with CONNECT). This check can be switched off. Nevertheless, no board can be generated from a schematic if a device is found which does not have a package. | ||
| REPLACE mode | SET REPLACE_SAME NAMES | COORDS; | |
| UNDO buffer on/off | SET UNDO_LOG OFF | ON; | |
| Wire optimizing | SET OPTIMIZING OFF | ON; | |
| If set on, wires which lie in one line after a MOVE, ROUTE or SPLIT are subsumed into a single wire. See also OPTIMIZE. | ||
| Net wire termination | SET AUTO_END_NET OFF | ON; | |
| Automatic ending of nets or busses. See NET or BUS. | ||
| Automatic junctions | SET AUTO_JUNCTION OFF | ON; | |
| Automatic setting of junctions. See JUNCTION. | ||
| Automatic confirmation | SET CONFIRM OFF | NO | YES; | |
| Allows confirmation dialogs to be handled automatically (see below for details). |
The color palettes can be modified either through the dialog under "Options/Set.../Colors" or by using the command
SET PALETTE index argbwhere index is a number in the range 0..63 and argb is a hexadecimal value defining the Alpha, Red, Green and Blue components of the color, like 0xFFFFFF00 (which would result in a bright yellow). The alpha component defines how "opaque" the color is. A value of 0x00 means it is completely transparent (i.e. invisible), while 0xFF means it is totally opaque. The alpha component of the background color is always 0xFF. Note that the ARGB value must begin with "0x", otherwise it would be taken as a decimal number. You can use
SET PALETTE BLACK|WHITE|COLOREDto switch to the black, white or colored background palette, respectively. Note that there will be no automatic window refresh after this command, so you should do a WINDOW; command after this.
By default only the palette entries 0..15 are used and they contain the colors listed below.
The palette entries are grouped into "normal" and "highlight" colors. There are always 8 "normal" colors, followed by the corresponding 8 "highlight" colors. So colors 0..7 are "normal" colors, 8..15 are their "highlight" values, 16..23 are another 8 "normal" colors with 24..31 being their "highlight" values and so on. The "highlight" colors are used to visualize objects, for instance in the SHOW command.
Color, listed according to color numbers, which can be used instead of the color names. Used to specify colors:
| 0 | Black | |
| 1 | Blue | |
| 2 | Green | |
| 3 | Cyan | |
| 4 | Red | |
| 5 | Magenta | |
| 6 | Brown | |
| 7 | LGray | |
| 8 | DGray | |
| 9 | LBlue | |
| 10 | LGreen | |
| 11 | LCyan | |
| 12 | LRed | |
| 13 | LMagenta | |
| 14 | Yellow | |
| 15 | White |
Fill specifies the style with which wires and rectangles in a particular layer are to be filled. This parameter can also be replaced with the number at the beginning of each line:
| 0 | Empty | |
| 1 | Solid | |
| 2 | Line | |
| 3 | LtSlash | |
| 4 | Slash | |
| 5 | BkSlash | |
| 6 | LtBkSlash | |
| 7 | Hatch | |
| 8 | XHatch | |
| 9 | Interleave | |
| 10 | WideDot | |
| 11 | CloseDot | |
| 12 | Stipple1 | |
| 13 | Stipple2 | |
| 14 | Stipple3 | |
| 15 | Stipple4 |
SET CONFIRM YESwill automatically confirm every message dialog as if the user had clicked on the "positive" button ("OK" or "Yes"). The dialog itself isn't even presented to the user. Similarly, the command
SET CONFIRM NOacts as if the user had clicked on the "negative" button ("No"), if such a button is present. Otherwise it just confirms the dialog.
SET CONFIRM OFFturns off automatic confirmation. If automatic confirmation is not turned off explicitly, it will automatically fall back to OFF the next time the editor window accepts some interactive input from the user.
You should not put a SET CONFIRM YES at the beginning of a script and then execute lots of commands "silently". It is better to explicitly put this around individual commands, as in
SET CONFIRM YES REMOVE filename SET CONFIRM OFFBe extremely careful when using this command! Blindly confirming message dialogs may cause important messages to be overlooked. The result may then not be what the user expected.
Example
SET Option.DrawUnprocessedPolygonEdgesContinuous 1;The following eaglerc parameters are available:
| 123 | renders layer 123 | |
| 123t | renders layer 123 if the output is "viewed from top" (not mirrored) | |
| 123b | renders layer 123 if the output is "viewed from bottom" (mirrored) | |
| 123-140 | renders layers 123 through 140 in the given sequence | |
| 140-123 | renders layers 140 through 123 in the given sequence | |
| * | inserts the default sequence of the internal layers | |
| 123b * 123t | makes layer 123 always be rendered first |
The SHOW command is used to highlight objects. Details are listed in the status bar. Complete signals and nets can be highlighted with the SHOW command. If a bus is selected, all nets belonging to that bus will also be highlighted.
If several names are entered in one line, all matching objects are highlighted at the same time.
| * | matches any number of any characters | |
| ? | matches exactly one character | |
| [...] | matches any of the characters between the brackets |
If any of these characters shall be matched exactly as such, it has to be enclosed in brackets. For example, abc[*]ghi would match abc*ghi and not abcdefghi.
A range of characters can be given as [a-z], which results in any character in the range 'a'...'z'.
The special pattern [number..number] forms a bus name range and is therefore not treated as a wildcard pattern in a schematic.
SHOW IC1IC1 is highlighted and remains highlighted until the SHOW command is ended or a different name is entered.
SHOW IC*Highlights all objects with names starting with "IC".
The SIGNAL command is used to define signals (connections between the various packages). The user must define a minimum of two element_name/pad_name pairs, as otherwise no airwire can be generated.
If input with signal_name the signal will be allocated the specified name.
SIGNAL GND IC1 7 IC2 7 IC3 7;connects pad 7 of IC1...3. In order to enter a whole netlist, a script file may be generated, with the extension *.scr. This file should include all of the necessary SIGNAL commands in the format shown above.
The SMASH command is used with parts or elements in order to separate the text parameters indicating name, value or attributes. The text may then be placed in a new and more convenient location with the MOVE command.
Parts and elements can also be selected by their name, which is especially useful if the object is outside the currently shown window area. Note that when selecting a multi-gate part in a schematic by name, you will need to enter the full instance name, consisting of part and gate name.
Use of the SMASH command allows the text to be treated like any other text, e.g. CHANGE SIZE, ROTATE, etc., but the actual text may not be changed.
A "smashed" element can be made "unsmashed" by clicking on it with the
Shift key pressed (and of course the SMASH command activated).
SMD
See also PAD,
CHANGE,
NAME,
ROUTE,
Design Rules
The SMD command is used to add pads for surface mount devices to a package. When the SMD command is active, an smd symbol is attached to the cursor. Pressing the left mouse button places an smd pad at the current position. Entering numbers changes the x- and y-width of the smd pad, which can be up to 200 mm (7.7840 inch). These parameters remain as defaults for successive SMD commands and can be changed with the CHANGE command. Pressing the center mouse button changes the layer onto which the smd pad will be drawn.
The orientation (see description in ADD) may be any angle in the range R0...R359.9. The S and M flags can't be used here.
SMD 50 50 -100 '1' for example would create a completely round smd named '1' at the given mouseclick position. This can be used to create BGA (Ball Grid Array) pads.
The following conditions apply:
| NOSTOP | don't generate solder stop mask | |
| NOTHERMALS | don't generate thermals | |
| NOCREAM | don't generate cream mask |
By default an smd automatically generates solder stop mask, cream mask and thermals as necessary.
However, in special cases it may be desirable to have particular smds not do this.
The above NO... flags can be used to suppress these features.
A newly started SMD command resets all flags to their defaults. Once a flag is given
in the command line, it applies to all following smds placed within this SMD command.
The SPLIT command is used to split a wire (or segment) or a polygon edge into two segments in order, for example, to introduce a bend. This means you can split wires into parts that can be moved with the mouse during the SPLIT command. A mouseclick defines the point at which the wire is split. The shorter of the two new segments follows the current wire bend rules and may therefore itself become two segments (see SET Wire_Bend), the longer segment is a straight segment running to the next end point.
If the curve or @radius parameter is given, an arc can be drawn as part of the wire segment (see the detailed description in the WIRE command).
On completion of the SPLIT command, the segments are automatically rejoined if they are in line unless the command
SET OPTIMIZING OFF;has previously been given, or the wire has been clicked at the same spot twice. In this case the split points remain and can be used, for example, to reduce the width of a segment. This is achieved by selecting the SPLIT command, marking the part of the wire which is to be reduced with two mouse clicks, and using the command
CHANGE WIDTH widthThe segment is then clicked on to complete the change.
This command is used in the device editor mode to define the possible technology parts of a device name. In the schematic or board editor the TECHNOLOGY command behaves exactly like "CHANGE TECHNOLOGY".
Exactly one of the names given in the TECHNOLOGY command will be used to replace the '*' in the device set name when an actual device is added to a schematic. The term technology stems from the main usage of this feature in creating different variations of the same basic device, which all have the same schematic symbol(s), the same package and the same pin/pad connections. They only differ in a part of their name, which for the classic TTL devices is related to their different technologies, like "L", "LS" or "HCT".
The TECHNOLOGY command can only be used if a package variant has been selected with the PACKAGE command.
If no '*' character is present in the device set name, the technology will be appended to the device set name to form the full device name. Note that the technology is processed before the package variant, so if the device set name contains neither a '*' nor a '?' character, the resulting device name will consist of device_set_name+technology+package_variant.
The names listed in the TECHNOLOGY command will be added to an already existing list of technologies for the current device. Starting a name with '-' will remove that name from the list of technologies. If a name shall begin with '-', it has to be enclosed in single quotes. Using -* removes all technologies.
Only ASCII characters in the range 33..126 may be used in technologies (lowercase characters will be converted to uppercase).
The special "empty" technology can be entered as two single quotes ('', an empty string).
Note that the Technologies dialog contains all technologies from all devices in the loaded library, with the ones referenced by the current device checked.
TECHNOLOGY -* '' L LS S HCT;would first remove any existing technologies and then create the individual technology variants
7400 74L00 74LS00 74S00 74HCT00
The TEXT command is used to add text to a library element or drawing. When entering several texts it is not necessary to invoke the command each time, as the text command remains active after placing text with the mouse.
Text is always displayed so that it can be read from in front or from the right - even if rotated. Therefore after every two rotations it appears the same way, but the origin has moved from the lower left to the upper right corner. Remember this if a text appears to be unselectable.
The reading direction for vertical texts can be changed from "up" to "down" in the user interface dialog.
If you want to have text that is printed "upside down", you can set the "Spin" flag for that text.
CHANGE SIZE text_size .. CHANGE RATIO ratio .. CHANGE LINEDISTANCE value ..Maximum text height: 2 inches
| Vector | the program's internal vector font | |
| Proportional | a proportional pixel font (usually 'Helvetica') | |
| Fixed | a monospaced pixel font (usually 'Courier') |
The text font can be changed with the CHANGE command:
CHANGE FONT VECTOR|PROPORTIONAL|FIXED ..The program makes great efforts to output texts with fonts other than Vector as good as possible. However, since the actual font is drawn by the system's graphics interface, Proportional and Fixed fonts may be output with different sizes and/or lengths.
If you set the option "Always vector font" in the user interface dialog,
all texts will always be displayed and printed using the builtin vector font,
independent from the settings of the individual texts and for each drawing.
This option is useful if the system doesn't display the other fonts correctly.
You can use the SET Interface.VectorFont 0|1
command to change this setting.
When creating a new board or schematic, the current setting of this option is stored
in the option "Persistent in this drawing" of the drawing file.
This makes sure that the drawing will be printed with the correct setting if
it is transferred to somebody else who has a different setting of this option.
You can use the SET VECTOR_FONT OFF|ON command
to change the setting in an existing board or schematic drawing.
When creating output files with the CAM Processor, texts will always be drawn with Vector font. Other fonts are not supported.
If a text with a font other than Vector is subtracted from a signal polygon, only the surrounding rectangle is subtracted. Due to the above mentioned possible size/length problems, the actually printed font may exceed that rectangle. Therefore, if you need to subtract a text from a signal polygon it is recommended that you use the Vector font.
The Ratio parameter has no meaning for texts with fonts other than Vector.
| CHANGE ALIGN TOP CENTER; TEXT 'ABC' | draws the text ABC with the origin at its top/center |
| >NAME | Component name (ev.+gate name) 1) | |
| >VALUE | Comp. value/type 1) | |
| >PART | Component name 2) | |
| >GATE | Gate name 2) | |
| >XREF | Part cross-reference 2) | |
| >CONTACT_XREF | Contact cross-reference 2) | |
| >ASSEMBLY_VARIANT | Name of the current assembly variant | |
| >DRAWING_NAME | Drawing name | |
| >LAST_DATE_TIME | Time of the last modification | |
| >PLOT_DATE_TIME | Time of the plot creation | |
| >SHEETNR | Sheet number of a schematic 3) | |
| >SHEETS | Total number of sheets of a schematic 3) | |
| >SHEET | equivalent to ">SHEETNR/>SHEETS" 3) |
1) Only for package or symbol
2) Only for symbol
3) Only for symbol or schematic
The format in which a part cross-reference is displayed can be controlled through the "Xref part format" string, which is defined in the "Options/Set/Misc" dialog, or with the SET command. The following placeholders are defined, and can be used in any order:
| %S | the sheet number | |
| %C | the column on the sheet | |
| %R | the row on the sheet |
The default format string is "/%S.%C%R". Apart from the defined placeholders you can also use any other ASCII characters.
| >ABC | 123 | |
| >ABC= | ABC = 123 | |
| >ABC~ | ABC | |
| >ABC! | nothing |
Note that for each attribute name there should be only one such text in any given symbol or package! If there is more than one such text in a symbol or package that all reference the same attribute name, only one of them will be displayed when the part using this symbol or package is smashed.
!RESETwhich would result in
_____ RESETThis is not limited to signal names, but can be used in any text. It is also possible to overline only part of a text, as in
!RST!/NMI R/!Wwhich would result in
___ RST/NMI _ R/WNote that the second exclamation mark indicates the end of the overline. There can be any number of overlines in a text. If a text shall contain an exclamation mark that doesn't generate an overline, it needs to be escaped by a backslash. In order to keep the need for escaping exclamation marks at a minimum, an exclamation mark doesn't start an overline if it is the last character of a text, or if it is immediately followed by a blank, another exclamation mark, a double or single quote, or by a right parenthesis, bracket or brace. Any non-escaped exclamation mark or comma that appears after an exclamation mark that started an overline will end the overline (the comma as an overline terminator is necessary for busses).
The UNDO command allows you to cancel previously executed commands. This is especially useful if you have deleted things by accident. Multiple UNDO commands cancel the corresponding number of commands until the last EDIT, OPEN or REMOVE command is reached.
The UNDO command uses up memory space. If you are short of this you can switch off this function with the SET command
SET UNDO_LOG OFF;UNDO/REDO is completely integrated within Forward&Back Annotation.
If you confirm this dialog with "OK", the drawing will be left in the condition as selected in the list. If you cancel the dialog, it will be restored to the condition it had before the dialog was opened.
CAUTION: this is a very powerful tool! By going all the way back in the
UNDO list (which can be done with a single mouse click) and executing any
new command, the undo buffer will be truncated at that point, and there
is no way back! So use this with care!
UPDATE
See also ADD,
REPLACE
UPDATE;
UPDATE library_name..;
UPDATE<EMAIL_ADDRESS>UPDATE +@ | -@ [library_name..];
UPDATE old_library_name = new_library_name;
The UPDATE command checks the parts in a board or schematic against their respective library objects and automatically updates them if they are different. If UPDATE is invoked from the library editor, the packages within the loaded library will be updated from the given libraries.
If you activate the UPDATE command without a parameter, a file dialog will be presented to select the library from which to update.
If one ore more libraries are given, only parts from those libraries will be checked. The library names can be either a plain library name (like "ttl" or "ttl.lbr") or a full file name (like "/home/mydir/myproject/ttl.lbr" or "../lbr/ttl").
If a library_name contains blanks, it needs to be enclosed in single quotes.
If the first parameter is '+@', the names of the given libraries (or all libraries, if none are given) will get a '@' character appended, followed by a number. This can be used to make sure the libraries contained in a drawing will not be modified when a part from a newer library with the same name is added to the drawing. Library names that already end with a '@' character followed by a number will not be changed.
If the first parameter is '-@', the '@' character (followed by a number) of the given libraries (or all libraries, if none are given) will be stripped from the library name. This of course only works if there is no library with that new name already in the drawing.
Please note that "UPDATE +@;" followed by "UPDATE -@;" (and vice versa) does not necessarily result in the original set of library names, because the sequence in which the names are processed depends on the sequence in which the libraries are stored in the drawing file.
The libraries stored in a board or schematic drawing are identified only by their base name (e.g. "ttl"). When considering whether an update shall be performed, only the base name of the library file name will be taken into account. Libraries will be searched in the directories specified under "Libraries" in the directories dialog, from left to right. The first library of a given name that is found will be taken. Note that the library names stored in a drawing are handled case insensitive. It does not matter whether a specific library is currently "in use". If a library is not found, no update will be performed for that library and there will be no error message.
Using the UPDATE command in a schematic or board that are connected via active Forward&Back Annotation will act on both the schematic and the board.
At some point you may need to specify whether gates, pins or pads shall be mapped by their names or their coordinates. This is the case when the respective library objects have been renamed or moved. If too many modifications have been made (for example, if a pin has been both renamed and moved) the automatic update may not be possible. In that case you can either do the library modification in two steps (one for renaming, another for moving), or give the whole library object a different name.
When used with old_library_name = new_library_name (note that there has to be at least one blank before and after the '=' character), the UPDATE command locates the library named old_library_name in the current board or schematic, and updates it with the contents of new_library_name. Note that old_library_name must be the pure library name, without any path, while new_library_name may be a full path name. If the update was performed successfully, the library in the current board/schematic file will also be renamed accordingly - therefore this whole operation is, of course, only possible if new_library_name has not yet been used in the current board or schematic.
Note: You should always run a Design Rule Check (DRC) and an Electrical Rule Check (ERC) after a library update has been performed in a board or a schematic!
By specifying the package name (package_name@library_name) you can have only a
specific package be replaced.
USE
See also ADD,
REPLACE
USE -*;
USE library_name..;
The USE command marks a library for later use with the ADD or REPLACE command.
If you activate the USE command without a parameter, a file dialog will appear that lets you select a library file. If a path for libraries has been defined in the "Options/Directories" dialog, the libraries from the first entry in this path are shown in the file dialog.
The special parameter -* causes all previously marked libraries to be dropped.
library_name can be the full name of a library or it can contain wildcards. If library_name is the name of a directory, all libraries from that directory will be marked.
The suffix .lbr can be omitted.
Note that when adding a device or package to a drawing, the complete library information for that object is copied into the drawing file, so that you don't need the library for changing the drawing later.
Changes in a library have no effect on existing drawings. See the UPDATE command if you want to update parts from modified libraries.
| USE | opens the file dialog to choose a library | |
| USE -*; | drops all previously marked libraries | |
| USE demo trans*; | marks the library demo.lbr and all libraries with names matching trans*.lbr | |
| USE -* /eagle/lbr; | first drops all previously marked libraries and then marks all libraries from the directory /eagle/lbr |
If you type in a value before you select an element, then all of the subsequently selected elements receive this value. This is very useful if you want for instance a number of resistors to have the same value.
If the parameters name and value are specified, the element name gets the specified value.
The VALUE command can only be used in the default assembly variant. If you want to change the value of another assembly variant, you need to use the VARIANT command.
VALUE R1 10k R2 100kIn this case more than one element has been assigned a value. This possibility can be used in script files:
VALUE R1 10k \ R2 100k \ R3 5.6k \ C1 10uF \ C2 22nF \ ...The '\' prevents the following line from being mistaken for an EAGLE key word.
On: Permits the actual value to be changed in the schematic.
Off: Automatically enters the actual device name into the schematic
(e.g.74LS00N). The user can only modify this value after a confirmation.
VARIANT
See also VALUE,
TECHNOLOGY
VARIANT name part_name [NO]POPULATE [ value [ technology ] ];
VARIANT [ + | - ] name;
By default all parts of the schematic are populated on the board (provided they have a package). However, sometimes different variants of a design may require that some parts are not populated, or that they have different values or technologies than the default. The VARIANT command allows you to define which parts are actually populated in a given assembly variant, and to give them particular values and technologies.
name is the name of the variant. It is treated case-insensitive and must be enclosed in single quotes if it contains blanks or '+' or '-'.
If part_name followed by the keyword POPULATE or NOPOPULATE is given, a variant of the given name is created for that part, in which it will be marked as either "populated" or "not populated".
Parts that are not populated in the current assembly variant are indicated with an X drawn over their entire bounding rectangle in the schematic. In the board anything that is related to actually placing the part on the board (like placeplan, names, values etc.) is not drawn in such a case.
The optional value and technology (which is only applicable in a schematic) can be used to further refine the variant. A value may only be given if the part's device set has its "user value" parameter enabled. If only the technology shall be specified without using a different value, an empty string ('') can be entered for the value.
A new variant can be created by preceding name with a '+'. If a variant with that name already exists, nothing happens.
If the variant name is preceded with a '-', the given variant will be deleted. If name is '*', all variants will be deleted. Unless this command is used in a script, a confirmation prompt will ask the user whether this action should really be taken.
Giving only a variant name will switch the whole project to that variant. This means that all "populate" flags, values and technologies will appear as specified in that variant for each part. Using an empty string ('') here switches to the default assembly variant, which is the same as if there were no variants at all. Note that when loading a drawing it is always in its default state, with no assembly variant selected.
If used without any parameters, a dialog will open that allows you to manage all assembly variants.
The name of the current assembly variant can be displayed by using the text variable >ASSEMBLY_VARIANT.
The commands ADD, CHANGE PACKAGE | TECHNOLOGY, REPLACE, UPDATE and VALUE can only be used if no assembly variant is active.
The COPY command doesn't copy assembly variants.
Assembly variants can also be used in a module. A specific assembly variant of the module can be selected in each module instance.
The assembly variants of the schematic and assembly variants of modules are
completely independent. The VARIANT command is not intended to switch assembly
variants of a module.
VIA
See also SMD,
CHANGE,
DISPLAY,
SET,
PAD,
Design Rules
When the VIA command is active, a via symbol is attached to the cursor. Pressing the left mouse button places a via at the current position. The via is added to a signal if it is placed on an existing signal wire. If you try to connect different signals, EAGLE will ask you if you really want to connect them.
The drill diameter of the via is the same as the diameter set for pads. It can be changed with
CHANGE DRILL diameter
Square
Round
Octagon
These shapes only apply to the outer layers (Top and Bottom). In inner layers the shape is always "round".
Vias generate drill symbols in the Drills layer and the solder stop mask in the tStop/bStop layers.
Like the diameter, the via shape can be entered while the VIA command is active, or it can be changed with the CHANGE command. The shape then remains valid for the next vias and pads.
Note that the actual shape and diameter of a via will be determined by the Design Rules of the board the via is used in.
| STOP | always generate solder stop mask |
By default a via with a drill diameter that is less than or equal to the value of
the Design Rules parameter "Masks/Limit" will not
have a solder stop mask. The above STOP flag can be used to force a solder
stop mask for a via.
You can specify an integer or real number as the argument to the WINDOW
command to scale the view of the drawing by the amount entered. The
center of the window remains the same.
When zooming very far into a drawing, the following things may happen:
The syntax to handle these aliases is:
WINDOW = MyWindow (0 0) (4 3);
Defines the alias "MyWindow" which, when used as in
WINDOW myw
will zoom to the given window area.
Note the abbreviated use of the alias and the case insensitivity.
The WIRE command is used to add wires (tracks) to a drawing. The wire
begins at the first point specified and runs to the second. Additional
points draw additional wire segments. Two mouse clicks at the same
position finish the wire and a new one can be started at the position
of the next mouse click.
Depending on the currently active wire bend, one or two wire segments will
be drawn between every two points. The wire bend defines the angle
between the segments and can be changed with the right mouse button (holding
the Shift key down while clicking the right mouse button reverses the direction
in which the bend styles are gone through, and the Ctrl key makes it toggle
between corresponding bend styles).
Pressing the center mouse button brings up a popup menu from which you
may select the layer into which the wire will be drawn.
The special keywords ROUND and FLAT, as well as the curve
parameter, can be used to draw an arc (see below).
Starting a WIRE with the Ctrl key pressed snaps the starting point
of the new wire to the coordinates of the closest existing wire. This
is especially useful if the existing wire is off grid. It also adjusts
the current width, layer and style to those of the existing wire.
If the current bend style is 7 ("Freehand"), the new wire will form a
smooth continuation of the existing wire.
The wire width can be changed with the command
WINDOW
The WINDOW command is used to zoom in and out of the drawing and to
change the position of the drawing on the screen. The command can
be used with up to three mouse clicks. If there are fewer, it must
be terminated with a semicolon.
WINDOW ;
WINDOW ;
WINDOW
WINDOW scale_factor
WINDOW FIT
WINDOW LAST
F2: WINDOW; Redraw screen
F3: WINDOW 2 Zoom in by a factor of 2
F4: WINDOW 0.5 Zoom out by a factor of 2
F5: WINDOW (@); Cursor pos. is new center (if a command is active)
Refresh screen
If you use the WINDOW command followed by a semicolon, EAGLE redraws
the screen without changing the center or the scale. This is useful
if error messages cover part of the drawing.
New center
The WINDOW command with one point causes that point to become
the center of a new screen display of the drawing. The scaling of
the drawing remains the same. You can also use the sliders of the
working area to move the visible area of the drawing. The function
key F5 causes the current position of the cursor to be the new center.
Corner points
The WINDOW command with two points defines a rectangle with
the specified points at opposite corners. The rectangle expands to
fill the screen providing a close-up view of the specified portion
of the drawing.
New center and zoom
You can use the WINDOW command with three points. The first
point defines the new center of the drawing and the display becomes
either larger or smaller, depending on the ratios of the spacing between
the other points. In order to zoom in, the distance between point
1 and point 3 should be greater than the distance between point 1
and 2; to zoom out place point 3 between points 1 and 2.
Zoom in and out
WINDOW 2;
Makes the elements appear twice as large.
WINDOW 0.5;
Reduces the size of the elements by a factor of two.
The whole drawing
WINDOW FIT;
fits the entire drawing on the screen.
Back to the previous window
WINDOW LAST;
switches back to the previous window selection. A window selection is stored by
every WINDOW command, except for zoom-only WINDOW commands and modifications of
the window selection with the mouse.
Very large zoom factors
By default the maximum zoom factor is limited in such a way that
an area of 1mm (about 40mil) in diameter will be shown using the full editor window.
If you need to zoom in further, you can uncheck "Options/User interface/Limit zoom factor"
and will then be able to zoom in all the way until the finest editor grid
can be seen.
Parameter Aliases
Parameter aliases can be used to define certain parameter settings to the
WINDOW command, which can later be referenced by a given name.
The aliases can also be accessed by clicking on the "WINDOW Select" button
and holding the mouse button pressed until the list pops up.
A right click on the button also pops up the list.
Example:
WIRE
See also MITER,
SIGNAL,
ROUTE,
CHANGE,
NET,
BUS,
DELETE,
RIPUP,
ARC
WIRE ['signal_name'] [width] [ROUND | FLAT] [curve | @radius] ..
Signal name
The signal_name parameter is intended mainly to be used in
script files that read in generated data. If a signal_name
is given, all subsequent wires will be added to that signal and no
automatic checks will be performed.
This feature should be used with great care because it could result
in short circuits, if a wire is placed in a way that it would connect
different signals. Please run a
Design Rule Check after using the WIRE command
with the signal_name parameter!
Wire Width
Entering a number after activating the WIRE command changes the width
of the wire (in the present unit) which can be up to 200 mm (7.8740 inch).
CHANGE WIDTH width
at any time.
Wire Style
Wires can have one of the following styles:
The wire style can be changed with the CHANGE command.
Note that the DRC and Autorouter will always treat wires as "Continuous", even if their style is different. Wire styles are mainly for electrical and mechanical drawings and should not be used on signal layers. It is an explicit DRC error to use a non-continuous wire as part of a signal that is connected to any pad.
Note that EAGLE treats each wire segment as a single object (e.g. when deleting a wire).
When the WIRE command is active the center mouse button can be used to change the layer on which the wire is drawn.
Do not use the WIRE command for nets, buses, and airwires. See NET, BUS and SIGNAL.
The valid range for curve is ]-360..+360[ (without the limits +-360),
and its value means what
part of a full circle the arc consists of. A value of 90, for instance,
would result in a 90° arc, while 180 would give you a semicircle.
Full circles cannot be created this way (for this use the CIRCLE command).
Positive values for curve mean that the arc is drawn in a mathematically positive sense
(i.e. counterclockwise). If curve is 0, the arc is a straight line
("no curvature"), which is actually a wire. Note that in order to distinguish the
curve parameter from the width parameter, it always has to be given with
a sign ('+' or '-'), even if it is a positive value.
As an example, the command
WIRE (0 0) +180 (0 10);would draw a semicircle from the point (0 0) to (0 10), in counterclockwise direction.
If a radius is given, the arc will have that radius. Just like the curve parameter, radius also must have a sign in order to determine the arcs orientation. For example, the command
WIRE (0 0) @+100 (0 200);would draw a semicircle from the point (0 0) to (0 200) (with a radius of 100), in counterclockwise direction. Note that if the end point is more than twice the radius away from the start point, a straight line will be drawn.
The arc radius can also be defined by placing the wire end point with the Ctrl key pressed (typically at the center of the circle on which the arc shall lie). In that case the point is not taken as an actual end point, but is rather used to set the radius of an arc. You can then move the cursor around and place an arc with the given radius (the right mouse button together with Ctrl will toggle the arc's orientation). If you move the cursor more than twice the radius away from the start point, a straight line will be drawn.
In order to be able to draw any arc with the WIRE command (which is especially important
for generated script files), the keywords ROUND and FLAT are also
allowed in the WIRE command. Note, though, that these apply only to actual arcs
(straight wires always have round endings). By default, arcs created with the WIRE
command have round endings.
The file name may also be entered with a pathname if it is to
be saved in another directory. If no pathname is given, the file is
saved in the
project directory.
If the new name is preceded with a @, the name of the loaded
drawing will also be changed accordingly. The corresponding board/schematic
will then also be saved automatically under this name and the UNDO buffer
will be cleared.
If WRITE is selected from the menu, a popup window will appear asking
for the name to use (current drawing name is default). This name may
be edited and accepted by clicking the OK button. Pressing the ESCAPE
key or clicking the CANCEL button cancels the WRITE command.
To assure consistency for
Forward&Back Annotation
between board and schematic drawings, the WRITE
command has the following additional functionality:
See also PRINT
WRITE
The WRITE command is used to save a drawing or library. If 'name'
is entered, EAGLE will save the file under the new name.
WRITE name
WRITE @name
Generating Output
Printing
The parameters for printing to the system printer can be modified through
the following three dialogs:
Printing a Drawing
If you enter the PRINT command without a
terminating ';', or select Print from the
context menu of a drawing's icon in the
Control Panel, you will be presented a dialog
with the following options:
Paper
Selects which paper format to print on.
Orientation
Selects the paper orientation.
Preview
Turns the print preview on or off.
Mirror
Mirrors the output.
Rotate
Rotates the output by 90°.
Upside down
Rotates the drawing by 180°. Together with Rotate the drawing is rotated by a total of 270°.
Black
Ignores the color settings of the layers and prints everything in black.
Solid
Ignores the fill style settings of the layers and prints everything in solid.
Scale factor
Scales the drawing by the given value.
Page limit
Defines the maximum number of pages you want the output to use.
In case the drawing does not fit on the given number of pages, the actual scale factor
will be reduced until it fits.
The default value of 0 means no limit.
All
All sheets of the schematic will be printed
(this is the default when selecting Print from the
context menu of a schematic drawing's icon).
The remaining options are used for the page setup.
Printing a Text
If you select Print from the
context menu of a text file's icon in the
Control Panel, or from the File
menu of the Text Editor, you will be presented
a dialog with the following options:
The remaining options are used for the page setup.
The default border values are taken from the printer driver, and define
the maximum drawing area your particular printer can handle. You can enter
smaller values here, but your printer hardware may or may not be able to
print arbitrarily close to the paper edges.
After changing the printer new hardware minimums may apply and your
border values may be automatically enlarged as necessary to comply with
the new printer. Note that the values will not be decreased automatically
if a new printer would allow smaller values. To get the smallest possible
border values you can enter 0 in each field, which will then be
limited to the hardware minimum.
The value in the X field is the calibration factor to use
in the print head direction, while the value in the Y field
is used to calibrate the paper feed direction.
IMPORTANT NOTE: When producing production layout drawings with
your printer, always check the final print result for correct measurements!
The default values of 1 assume that the printer produces exact
measurements in both directions.
If the drawing is mirrored, the word "mirrored" will appear in the caption,
and if the scale factor is not 1.0 it will be added as f=...
(the scale factor is given with 4 decimal digits, so even if f=1.0000
appears in the caption the scale factor will not be exactly 1.0).
The following help topics lead you through the necessary steps from
selecting a data file to configuring the output device:
See also printing to the system printer
Printer Page Setup
The Print dialog provides several options that are used to define how a drawing or text
shall be placed on the paper.
Border
Defines the left, top, right and bottom borders. The values are either in
millimeters or inches, depending on which unit results in fewer decimals.
Calibrate
If you want to use your printer to produce production layout drawings,
you may have to calibrate your printer to achieve an exact 1:1
reproduction of your layout.
Aligment
Defines the vertical and horizontal alignment of the drawing on the paper.
Caption
Activates the printing of a caption line, containing the time and date
of the print as well as the file name.
CAM Processor
The CAM Processor allows you to output any combination of layers
to a device or file.
Main CAM Menu
The Main CAM Menu is where you select which file to process,
edit drill rack and aperture wheel files, and load or save job files.
File
| Open | Board... open a board file for processing | |
| Drill rack... open a drill rack file for editing | ||
| Wheel... open an aperture wheel file for editing | ||
| Job... switch to an other job (or create a new one) | ||
| Save job... | save the current job | |
| Close | close the CAM Processor window | |
| Exit | exit from the program |
| Deselect all | deselect all layers | |
| Show selected | show only the selected layers | |
| Show all | show all layers |
| Control Panel | switch to the Control Panel | |
| 1 Schematic - ... | switch to window number 1 | |
| 2 Board - ... | switch to window number 2 |
| General help | opens a general help page | |
| Contents | opens the help table of contents | |
| CAM Processor | displays help for the CAM Processor | |
| Job help | displays help about the Job mechanism | |
| Device help | displays help about output devices |
A typical CAM Processor job could for example have two sections, one that produces photoplotter data for the Top layer, and another that produces the data for the bottom layer.
You can limit the size of the output to a given number of pages by entering a negative number in the Scale field. In that case the default scale factor will be 1.0 and will be decreased until the drawing just fits on the given number of pages. For example, entering "-2" into this field will produce a drawing that does not exceed two pages. Please note that for this mechanism to work you will have to make sure that the page width and height is set according to your output device. This setting can be adjusted in the Width and Height fields or by editing the file eagle.def.
D010 round 0.004 D040 square 0.004 D100 rectangle 0.060 x 0.075 D104 oval 0.030 x 0.090 D110 draw 0.004Note that the file may contain several apertures that share the same D-code, as long as all of these have a type from draw or round, and have the same size. This can be used to map apertures that effectively result in the same drawing to a common D-code.
Please note that aperture emulation can cause very long plot times (costs!).
Tolerances are entered in percent.
Please be aware that your design rules might not be kept when allowing
tolerances!
This file can be generated with the help of a User Language Program called
drillcfg.ulp, that is stored in your EAGLE's ULP directory.
Use the RUN command to start it.
Tolerances are entered in percent.
Can be used to position the origin of plotters at the lower left corner.
Please note that the CAM Processor divides a drawing into several
parts if the rectangle which includes all objects of the file
(even the ones not printed) doesn't fit into the printable area.
The plotter default speed is selected with the value 0.
Please use a text editor which doesn't
place control characters into the file.
The following file names are commonly used:
Aperture Tolerances
If you enter tolerances for draw and/or flash apertures the CAM
Processor uses apertures within the tolerances, provided the aperture
with the exact value is not available.
Drill Rack File
If a drill station driver can't automatically generate the necessary drill
definitions, it needs to know which drill diameters
are assigned to the codes used in the output file. These assignments
are defined in a Drill Rack File.
Example
T01 0.010
T02 0.016
T03 0.032
T04 0.040
T05 0.050
T06 0.070
Drill Tolerances
If you enter tolerances for drills the CAM Processor uses drill
diameters within the tolerances, provided the drill with the exact
value is not available.
Offset
Offset in x and y direction (inch, decimal number).
Printable Area
Height
Printable area in Y direction (inch).
Width
Printable area in X direction (inch).
Pen Data
Diameter
Pen diameter in mm. Is used for the calculation of lines
when areas have to be filled.
Velocity
Pen velocity in cm/s for pen plotters which can be adjusted
to different speeds.
Defining Your Own Device Driver
The drivers for output devices are defined in the text file eagle.def.
There you find details on how to define your own driver. It is
advisable to copy the whole section of an existing driver of the same
device category and to edit the parameters which are different.
Output File
The Output File contains the data produced by the CAM Processor.
-------------------------------------------------------
File Layers Meaning
-------------------------------------------------------
*.cmp Top, Via, Pad Component side
*.ly2 Route2, Via, Pad Inner signal layer
*.ly3 Route3, Via, Pad Inner signal layer
... ...
*.sol Bot, Via, Pad Solder side
*.plc tPl, Dim, tName, Silkscreen comp. side
*.pls bPl, Dim, bName, Silkscreen solder side
*.stc tStop Solder stop mask comp. side
*.sts bStop Solder stop mask sold. side
*.drd Drills, Holes Drill data for NC drill st.
-------------------------------------------------------
Placeholders
The output file name can either be entered directly, or can be dynamically
composed using placeholders. A placeholder consists of a percentage
character ('%') followed by a letter. The following
placeholders are defined:
| %D{xxx} | a string that is inserted only into the data file name | |
| %E | the loaded file's extension (without the '.') | |
| %H | the user's home directory | |
| %I{xxx} | a string that is inserted only into the info file name | |
| %L | the layer range for blind&buried vias (see below) | |
| %N | the loaded file's name (without path and extension) | |
| %P | the loaded file's directory path (without file name) | |
| %% | the character '%' |
For example, the output file definition
%N.cmp%I{.info}
would create boardname.cmp for the data file and boardname.cmp.info for the info file (in case the selected output device generates an info file).
boardname.drl.0104which would be the drill file for the layer stack 1-4. If you want to have the layer numbers at a different position, you can use the placeholder %L, as in
%N.%L.drlwhich would result in
boardname.0104.drlThe drill info file name is always generated without layer numbers, and any '.' before the %L will be dropped. Any previously existing files that would match the given drill file name pattern, but would not result from the current job, will be deleted before generating any new files. There will be one drill info file per job, which contains (amoung other information) a list of all generated drill data files.
If you have selected an output device that supports colors, you can enter the color number in the Color field of each layer.
The following layers and output file names are commonly used to create the output:
------------------------------------------------------- File Layers Meaning ------------------------------------------------------- *.cmp Top, Via, Pad Component side *.ly2 Route2, Via, Pad Inner signal layer *.ly3 Route3, Via, Pad Inner signal layer ... ... *.sol Bot, Via, Pad Solder side *.plc tPl, Dim, tName, Silkscreen comp. side *.pls bPl, Dim, bName, Silkscreen solder side *.stc tStop Solder stop mask comp. side *.sts bStop Solder stop mask sold. side *.drd Drills, Holes Drill data for NC drill st. -------------------------------------------------------
The User Language Program outlines.ulp implements the entire process necessary to do this. The following is a detailed description of what exactly has to be done to produce outlines data with EAGLE.
Non-zero values for the Isolate parameter can be used when working sequentially with different milling tool diameters in order to avoid areas that have already been milled.
The Autorouter is also used as "Follow-me" router in the ROUTE command.
Please check your license
to see whether you have access to the Autorouter module.
The DRC is performed in a board window, and checks the design for overlaps,
distance violations etc.
The Design Rule Check checks the board against these rules
and reports any violations.
The Design Rules of a board can be modified through the Design Rules dialog, which
appears if the DRC command is selected without a terminating
';'.
Newly created boards take their design rules from the file 'default.dru',
which is searched for in the first directory listed in the "Options/Directories/Design rules" path.
If no such file is present, the program's builtin default values apply.
Note regarding the values for Clearance and Distance:
The accuracy is limited by the internal resolution of coordinates (1/320000mm).
If the Design Rules have been modified, the name in the dialog's title will have
trailing asterisk ('*') to mark the Design Rules as modified. This mark
will be removed once the Design Rules are explicitly written to disk, or a new set
of Design Rules is loaded.
The layer setup is defined by the string in the "Setup" field. This string consists of
a sequence of layer numbers, separated by one of the characters '*' or
'+', where '*' stands for core material (also known as FR4
or something similar) and '+' stands for prepreg (or any other kind of
isolation material). The actual core and prepreg sequence has no meaning
to EAGLE other than varying the color in the layer display at the top left corner
of this tab (the actual multilayer setup always needs to be worked out with the
board manufacturer). The vias are defined by enclosing a sequence of layers with (...).
So the setup string
Note that a polygon in the special signal named _OUTLINES_ will be used to generate
outlines data and as such will not adhere to these
clearance values.
For compatibility with version 3.5x the following applies:
If the minimum distance between copper and dimension is set to 0
objects in the Dimension layer will not be taken into account when calculating
polygons (except for Holes, which are always taken into account). This also disables
the distance check between copper and dimension objects.
Cross-reference labels are typically placed at the right or left border of
a schematic sheet, and indicate the next (or previous) sheet a particular net
is used on. See the LABEL command for a detailed
description of how this works.
When actually displayed, the '>XREF' text variable will be replaced
with the sheet number, frame column and row (according to the
part cross-reference format) of the Must
gate of this device.
See Contact cross-references on how
to display the contact locations on the coil's sheet.
The contact symbols need to contain the '>XREF' text variable
in order to generate part cross-references.
The gate symbols shall be drawn in a way that the pins extend up and down,
and that the origin is at the center of the symbol.
The first contact gate in the device set drawing shall be placed at an x-coordinate
of 0, and its y-coordinate shall be high enough to make sure its lower pin is in the
positive area, typically at 100mil. The rest of the contact gates shall be placed
to the right of the first one, with their origins at the same y-coordinate as the
first one. The coil gate can be placed at an arbitrary location.
In the schematic drawing the contact cross-reference will be shown at the same
x-coordinate as the coil instance, and right below the y-coordinate defined
by the text variable '>CONTACT_XREF'. This text variable can be
defined either in a drawing frame symbol or directly on the sheet. If it is
present in both, the one in the sheet is taken. The actual text will not be visible
in the schematic sheet.
The graphical representation of the contact cross-reference consists of all the
gates that have an '>XREF' text variable (except for the first Must
gate, which is the coil and typically doesn't have this variable). The gates are
rotated by 90 degrees and are shown from top to bottom at the same offsets
as they have been drawn from left to right in the device set. Their sheet numbers and
frame locations are displayed to the right of each gate that is actually used.
Any other texts that have been defined in the symbol drawings will not be
displayed when using these symbols for generating the contact cross-reference.
Note that the contact cross-reference can't be selected with the mouse. If you
want to move it, move the coil instance and the contact cross-reference will
automatically follow it.
The contact cross-reference may get out of sync in case contact gates are
invoked, moved, deleted or swapped, or if the '>CONTACT_XREF' text
variable is modified. This will automatically be updated at the next window refresh.
To use this feature you have to
write a User Language Program (ULP),
and then execute it.
The following sections describe the EAGLE User Language in detail:
Design Checks
There are two integrated commands that allow you to check your design:
The ERC is performed in a schematic window, and checks the design for
electrical consistency.
Design Rules
Design Rules define all the parameters that the board layout has to follow.
File
The File tab shows a description of the current set of Design Rules and
allows you to change that description (this is strongly recommended if you define
your own Design Rules). There are also buttons to load a different set of Design
Rules from a disk file and to save the current Design Rules to disk.
Note that the Design Rules are stored within the board file, so they will be in effect
if the board file is sent to a board house for production. The "Load..." and "Save as..."
buttons are merely for copying a board's Design Rules to and from disk.
Layers
The Layers tab defines which signal layers the board actually uses, how thick
the copper and isolation layers are, and what kinds of vias can be placed
(note that this applies only to actual vias; so even if no via from layer 1 to
16 has been defined in the layer setup, pads will always be allowed).
(1*16)
would mean a two layer board, using layers 1 and 16 and vias going through the
entire board (this is also the default value).
When building a multilayer board the setup could be something like
((1*2)+(15*16))
which is a four layer board with layer pairs 1/2 and 15/16 built on core material
and vias drilled through them, and finally the two layer pairs pressed together
with prepreg between them, and vias drilled all the way through the entire board.
Besides vias that go trough an entire layer stack (which are commonly referred to
as buried vias in case they have no connection to the Top and Bottom layer)
there can also be vias that are not drilled all the way through a layer stack, but
rather end at a layer inside that stack. Such vias are known as blind vias
and are defined in the "Setup" string by enclosing a sequence of layers with
[t:...:b], where t and b are the layers up to which that via
will go from the top or bottom side, respectively. A possible setup with blind
vias could be
[2:1+((2*3)+(14*15))+16:15]
which is basically the previous example, with two additional outer layers that are
connected to the next inner layers by blind vias. It is also
possible to have only one of the t or b parameters, so for instance
[2:1+((2*3)+(15*16))]
would also be a valid setup. Finally, blind vias are not limited to starting
at the Top or Bottom layer, but may also be used in inner layer stacks, as in
[2:1+[3:2+(3*4)+5:4]+16:5]
A blind via from layer a to layer b also implements all possible
blind vias from layer a to all layers between layers a and b, so
[3:1+2+(3*16)]
would allow blind vias from layer 1 to 2 as well as from 1 to 3.
Clearance
The Clearance tab defines the various minimum clearance values between objects
in signal layers. These are usually absolute minimum values that are defined by the
production process used and should be obtained from your board manufacturer.
The actual minimum clearance between objects that belong to different signals will
also be influenced by the net classes the two signals belong to.
Distance
The Distance tab defines the minimum distance between objects in signal layers
and the board dimensions, as well as that between any two drill holes.
Note that only signals that are actually connected to at least one pad or
smd are checked against the board dimensions. This allows edge markers to be drawn
in the signal layer without generating DRC errors.
Sizes
The Sizes tab defines the minimum width of any objects in signal layers and
the minimum drill diameter. These are usually absolute minimum values that are defined by the
production process used and should be obtained from your board manufacturer.
The actual minimum width of signal wires and drill diameter of vias will
also be influenced by the Net Class the signal belongs to.
Restring
The Restring tab defines the width of the copper ring that has to remain after the
pad or via has been drilled. Values are defined in percent of the drill diameter and
there can be an absolute minimum and maximum limit. Restrings for pads can be different
for the top, bottom and inner layers, while for vias they can be different for the
outer and inner layers.
If the actual diameter of a pad (as defined in the library) or a via would result in a
larger restring, that value will be used in the outer layers. Pads in library packages
can have their diameter set to 0, so that the restring will be derived entirely
from the drill diameter.
Shapes
The Shapes tab defines the actual shapes for smds and pads.
Smds are normally defined as rectangles in the library (with a "roundness" of 0),
but if your design requires rounded smds you can specify the roundness factor here.
Pads are normally defined as octagons in the library (long octagons where this makes
sense), and you can use the combo boxes to specify whether you want to have
pads with the same shapes as defined in the library, or always square, round or
octagonal. This can be set independently for the top and bottom layer.
If the "first" pad of a package has been marked as such in the library
it will get the shape as defined in the third combo box (either round, square or
octagonal, or no special shape).
The Elongation parameters define the appearance of pads with shape Long or Offset.
Supply
The Supply tab defines the Thermal isolation between pads and signal
polygons.
Masks
The Masks tab defines the dimensions of solder stop and cream masks. They are
given in percent of the smaller dimension of smds, pads and vias and can have an
absolute minimum and maximum value.
Solder stop masks are generated for smds, pads and those vias that have a drill diameter
that exceeds the given Limit parameter.
Cream masks are generated for smds only.
Misc
The Misc tab allows you to turn on a grid and angle check.
Beside that you can define whether checking for texts in signal layers not written in vectorfont
shall be made (default on). There's also an option for checking for copper in restricted areas
(layers tRestrict/bRestrict. Default is on).
Cross-references
There are various methods that can be used to create cross-references
in EAGLE schematic drawings. The following sections describe each of them.
Cross-reference labels
A plain label can be used to make the name of a net visible in a schematic.
If a label has the xref property activated, its behavior is changed
so that it becomes a cross-reference label.
Part cross-references
Electrical schematics often use electro-mechanical relays, consisting of a
coil and one or more contact symbols. If the coil and contacts are distributed
over various schematic sheets, it is useful to have each contact indicate
which sheet its coil is on. This can be achieved by giving the coil gate in
the device set an add level of Must (see the ADD
command) and placing the text variable '>XREF' somewhere in the
contacts' symbols (see the TEXT command).
Contact cross-references
On a multi-sheet electrical schematic with electro-mechanical relays that
have their coils and contacts distributed over various sheets, it is useful
to be able to see which sheets the individual contacts of a relay are on.
EAGLE can automatically display this contact cross-reference for each
relay coil if the following conditions are met.
User Language
The EAGLE User Language can be used to access the EAGLE data structures
and to create a wide variety of output files.
| Syntax | lists the rules a ULP file has to follow | |
| Data Types | defines the basic data types | |
| Object Types | defines the EAGLE objects | |
| Definitions | shows how to write a definition | |
| Operators | lists the valid operators | |
| Expressions | shows how to write expressions | |
| Statements | defines the valid statements | |
| Builtins | lists the builtin constants, functions etc. | |
| Dialogs | shows how to implement a graphical frontent to a ULP |
A User Language Program consists of two major items, definitions and statements.
Definitions are used to define constants, variables and functions to be used by statements.
A simple ULP could look like this:
#usage "Add the characters in the word 'Hello'\n" "Usage: RUN sample.ulp" // Definitions: string hello = "Hello"; int count(string s) { int c = 0; for (int i = 0; s[i]; ++i) c += s[i]; return c; } // Statements: output("sample") { printf("Count is: %d\n", count(hello)); }If the #usage directive is present, its value will be used in the Control Panel to display a description of the program.
If the result of the ULP shall be a specific command that shall be executed in the
editor window, the exit() function can be
used to send that command to the editor window.
Executing a ULP
User Language Programs are executed by the
RUN command from an editor window's command line.
A ULP can return information on whether it has run successfully or not. You can use the exit() function to terminate the program and set the return value.
A return value of 0 means the ULP has ended "normally" (i.e. successfully), while any other value is considered as an abnormal program termination.
The default return value of any ULP is 0.
When the RUN command is executed as part of a script file, the script is terminated if the ULP has exited with a return value other than 0.
A special variant of the exit() function can be
used to send a command to the editor window as a result of the ULP.
Any spaces (blanks), tabs, newline characters and
comments are considered whitespace
and are discarded.
The only place where ASCII characters representing whitespace
are not discarded is within literal strings,
like in
If the final newline character of a line is preceded by a backslash
(\), the backslash and newline character are both discarded,
and the two lines are treated as one line:
There are two ways to define a comment. The first one uses the syntax
The second way to define a comment uses the syntax
The maximum include depth is 10.
Each #include directive is processed only once. This makes sure
that there are no multiple definitions of the same variables or functions, which
would cause errors.
Syntax
The basic building blocks of a User Language Program are
All of these have to follow certain syntactical rules, which are
described in their respective sections.
Whitespace
Before a User Language Program can be executed, it has to be read in from
a file. During this read in process, the file contents is parsed
into tokens and whitespace.
string s = "Hello World";
where the blank character between 'o' and 'W' remains part
of the string.
"Hello \
World"
is parsed as "Hello World"
Comments
When writing a User Language Program it is good practice to add some
descriptive text, giving the reader an idea about what this particular
ULP does. You might also want to add your name (and, if available, your
email address) to the ULP file, so that other people who use your program
could contact you in case they have a problem or would like to suggest
an improvement.
/* some comment text */
which marks any characters between (and including) the opening
/* and the closing */ as comment. Such comments may expand over
more than one lines, as in
/* This is a
multi line comment
*/
but they do not nest. The first */ that follows any /*
will end the comment.
int i; // some comment text
which marks any characters after (and including) the // and up
to (but not including) the newline character at the end of the line as
comment.
Directives
The following directives are available:
#include
#require
#usage
#include
A User Language Program can reuse code in other ULP files through the #include
directive. The syntax is
#include "filename"
The file filename is first looked for in the same directory as
the current source file (that is the file that contains the #include
directive). If it is not found there, it is searched for in
the directories contained in the ULP directory path.
Portability note
| If filename contains a directory path, it is best to always use the forward slash as directory separator (even under Windows!). Windows drive letters should be avoided. This way a User Language Program will run on all platforms. |
#require versionThe version must be given as a real constant of the form
V.RRrrwhere V is the version number, RR is the release number and rr is the (optional) revision number (both padded with leading zeros if they are less than 10). For example, if a ULP requires at least EAGLE version 4.11r06 (which is the beta version that first implemented the #require directive), it could use
#require 4.1106The proper directive for version 5.1.2 would be
#require 5.0102
#usage text [, text...]implements a standard way to make this information available.
If the #usage directive is present, its text (which has to be a string constant) will be used in the Control Panel to display a description of the program.
In case the ULP needs to use this information in, for example, a dlgMessageBox(), the text is available to the program through the builtin constant usage.
Only the #usage directive of the main program file (that is the one started with the RUN command) will take effect. Therefore pure include files can (and should!) also have #usage directives of their own.
It is best to have the #usage directive at the beginning of the file, so that the Control Panel doesn't have to parse all the rest of the text when looking for the information to display.
If the usage information shall be made available in several langauges, the texts of the individual languages have to be separated by commas. Each of these texts has to start with the two letter code of the respective language (as delivered by the language() function), followed by a colon and any number of blanks. If no suitable text is found for the language used on the actual system, the first given text will be used (this one should generally be English in order to make the program accessible to the largest number of users).
#usage "en: A sample ULP\n" "Implements an example that shows how to use the EAGLE User Language\n" "Usage: RUN sample.ulp\n" "Author<EMAIL_ADDRESS>"de: Beispiel eines ULPs\n" "Implementiert ein Beispiel das zeigt, wie man die EAGLE User Language benutzt\n" "Aufruf: RUN sample.ulp\n" "Author<EMAIL_ADDRESS>break case char continue default do else enum for if int numeric real return string switch void whileIn addition, the names of builtins and object types are also reserved and must not be used as identifier names.
Identifiers consist of a sequence of letters (a b c..., A B C...), digits (1 2 3...) and underscores (_). The first character of an identifier must be a letter or an underscore.
Identifiers are case-sensitive, which means that
int Number, number;would define two different integer variables.
The maximum length of an identifier is 100 characters, and all of these
are significant.
Constants
Constants are literal data items written into a User Language Program.
According to the different data types,
there are also different types of constants.
'a' '=' '\n'The type of a character constant is char.
| first | second | constant interpreted as | ||
| 0 | 1-7 | octal (base 8) | ||
| 0 | x,X | hexadecimal (base 16) | ||
| 1-9 | decimal (base 10) |
The type of an integer constant is int.
| 16 | decimal | |
| 020 | octal | |
| 0x10 | hexadecimal |
[-]int.frac[e|E[±]exp]which stands for
The type of an real constant is real.
| Constant | Value | |
| 23.45e6 | 23.45 x 10^6 | |
| .0 | 0.0 | |
| 0. | 0.0 | |
| 1. | 1.0 | |
| -1.23 | -1.23 | |
| 2e-5 | 2.0 x 10^-5 | |
| 3E+10 | 3.0 x 10^10 | |
| .09E34 | 0.09 x 10^34 |
"Hello world\n"The type of a string constant is string.
String constants can be of any length (provided there is enough free memory available).
String constants can be concatenated by simply writing them next to each other to form larger strings:
string s = "Hello" " world\n";It is also possible to extend a string constant over more than one line by escaping the newline character with a backslash (\):
string s = "Hello \ world\n";
| Sequence | Value | |
| \a | audible bell | |
| \b | backspace | |
| \f | form feed | |
| \n | new line | |
| \r | carriage return | |
| \t | horizontal tab | |
| \v | vertical tab | |
| \\ | backslash | |
| \' | single quote | |
| \" | double quote | |
| \O | O = up to 3 octal digits | |
| \xH | H = up to 2 hex digits |
Any character following the initial backslash that is not mentioned in this list will be treated as that character (without the backslash).
Escape sequences can be used in character constants and string constants.
'\n' "A tab\tinside a text\n" "Ring the bell\a\n"
| [] | Brackets | |
| () | Parentheses | |
| {} | Braces | |
| , | Comma | |
| ; | Semicolon | |
| : | Colon | |
| = | Equal sign |
Other special characters are used as operators
in a ULP.
Brackets
Brackets are used in array definitions
int ai[];
in array subscripts
n = ai[2];
and in string subscripts to access the individual characters of a string
string s = "Hello world";
char c = s[2];
Parentheses
Parentheses group expressions
(possibly altering normal
operator precedence), isolate conditional
expressions, and indicate
function calls and function parameters:
d = c * (a + b); if (d == z) ++x; func(); void func2(int n) { ... }
if (d == z) { ++x; func(); }and are also used to group the values of an array initializer:
int ai[] = { 1, 2, 3 };
int func(int n, real r, string s) { ... } int i = func(1, 3.14, "abc");It also delimits the values of an array initializer:
int ai[] = { 1, 2, 3 };and it separates the elements of a variable definition:
int i, j, k;
i = a + b;and it also delimits the init, test and increment expressions of a for statement:
for (int n = 0; n < 3; ++n) { func(n); }
switch (c) { case 'a': printf("It was an 'a'\n"); break; case 'b': printf("It was a 'b'\n"); break; default: printf("none of them\n"); }
int i = 10; char c[] = { 'a', 'b', 'c' };It is also used as an assignment operator.
The four basic data types are
| char | for single characters | |
| int | for integral values | |
| real | for floating point values | |
| string | for textual information |
Besides these basic data types there are also high level Object Types, which represent the data structures stored in the EAGLE data files.
The special data type void is used only as a return type of a
function, indicating that this
function does not return any value.
A variable of type char has a size of 8 bit (one byte), and can
store any value in the range 0..255.
See also Operators,
Character Constants
A variable of type int has a size of 32 bit (four byte), and can
store any value in the range -2147483648..2147483647.
See also Integer Constants
A variable of type real has a size of 64 bit (eight byte), and can
store any value in the range ±2.2e-308..±1.7e+308 with a
precision of 15 digits.
See also Real Constants
A variable of type string is not limited in it's size (provided
there is enough memory available).
Variables of type string are defined without an explicit
size. They grow automatically as necessary during program
execution.
The elements of a string variable are of type
int and
can be accessed individually by using [index].
The first character of a string has the index 0:
A lossless conversion to char is possible
for standard ASCII strings:
See also Operators,
Builtin Functions,
String Constants
Arithmetic types are
char,
int and
real
(in that order). So if, e.g. a is of type
int
and b is of type
real,
the result of the expression a + b would be
real.
See also Typecast
The general syntax of a typecast is
When typecasting a real expression to
int, the fractional part of the value
is truncated!
See also Type Conversions
The properties of these objects can be accessed through members.
There are two kinds of members:
Loop members are used to access multiple objects of the same
kind, which are contained in a higher level object:
Loop members process objects in alpha-numerical order, provided they
have a name.
A loop member function creates a variable of the type necessary to hold
the requested objects. You are free to use any valid name for such a
variable, so the above example might also be written as
char
The data type char is used to store single characters, like the
letters of the alphabet, or small unsigned numbers.
int
The data type int is used to store signed integral values, like the
coordinates of an object.
real
The data type real is used to store signed floating point values, like
the grid distance.
string
The data type string is used to store textual information,
like the name of a part or net.
string s = "Layout";
printf("Third char is: %c\n", s[2]);
This would print the character 'y'. Note that s[2] returns
the third character of s!
string s = "Layout";
char c = s[2];
Implementation details
The data type string is actually implemented like native C-type
zero terminated strings. Looking at the following variable definition
string s = "abcde";
s[4] is the character 'e', and s[5] is the character
'\0', or the integer value 0x00.
This fact may be used to determine the end of a string without using the
strlen() function, as in
for (int i = 0; s[i]; ++i) {
// do something with s[i]
}
It is also perfectly ok to "cut off" part of a string by "punching" a zero
character into it:
string s = "abcde";
s[3] = 0;
This will result in s having the value "abc".
Note that everything following the zero character will actually be gone,
and it won't come back by restoring the original character. The same applies
to any other operation that sets a character to 0, for instance --s[3].
Type Conversions
The result type of an arithmetic
expression, such as a + b,
where a and b are different arithmetic types,
is equal to the "larger" of the two operand types.
Typecast
The result type of an arithmetic expression
can be explicitly converted to a different arithmetic type by applying a
typecast to it.
type(expression)
where type is one of
char,
int or
real,
and expression is any arithmetic
expression.
Object Types
The EAGLE data structures are stored in XML files:
These data files contain a hierarchy of objects.
In a User Language Program you can access these hierarchies through their
respective builtin access statements:
library(L) { ... }
schematic(S) { ... }
board(B) { ... }
These access statements set up a context within which you can access all of the
objects contained in the library, schematic or board.
Data members immediately return the requested data from an object.
For example, in
board(B) {
printf("%s\n", B.name);
}
the data member name of the board object B returns
the board's name.
Data members can also return other objects, as in
board(B) {
printf("%f\n", B.grid.size);
}
where the board's grid data member returns a grid object,
of which the size data member then returns the grid's size.
board(B) {
B.elements(E) {
printf("%-8s %-8s\n", E.name, E.value);
}
}
This example uses the board's elements() loop member function
to set up a loop through all of the board's elements. The block following
the B.elements(E) statement is executed in turn for each element,
and the current element can be referenced inside the block through the name
E.
board(MyBoard) {
MyBoard.elements(TheCurrentElement) {
printf("%-8s %-8s\n", TheCurrentElement.name, TheCurrentElement.value);
}
}
and would do the exact same thing. The scope of the variable created by a
loop member function is limited to the statement (or block) immediately
following the loop function call.
Object hierarchy of a Library:
LIBRARY
GRID
LAYER
DEVICESET
DEVICE
GATE
PACKAGE
CONTACT
PAD
SMD
CIRCLE
HOLE
RECTANGLE
FRAME
DIMENSION
TEXT
WIRE
POLYGON
WIRE
SYMBOL
PIN
CIRCLE
RECTANGLE
FRAME
DIMENSION
TEXT
WIRE
POLYGON
WIRE
Object hierarchy of a Schematic:
SCHEMATIC
GRID
LAYER
LIBRARY
ATTRIBUTE
VARIANTDEF
PART
ATTRIBUTE
VARIANT
SHEET
CIRCLE
RECTANGLE
FRAME
DIMENSION
TEXT
WIRE
POLYGON
WIRE
INSTANCE
ATTRIBUTE
MODULEINST
BUS
SEGMENT
LABEL
TEXT
WIRE
WIRE
NET
SEGMENT
JUNCTION
PINREF
PORTREF
TEXT
WIRE
MODULE
PORT
PART
SHEET
(same as above)
Change note from version 5 to version 6, compatibility
For compatibility reasons the access by the according member functions is further supported,
but the behaviour of the Object Functions reflects the new hierarchy.
Object hierarchy of a Board:
BOARD
GRID
LAYER
LIBRARY
ATTRIBUTE
VARIANTDEF
CIRCLE
HOLE
RECTANGLE
FRAME
DIMENSION
TEXT
WIRE
POLYGON
WIRE
ELEMENT
ATTRIBUTE
VARIANT
SIGNAL
CONTACTREF
POLYGON
WIRE
VIA
WIRE
UL_ARC
See also UL_WIRE
Constants
| CAP_FLAT | flat arc ends | |
| CAP_ROUND | round arc ends |
board(B) { B.wires(W) { if (W.arc) printf("Arc: (%f %f), (%f %f), (%f %f)\n", u2mm(W.arc.x1), u2mm(W.arc.y1), u2mm(W.arc.x2), u2mm(W.arc.y2), u2mm(W.arc.xc), u2mm(W.arc.yc)); } }
A UL_AREA is an abstract object which gives information about the area covered by an object. For a UL_PACKAGE or UL_SYMBOL in a UL_ELEMENT or UL_INSTANCE context, respectively, the area is given in absolute drawing coordinates, including the offset of the element or instance and including the area of moved texts after SMASH.
board(B) { printf("Area: (%f %f), (%f %f)\n", u2mm(B.area.x1), u2mm(B.area.y1), u2mm(B.area.x2), u2mm(B.area.y2)); }
| constant | int (0=variable, i.e. allows overwriting, 1=constant - see note) | |
| defaultvalue | string (see note) | |
| display | int (ATTRIBUTE_DISPLAY_FLAG_...) | |
| name | string | |
| text | UL_TEXT (see note) | |
| value | string |
| ATTRIBUTE_DISPLAY_FLAG_OFF | nothing is displayed | |
| ATTRIBUTE_DISPLAY_FLAG_VALUE | value is displayed | |
| ATTRIBUTE_DISPLAY_FLAG_NAME | name is displayed |
A UL_ATTRIBUTE can be used to access the attributes that have been defined in the library for a device, or assigned to a part in the schematic or board.
In a UL_ELEMENT context constant only returns an actual value if f/b annotation is active, otherwise it returns 0.
The defaultvalue member returns the value as defined in the library (if different from the actual value, otherwise the same as value). In a UL_ELEMENT context defaultvalue only returns an actual value if f/b annotation is active, otherwise an empty string is returned.
The text member is only available in a UL_INSTANCE or UL_ELEMENT context and returns a UL_TEXT object that contains all the text parameters. The value of this text object is the string as it will be displayed according to the UL_ATTRIBUTE's 'display' parameter. If called from a different context, the data of the returned UL_TEXT object is undefined.
For global attributes only name and value are defined.
schematic(SCH) { SCH.parts(P) { P.attributes(A) { printf("%s = %s\n", A.name, A.value); } } } schematic(SCH) { SCH.attributes(A) { // global attributes printf("%s = %s\n", A.name, A.value); } }
| alwaysvectorfont | int (ALWAYS_VECTOR_FONT_..., see note) | |
| area | UL_AREA | |
| description | string | |
| grid | UL_GRID | |
| headline | string | |
| name | string (see note) | |
| verticaltext | int (VERTICAL_TEXT_...) |
| attributes() | UL_ATTRIBUTE (see note) | |
| circles() | UL_CIRCLE | |
| classes() | UL_CLASS | |
| dimensions() | UL_DIMENSION | |
| elements() | UL_ELEMENT | |
| frames() | UL_FRAME | |
| holes() | UL_HOLE | |
| layers() | UL_LAYER | |
| libraries() | UL_LIBRARY | |
| polygons() | UL_POLYGON | |
| rectangles() | UL_RECTANGLE | |
| signals() | UL_SIGNAL | |
| texts() | UL_TEXT | |
| variantdefs() | UL_VARIANTDEF | |
| wires() | UL_WIRE |
| ALWAYS_VECTOR_FONT_GUI | alwaysvectorfont is set in the user interface dialog | |
| ALWAYS_VECTOR_FONT_PERSISTENT | alwaysvectorfont is set persistent in this board |
| VERTICAL_TEXT_UP | reading direction for vertical texts: up | |
| VERTICAL_TEXT_DOWN | reading direction for vertical texts: down |
if (B.alwaysvectorfont) { // alwaysvectorfont is set in general } if (B.alwaysvectorfont & ALWAYS_VECTOR_FONT_GUI) { // alwaysvectorfont is set in the user interface }The name member returns the full file name, including the directory.
The attributes() loop member loops through the global attributes.
board(B) { B.elements(E) printf("Element: %s\n", E.name); B.signals(S) printf("Signal: %s\n", S.name); }
| name | string (BUS_NAME_LENGTH) |
| segments() | UL_SEGMENT |
| BUS_NAME_LENGTH | max. length of a bus name (obsolete - as from version 4 bus names can have any length) |
schematic(SCH) { SCH.sheets(SH) { SH.busses(B) printf("Bus: %s\n", B.name); } }
board(B) { B.circles(C) { printf("Circle: (%f %f), r=%d, w=%d\n", u2mm(C.x), u2mm(C.y), u2mm(C.radius), u2mm(C.width)); } }
If the name member returns an empty string, the net class is not defined and therefore not in use by any signal or net.
board(B) { B.signals(S) { printf("%-10s %d %s\n", S.name, S.class.number, S.class.name); } }
| name | string (CONTACT_NAME_LENGTH) | |
| pad | UL_PAD | |
| signal | string | |
| smd | UL_SMD | |
| x, y | int (center point, see note) |
| polygons() | UL_POLYGON (of arbitrary pad shapes) | |
| wires() | UL_WIRE (of arbitrary pad shapes) |
| CONTACT_NAME_LENGTH | max. recommended length of a contact name (used in formatted output only) |
The coordinates (x, y) of the contact depend on the context in which it is called:
library(L) { L.packages(PAC) { PAC.contacts(C) { printf("Contact: '%s', (%f %f)\n", C.name, u2mm(C.x), u2mm(C.y)); } } }
| contact | UL_CONTACT | |
| element | UL_ELEMENT | |
| route | int (CONTACT_ROUTE_...) | |
| routetag | string (see note) |
| CONTACT_ROUTE_ALL | must explicitly route to all contacts | |
| CONTACT_ROUTE_ANY | may route to any contact |
board(B) { B.signals(S) { printf("Signal '%s'\n", S.name); S.contactrefs(C) { printf("\t%s, %s\n", C.element.name, C.contact.name); } } }
| activetechnology | string (see note) | |
| area | UL_AREA | |
| description | string | |
| headline | string | |
| library | string | |
| name | string (DEVICE_NAME_LENGTH) | |
| package | UL_PACKAGE (see note) | |
| prefix | string (DEVICE_PREFIX_LENGTH) | |
| technologies | string (see note) | |
| value | string ("On" or "Off") |
| attributes() | UL_ATTRIBUTE (see note) | |
| gates() | UL_GATE |
| DEVICE_NAME_LENGTH | max. recommended length of a device name (used in formatted output only) | |
| DEVICE_PREFIX_LENGTH | max. recommended length of a device prefix (used in formatted output only) |
All members of UL_DEVICE, except for name and technologies, return the same values as the respective members of the UL_DEVICESET in which the UL_DEVICE has been defined. The name member returns the name of the package variant this device has been created for using the PACKAGE command. When using the description text keep in mind that it may contain newline characters ('\n').
The package data member returns the package that has been assigned to the device through a PACKAGE command. It can be used as a boolean function to check whether a package has been assigned to a device (see example below).
The value returned by the technologies member depends on the context in which it is called:
The attributes() loop member takes an additional parameter that specifies for which technology the attributes shall be delivered (see the second example below).
library(L) { L.devicesets(S) { S.devices(D) { if (D.package) printf("Device: %s, Package: %s\n", D.name, D.package.name); D.gates(G) { printf("\t%s\n", G.name); } } } }
library(L) { L.devicesets(DS) { DS.devices(D) { string t[]; int n = strsplit(t, D.technologies, ' '); for (int i = 0; i < n; i++) { D.attributes(A, t[i]) { printf("%s = %s\n", A.name, A.value); } } } } }
| activedevice | UL_DEVICE (see note) | |
| area | UL_AREA | |
| description | string | |
| headline | string (see note) | |
| library | string | |
| name | string (DEVICE_NAME_LENGTH) | |
| prefix | string (DEVICE_PREFIX_LENGTH) | |
| value | string ("On" or "Off") |
| devices() | UL_DEVICE | |
| gates() | UL_GATE |
| DEVICE_NAME_LENGTH | max. recommended length of a device name (used in formatted output only) | |
| DEVICE_PREFIX_LENGTH | max. recommended length of a device prefix (used in formatted output only) |
The description member returns the complete descriptive text as defined with the DESCRIPTION command, while the headline member returns only the first line of the description, without any HTML tags. When using the description text keep in mind that it may contain newline characters ('\n').
library(L) { L.devicesets(D) { printf("Device set: %s, Description: %s\n", D.name, D.description); D.gates(G) { printf("\t%s\n", G.name); } } }
if (deviceset) deviceset(DS) { if (DS.activedevice) printf("Active Device: %s\n", DS.activedevice.name); }
| dtype | int (DIMENSION_...) | |
| layer | int | |
| extlength | int | |
| extoffset | int | |
| extwidth | int | |
| precision | int | |
| ratio | int | |
| size | int | |
| unit | int (GRID_UNIT_...) | |
| visible | int (unit, 0=off, 1=on) | |
| width | int | |
| x1, y1 | int (first reference point) | |
| x2, y2 | int (second reference point) | |
| x3, y3 | int (alignment reference point) |
| texts() | UL_TEXT | |
| wires() | UL_WIRE |
| DIMENSION_PARALLEL | linear dimension with parallel measurement line | |
| DIMENSION_HORIZONTAL | linear dimension with horizontal measurement line | |
| DIMENSION_VERTICAL | linear dimension with vertical measurement line | |
| DIMENSION_RADIUS | radial dimension | |
| DIMENSION_DIAMETER | diameter dimension | |
| DIMENSION_ANGLE | angle dimension | |
| DIMENSION_LEADER | an arbitrary pointer |
board(B) { B.dimensions(D) { printf("Dimension: (%f %f), (%f %f), (%f %f)\n", u2mm(D.x1), u2mm(D.y1), u2mm(D.x2), u2mm(D.y2), u2mm(D.x3), u2mm(D.y3)); } }
| angle | real (0.0...359.9) | |
| attribute[] | string (see note) | |
| column | string (see note) | |
| locked | int | |
| mirror | int | |
| name | string (ELEMENT_NAME_LENGTH) | |
| package | UL_PACKAGE | |
| populate | int (0=do not populate, 1=populate) | |
| row | string (see note) | |
| smashed | int (see note) | |
| spin | int | |
| value | string (ELEMENT_VALUE_LENGTH) | |
| x, y | int (origin point) |
| attributes() | UL_ATTRIBUTE | |
| texts() | UL_TEXT (see note) |
| ELEMENT_NAME_LENGTH | max. recommended length of an element name (used in formatted output only) | |
| ELEMENT_VALUE_LENGTH | max. recommended length of an element value (used in formatted output only) |
The texts() member only loops through those texts of the element that have been detached using SMASH, and through the visible texts of any attributes assigned to this element. To process all texts of an element (e.g. when drawing it), you have to loop through the element's own texts() member as well as the texts() member of the element's package.
angle defines how many degrees the element is rotated counterclockwise around its origin.
The column and row members return the column and row location within the frame in the board drawing. If there is no frame in the drawing, or the element is placed outside the frame, a '?' (question mark) is returned.
The smashed member tells whether the element is smashed. This function can also be used to find out whether there is a detached text parameter by giving the name of that parameter in square brackets, as in smashed["VALUE"]. This is useful in case you want to select such a text with the MOVE command by doing MOVE R5>VALUE. Valid parameter names are "NAME" and "VALUE", as well as the names of any user defined attributes. They are treated case insensitive, and they may be preceded by a '>' character.
board(B) { B.elements(E) { printf("Element: %s, (%f %f), Package=%s\n", E.name, u2mm(E.x), u2mm(E.y), E.package.name); } }
board(B) { B.elements(E) { if (E.attribute["REMARK"]) printf("%s: %s\n", E.name, E.attribute["REMARK"]); } }
| columns | int (-127...127) | |
| rows | int (-26...26) | |
| border | int (FRAME_BORDER_...) | |
| layer | int | |
| x1, y1 | int (lower left corner) | |
| x2, y2 | int (upper right corner) |
| texts() | UL_TEXT | |
| wires() | UL_WIRE |
| FRAME_BORDER_BOTTOM | bottom border is drawn | |
| FRAME_BORDER_RIGHT | right border is drawn | |
| FRAME_BORDER_TOP | top border is drawn | |
| FRAME_BORDER_LEFT | left border is drawn |
The texts() and wires() loop members loop through all the texts and wires the frame consists of.
board(B) { B.frames(F) { printf("Frame: (%f %f), (%f %f)\n", u2mm(F.x1), u2mm(F.y1), u2mm(F.x2), u2mm(F.y2)); } }
| addlevel | int (GATE_ADDLEVEL_...) | |
| name | string (GATE_NAME_LENGTH) | |
| swaplevel | int | |
| symbol | UL_SYMBOL | |
| x, y | int (origin point, see note) |
| GATE_ADDLEVEL_MUST | must | |
| GATE_ADDLEVEL_CAN | can | |
| GATE_ADDLEVEL_NEXT | next | |
| GATE_ADDLEVEL_REQUEST | request | |
| GATE_ADDLEVEL_ALWAYS | always |
| GATE_NAME_LENGTH | max. recommended length of a gate name (used in formatted output only) |
library(L) { L.devices(D) { printf("Device: %s, Package: %s\n", D.name, D.package.name); D.gates(G) { printf("\t%s, swaplevel=%d, symbol=%s\n", G.name, G.swaplevel, G.symbol.name); } } }
| distance | real | |
| dots | int (0=lines, 1=dots) | |
| multiple | int | |
| on | int (0=off, 1=on) | |
| unit | int (GRID_UNIT_...) | |
| unitdist | int (GRID_UNIT_...) |
| GRID_UNIT_MIC | microns | |
| GRID_UNIT_MM | millimeter | |
| GRID_UNIT_MIL | mil | |
| GRID_UNIT_INCH | inch |
board(B) { printf("Gridsize=%f\n", B.grid.distance); }
drillsymbol returns the number of the drill symbol that has been assigned to this drill diameter (see the manual for a list of defined drill symbols). A value of 0 means that no symbol has been assigned to this drill diameter.
board(B) { B.holes(H) { printf("Hole: (%f %f), drill=%f\n", u2mm(H.x), u2mm(H.y), u2mm(H.drill)); } }
| angle | real (0, 90, 180 and 270) | |
| column | string (see note) | |
| gate | UL_GATE | |
| mirror | int | |
| name | string (INSTANCE_NAME_LENGTH) | |
| part | UL_PART | |
| row | string (see note) | |
| sheet | int (0=unused, >0=sheet number) | |
| smashed | int (see note) | |
| value | string (PART_VALUE_LENGTH) | |
| x, y | int (origin point) |
| attributes() | UL_ATTRIBUTE (see note) | |
| texts() | UL_TEXT (see note) | |
| xrefs() | UL_GATE (see note) |
| INSTANCE_NAME_LENGTH | max. recommended length of an instance name (used in formatted output only) | |
| PART_VALUE_LENGTH | max. recommended length of a part value (instances do not have a value of their own!) |
The texts() member only loops through those texts of the instance that have been detached using SMASH, and through the visible texts of any attributes assigned to this instance. To process all texts of an instance, you have to loop through the instance's own texts() member as well as the texts() member of the instance's gate's symbol. If attributes have been assigned to an instance, texts() delivers their texts in the form as they are currently visible.
The column and row members return the column and row location within the frame on the sheet on which this instance is invoked. If there is no frame on that sheet, or the instance is placed outside the frame, a '?' (question mark) is returned. These members can only be used in a sheet context.
The smashed member tells whether the instance is smashed. This function can also be used to find out whether there is a detached text parameter by giving the name of that parameter in square brackets, as in smashed["VALUE"]. This is useful in case you want to select such a text with the MOVE command by doing MOVE R5>VALUE. Valid parameter names are "NAME", "VALUE", "PART" and "GATE", as well as the names of any user defined attributes. They are treated case insensitive, and they may be preceded by a '>' character.
The xrefs() member loops through the contact cross-reference gates of this instance. These are only of importance if the ULP is going to create a drawing of some sort (for instance a DXF file).
schematic(S) { S.parts(P) { printf("Part: %s\n", P.name); P.instances(I) { if (I.sheet != 0) printf("\t%s used on sheet %d\n", I.name, I.sheet); } } }
schematic(SCH) { SCH.sheets(SH) { SH.nets(N) { N.segments(SEG) { SEG.junctions(J) { printf("Junction: (%f %f)\n", u2mm(J.x), u2mm(J.y)); } } } } }
| angle | real (0.0...359.9) | |
| layer | int | |
| mirror | int | |
| spin | int | |
| text | UL_TEXT | |
| x, y | int (origin point) | |
| xref | int (0=plain, 1=cross-reference) |
| wires() | UL_WIRE (see note) |
The angle, layer, mirror and spin members always return the same values as those of the UL_TEXT object returned by the text member. The x and y members of the text return slightly offset values for cross-reference labels (non-zero xref), otherwise they also return the same values as the UL_LABEL.
xref is only meaningful for net labels. For bus labels it always returns 0.
sheet(SH) { SH.nets(N) { N.segments(S) { S.labels(L) { printf("Label: (%f %f) '%s'", u2mm(L.x), u2mm(L.y), L.text.value); } } } }
| color | int | |
| fill | int | |
| name | string (LAYER_NAME_LENGTH) | |
| number | int | |
| used | int (0=unused, 1=used) | |
| visible | int (0=off, 1=on) |
| LAYER_NAME_LENGTH | max. recommended length of a layer name (used in formatted output only) | |
| LAYER_TOP | layer numbers | |
| LAYER_BOTTOM | ||
| LAYER_PADS | ||
| LAYER_VIAS | ||
| LAYER_UNROUTED | ||
| LAYER_DIMENSION | ||
| LAYER_TPLACE | ||
| LAYER_BPLACE | ||
| LAYER_TORIGINS | ||
| LAYER_BORIGINS | ||
| LAYER_TNAMES | ||
| LAYER_BNAMES | ||
| LAYER_TVALUES | ||
| LAYER_BVALUES | ||
| LAYER_TSTOP | ||
| LAYER_BSTOP | ||
| LAYER_TCREAM | ||
| LAYER_BCREAM | ||
| LAYER_TFINISH | ||
| LAYER_BFINISH | ||
| LAYER_TGLUE | ||
| LAYER_BGLUE | ||
| LAYER_TTEST | ||
| LAYER_BTEST | ||
| LAYER_TKEEPOUT | ||
| LAYER_BKEEPOUT | ||
| LAYER_TRESTRICT | ||
| LAYER_BRESTRICT | ||
| LAYER_VRESTRICT | ||
| LAYER_DRILLS | ||
| LAYER_HOLES | ||
| LAYER_MILLING | ||
| LAYER_MEASURES | ||
| LAYER_DOCUMENT | ||
| LAYER_REFERENCE | ||
| LAYER_TDOCU | ||
| LAYER_BDOCU | ||
| LAYER_NETS | ||
| LAYER_BUSSES | ||
| LAYER_PINS | ||
| LAYER_SYMBOLS | ||
| LAYER_NAMES | ||
| LAYER_VALUES | ||
| LAYER_INFO | ||
| LAYER_GUIDE | ||
| LAYER_USER | lowest number for user defined layers (100) |
board(B) { B.layers(L) printf("Layer %3d %s\n", L.number, L.name); }
| description | string (see note) | |
| grid | UL_GRID | |
| headline | string | |
| name | string (LIBRARY_NAME_LENGTH, see note) |
| devices() | UL_DEVICE | |
| devicesets() | UL_DEVICESET | |
| layers() | UL_LAYER | |
| packages() | UL_PACKAGE | |
| symbols() | UL_SYMBOL |
| LIBRARY_NAME_LENGTH | max. recommended length of a library name (used in formatted output only) |
The devices() member loops through all the package variants and technologies of all UL_DEVICESETs in the library, thus resulting in all the actual device variations available. The devicesets() member only loops through the UL_DEVICESETs, which in turn can be queried for their UL_DEVICE members.
If the library is derived form a UL_BOARD or UL_SCHEMATIC context, name returns the pure library name (without path or extension). Otherwise it returns the full library file name.
library(L) { L.devices(D) printf("Dev: %s\n", D.name); L.devicesets(D) printf("Dev: %s\n", D.name); L.packages(P) printf("Pac: %s\n", P.name); L.symbols(S) printf("Sym: %s\n", S.name); } schematic(S) { S.libraries(L) printf("Library: %s\n", L.name); }
| dx, dy | int (size) | |
| description | string | |
| headline | string | |
| name | string | |
| prefix | string |
| parts() | UL_PART | |
| ports() | UL_PORT | |
| sheets() | UL_SHEET | |
| variantdefs() | UL_VARIANTDEF |
schematic(SCH) { SCH.modules(M) { M.parts(P) printf("Part: %s\n", P.name); } }
| angle | real (0, 90, 180 and 270) | |
| column | string (see note) | |
| mirror | int | |
| module | UL_MODULE | |
| modulevariant | string (selected variantdef of module) | |
| name | string (INSTANCE_NAME_LENGTH) | |
| offset | int | |
| row | string (see note) | |
| sheet | int (sheet number) | |
| smashed | int (see note) | |
| x, y | int (origin point) |
| texts() | UL_TEXT (see note) | |
| wires() | UL_WIRE |
| INSTANCE_NAME_LENGTH | max. recommended length of an instance name (used in formatted output only) |
The column and row members return the column and row location within the frame on the sheet on which this instance is invoked. If there is no frame on that sheet, or the instance is placed outside the frame, a '?' (question mark) is returned. These members can only be used in a sheet context.
The smashed member tells whether the instance is smashed. This function can also be used to find out whether there is a detached text parameter by giving the name of that parameter in square brackets, as in smashed["NAME"]. This is useful in case you want to select such a text with the MOVE command by doing MOVE MOD1>NAME.
schematic(SCH) { SCH.sheets(SH) { SH.moduleinsts(MI) { printf("Module instance %s is located on sheet %d\n", MI.name, MI.sheet); } } }
| class | UL_CLASS | |
| column | string (see note) | |
| name | string (NET_NAME_LENGTH) | |
| row | string (see note) |
| portrefs() | UL_PORTREF | |
| pinrefs() | UL_PINREF (see note) | |
| segments() | UL_SEGMENT (see note) |
| NET_NAME_LENGTH | max. recommended length of a net name (used in formatted output only) |
The column and row members return the column and row locations within the frame on the sheet on which this net is drawn. Since a net can extend over a certain area, each of these functions returns two values, separated by a blank. In case of column these are the left- and rightmost columns touched by the net, and in case of row it's the top- and bottommost row.
When determining the column and row of a net on a sheet, first the column and then the row within that column is taken into account. Here XREF labels take precedence over normal labels, which again take precedence over net wires.
If there is no frame on that sheet, "? ?" (two question marks) is returned. If any part of the net is placed outside the frame, either of the values may be '?' (question mark). These members can only be used in a sheet context.
schematic(S) { S.nets(N) { printf("Net: %s\n", N.name); // N.segments(SEG) will NOT work here! } } schematic(S) { S.sheets(SH) { SH.nets(N) { printf("Net: %s\n", N.name); N.segments(SEG) { SEG.wires(W) { printf("\tWire: (%f %f) (%f %f)\n", u2mm(W.x1), u2mm(W.y1), u2mm(W.x2), u2mm(W.y2)); } } } } }
| area | UL_AREA | |
| description | string | |
| headline | string | |
| library | string | |
| name | string (PACKAGE_NAME_LENGTH) |
| circles() | UL_CIRCLE | |
| contacts() | UL_CONTACT | |
| dimensions() | UL_DIMENSION | |
| frames() | UL_FRAME | |
| holes() | UL_HOLE | |
| polygons() | UL_POLYGON (see note) | |
| rectangles() | UL_RECTANGLE | |
| texts() | UL_TEXT (see note) | |
| wires() | UL_WIRE (see note) |
| PACKAGE_NAME_LENGTH | max. recommended length of a package name (used in formatted output only) |
If the UL_PACKAGE is derived from a UL_ELEMENT, the texts() member only loops through the non-detached texts of that element.
If the UL_PACKAGE is derived from a UL_ELEMENT, polygons and wires belonging to contacts with arbitrary pad shapes are available through the loop members polygons() and wires() of this contact.
library(L) { L.packages(PAC) { printf("Package: %s\n", PAC.name); PAC.contacts(C) { if (C.pad) printf("\tPad: %s, (%f %f)\n", C.name, u2mm(C.pad.x), u2mm(C.pad.y)); else if (C.smd) printf("\tSmd: %s, (%f %f)\n", C.name, u2mm(C.smd.x), u2mm(C.smd.y)); } } } board(B) { B.elements(E) { printf("Element: %s, Package: %s\n", E.name, E.package.name); } }
| angle | real (0.0...359.9) | |
| diameter[layer] | int | |
| drill | int | |
| drillsymbol | int | |
| elongation | int | |
| flags | int (PAD_FLAG_...) | |
| name | string (PAD_NAME_LENGTH) | |
| shape[layer] | int (PAD_SHAPE_...) | |
| signal | string | |
| x, y | int (center point, see note) |
| PAD_FLAG_STOP | generate stop mask | |
| PAD_FLAG_THERMALS | generate thermals | |
| PAD_FLAG_FIRST | use special "first pad" shape |
| PAD_SHAPE_SQUARE | square | |
| PAD_SHAPE_ROUND | round | |
| PAD_SHAPE_OCTAGON | octagon | |
| PAD_SHAPE_LONG | long | |
| PAD_SHAPE_OFFSET | offset |
| PAD_NAME_LENGTH | max. recommended length of a pad name (same as CONTACT_NAME_LENGTH) |
The diameter and shape of the pad depend on the layer for which they shall be retrieved, because they may be different in each layer depending on the Design Rules. If one of the layers LAYER_TOP...LAYER_BOTTOM, LAYER_TSTOP or LAYER_BSTOP is given as the index to the diameter or shape data member, the resulting value will be calculated according to the Design Rules. If LAYER_PADS is given, the raw value as defined in the library will be returned.
drillsymbol returns the number of the drill symbol that has been assigned to this drill diameter (see the manual for a list of defined drill symbols). A value of 0 means that no symbol has been assigned to this drill diameter.
angle defines how many degrees the pad is rotated counterclockwise around its center.
elongation is only valid for shapes PAD_SHAPE_LONG and PAD_SHAPE_OFFSET and defines how many percent the long side of such a pad is longer than its small side. This member returns 0 for any other pad shapes.
The value returned by flags must be masked with the PAD_FLAG_... constants to determine the individual flag settings, as in
if (pad.flags & PAD_FLAG_STOP) { ... }Note that if your ULP just wants to draw the objects, you don't need to check these flags explicitly. The diameter[] and shape[] members will return the proper data; for instance, if PAD_FLAG_STOP is set, diameter[LAYER_TSTOP] will return 0, which should result in nothing being drawn in that layer. The flags member is mainly for ULPs that want to create script files that create library objects.
library(L) { L.packages(PAC) { PAC.contacts(C) { if (C.pad) printf("Pad: '%s', (%f %f), d=%f\n", C.name, u2mm(C.pad.x), u2mm(C.pad.y), u2mm(C.pad.diameter[LAYER_BOTTOM])); } } }
| attribute[] | string (see note) | |
| device | UL_DEVICE | |
| deviceset | UL_DEVICESET | |
| name | string (PART_NAME_LENGTH) | |
| populate | int (0=do not populate, 1=populate) | |
| value | string (PART_VALUE_LENGTH) |
| attributes() | UL_ATTRIBUTE (see note) | |
| instances() | UL_INSTANCE (see note) | |
| variants() | UL_VARIANT |
| PART_NAME_LENGTH | max. recommended length of a part name (used in formatted output only) | |
| PART_VALUE_LENGTH | max. recommended length of a part value (used in formatted output only) |
When looping through the attributes() of a UL_PART, only the name, value, defaultvalue and constant members of the resulting UL_ATTRIBUTE objects are valid.
If the part is in a sheet context, the instances() loop member loops only through those instances that are actually used on that sheet. If the part is in a schematic context, all instances are looped through.
schematic(S) { S.parts(P) printf("Part: %s\n", P.name); }
schematic(SCH) { SCH.parts(P) { if (P.attribute["REMARK"]) printf("%s: %s\n", P.name, P.attribute["REMARK"]); } }
| angle | real (0, 90, 180 and 270) | |
| contact | UL_CONTACT (deprecated, see note) | |
| direction | int (PIN_DIRECTION_...) | |
| function | int (PIN_FUNCTION_FLAG_...) | |
| length | int (PIN_LENGTH_...) | |
| name | string (PIN_NAME_LENGTH) | |
| net | string (see note) | |
| route | int (CONTACT_ROUTE_...) | |
| swaplevel | int | |
| visible | int (PIN_VISIBLE_FLAG_...) | |
| x, y | int (connection point) |
| circles() | UL_CIRCLE | |
| contacts() | UL_CONTACT (see note) | |
| texts() | UL_TEXT | |
| wires() | UL_WIRE |
| PIN_DIRECTION_NC | not connected | |
| PIN_DIRECTION_IN | input | |
| PIN_DIRECTION_OUT | output (totem-pole) | |
| PIN_DIRECTION_IO | in/output (bidirectional) | |
| PIN_DIRECTION_OC | open collector | |
| PIN_DIRECTION_PWR | power input pin | |
| PIN_DIRECTION_PAS | passive | |
| PIN_DIRECTION_HIZ | high impedance output | |
| PIN_DIRECTION_SUP | supply pin |
| PIN_FUNCTION_FLAG_NONE | no symbol | |
| PIN_FUNCTION_FLAG_DOT | inverter symbol | |
| PIN_FUNCTION_FLAG_CLK | clock symbol |
| PIN_LENGTH_POINT | no wire | |
| PIN_LENGTH_SHORT | 0.1 inch wire | |
| PIN_LENGTH_MIDDLE | 0.2 inch wire | |
| PIN_LENGTH_LONG | 0.3 inch wire |
| PIN_NAME_LENGTH | max. recommended length of a pin name (used in formatted output only) |
| PIN_VISIBLE_FLAG_OFF | no name drawn | |
| PIN_VISIBLE_FLAG_PAD | pad name drawn | |
| PIN_VISIBLE_FLAG_PIN | pin name drawn |
| CONTACT_ROUTE_ALL | must explicitly route to all contacts | |
| CONTACT_ROUTE_ANY | may route to any contact |
The contact data member returns the contact that has been assigned to the pin through a CONNECT command. This member is deprecated! It will work for backwards compatibility and as long as only one pad has been connected to the pin, but will cause a runtime error when used with a pin that is connected to more than one pad.
The route member also only makes sense if there's a relation to contacts the pin is connected to. Otherwise the value is set to 0.
The coordinates (and layer, in case of an SMD) of the contact returned by the contact data member depend on the context in which it is called:
The net data member returns the name of the net to which this pin is connected to (only available in a UL_SCHEMATIC context).
library(L) { L.symbols(S) { printf("Symbol: %s\n", S.name); S.pins(P) { printf("\tPin: %s, (%f %f)", P.name, u2mm(P.x), u2mm(P.y)); if (P.direction == PIN_DIRECTION_IN) printf(" input"); if ((P.function & PIN_FUNCTION_FLAG_DOT) != 0) printf(" inverted"); printf("\n"); } } }
| instance | UL_INSTANCE | |
| part | UL_PART | |
| pin | UL_PIN |
schematic(SCH) { SCH.sheets(SH) { printf("Sheet: %d\n", SH.number); SH.nets(N) { printf("\tNet: %s\n", N.name); N.segments(SEG) { SEG.pinrefs(P) { printf("connected to: %s, %s, %s\n", P.part.name, P.instance.name, P.pin.name); } } } } }
| isolate | int | |
| layer | int | |
| orphans | int (0=off, 1=on) | |
| pour | int (POLYGON_POUR_...) | |
| rank | int | |
| spacing | int | |
| thermals | int (0=off, 1=on) | |
| width | int |
| contours() | UL_WIRE (see note) | |
| fillings() | UL_WIRE | |
| wires() | UL_WIRE |
| POLYGON_POUR_SOLID | solid | |
| POLYGON_POUR_HATCH | hatch | |
| POLYGON_POUR_CUTOUT | cutout |