Headings:

10 - ModEdit: Managing LIBRARIES

10.1 - Overview of ModEdit

10.2 - ModEdit:

10.3 - ModEdit user interface:

10.4 - Main toolbar in Modedit:

10.5 - Creating a new module:

10.6 - Creating a new library:

10.7 - Saving a module to the active library:

10.8 - Transferring a module from one library to another:

10.9 - Saving all the modules of a circuit in the active library:

10.10 - Documentation for library modules:

10.11 - Documenting libraries – recommended practice:

ModEdit: Managing LIBRARIES

Overview of ModEdit

PCBNEW simultaneously maintains several libraries. Thus, when a module is loaded, all of the libraries that appear in the library list are searched until the first instance of the module is found. In what follows, note that the 'active library' is the library selected within the Module Editor (ModEdit), the program we shall now describe.

ModEdit enables the creation and editing of modules:

Adding and removing pads;

Changing pad properties (shape, layer) for individual pads or globally for all pads of a module;

Editing graphic elements (lines, text);

Editing information fields (value, reference, ...);

Editing the associated documentation (description, keywords).;

as well as the maintenance of the active library:

Listing the modules in the active library;

Deletion of a module from the active library;

Saving a module to the active library;

Saving all of the modules contained by a printed circuit.

It is also possible to create new libraries.

A library is in fact made up of two files:

The library itself (file extension .lib)

The associated documentation (file extension .dcm)

The documentation file is systematically regenerated after each modication of the corresponding .lib file; in this way it can easily be recovered if lost. The documentation file serves to accelerate access to module documentation.

ModEdit:

The Module Editor can be accessed in two ways:

Directly, via the icon in the main toolbar of Pcbnew;

In the edit dialogue for the active module (see figure below; accessed via the context menu), there is a button (Goto Module Editor).
In this case, the active module of the board will be loaded automatically in ModEdit, enabling immediate editing (or achiving).

ModEdit user interface:

Calling ModEdit causes the following window to appear:

Main toolbar in Modedit:

The following functions are available:

	Select the active library.
	Save the current module to the active library.
	Create a new library and save the current module in it.
	Access a dialogue for deleting a module from the active library.
	Create a new module.
	Load a module from the active library.
	Load (import) a module from the printed circuit board.
	Export the current module to the printed circuit board. If the module was previously imported, it will replace the corresponding module on the printed circuit board (i.e., respecting position and orientation). If the module was loaded from a library, it will be copied on to the printed circuit board at position 0 and with orientation 0. (Translator's note: I do not find this clear: previously imported from the pcb? or from a library (see below)? So what's the difference with loading it from a library?)
	Import a module from a file created by the Export command ().
	Export a module. This command is essentially identical to that for creating a library, the only difference being that creates a library in the user directory, while creates a library in the standard library directory (usually kicad/modules).
	Not used.
	Call the print dialogue.
	Standard zoom commands.
	Call the pad editor.
	Not used.

Creating a new module:

Allows creation of a new module. You will be asked for the name by which the module will be identified in the library. This text also serves as the module reference, which will be replaced by the final reference on the printed circuit board (U1, IC3...)

It will be necessary to add the following to the new module:

Outlines (and possibly text);

The pads;

A value (place-holding text that will subsequently be replaced by the true value).

When a new module is similar to an existing module in a library or board, an alternative and often quicker method is the following:

Load the similar module (, , ou )

Modify the reference field to the name of the new module.

Edit and save the new module.

Creating a new library:

The creation of a new library is done using:

, in which case the file is created by default in the library directory;

or by

,	in which case the file is created by default in the working directory.

A file-choosing dialogue allows the name of the library to be specified and its directory to be changed. In both cases, the library will contain the module being edited.

Warning:

If an old library of the same name exists, it will be overwritten without warning.

Saving a module to the active library:

The action of saving a module (thereby modifying the file of the active library) is performed using this icon .

If a module of the same name already exists, it will be replaced.

Since you will depend upon the accuracy of the library modules, it is worth double-checking the module before saving.

It is also recommended to edit either the reference or value field text to the name of the module as identified in the library.

Transferring a module from one library to another:

Select the source library().

Load the module ().

Select the destination library ().

Save the module ().

You may also wish to delete the source module: reselect the source library then delete the old module ( then .).

Saving all the modules of a circuit in the active library:

It is posible to copy all of the modules of a given board design to the active library. These modules will keep their current library names.

This command has two uses :

To create an archive or complete a library with the modules from a circuit, in the event of the loss of a library;

More importantly, it facilitates library maintenance by enabling the production of documentation for the library, as explained below.

Documentation for library modules:

It is strongly recommended to document the modules you create, in order to enable rapid and error-free searching.

For example, who is able to remember all of the multiple pinout variants of a TO92 package? The Module Properties dialogue offers a simple solution to this problem.

This dialogue accepts:

A one-line comment/description;

Multiple keywords.

The description is displayed with the component list in CVPCB and, in PCBNEW, it is used in the module selection dialogues.

The keywords enable searches to be restricted to those modules corresponding to particular keywords.

When directly loading a module (the icon of the right-hand Pcbnew toolbar), keywords may be entered in the dialogue box. Thus, entering the text "=CONN" will cause the display of the list of modules whose keyword lists contain the word CONN.

Documenting libraries – recommended practice:

It is recommened to create libraries indirectly, by creating one or more auxiliary circuit boards that constitute the 'source' of (part of) the library, as follows:

Create a circuit board in A4 format, in order to be able to print easily to scale (scale = 1).

Create the modules that the library will contain on this circuit board.

The library itself will be created with the File/Archive footprints/Create footprint archive command.

The "true source" of the library will thus be the auxiliary circuit board, and it is on this circuit that any subsequent alterations of modules will be made.

Naturally, several circuit boards can be saved in the same library.

It is generally a good idea to make different libraries for different kinds of components (connectors, discretes,...), since Pcbnew is able to search many libraries when loading modules.

Here is an example of such a library source:

This technique has several advantages:

The circuit can be printed to scale and serve as documentation for the library with no further effort.

Future changes of Pcbnew may require regeneration of the libraries, something that can be done very quickly if circuit-board sources of this type have been used.This is important, because the circuit board file formats are guaranteed to remain compatible during future development, but this is not the case for the library file format.

PCBNEW: ModEdit: Managing libraries.

Page 10 - 5

IUT

1996-01-27T12:47:00