PCBNEW: ModEdit: Managing libraries.

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:

10 - ModEdit: Managing LIBRARIES

10.1 - 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:

as well as the maintenance of the active library:


It is also possible to create new libraries.

A library is in fact made up of two files:

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.

10.2 - ModEdit:

The Module Editor can be accessed in two ways:

10.3 - ModEdit user interface:

Calling ModEdit causes the following window to appear:

10.4 - 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.

10.5 - 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:
When a new module is similar to an existing module in a library or board, an alternative and often quicker method is the following:
  1. Load the similar module (, , ou )
  2. Modify the reference field to the name of the new module.
  3. Edit and save the new module.

10.6 - 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.

10.7 - 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.

10.8 - 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 .).

10.9 - 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 :

10.10 - 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:
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.

10.11 - 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:

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:
  1. The circuit can be printed to scale and serve as documentation for the library with no further effort.
  2. 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.


Page 10 - 7