You can add components to a library by providing all parameters via a text file. Using a text file makes it easy to enter data for similar groups of components.

To add components via a batch file

  1. Click the folder where you want to add the new items.

  2. Choose the command Edit » Create from file or click on the tool in the toolbar. The dialog box in which to select the batch file opens.

  3. In the dialog box, select the file and click Open.

File Format

The text file containing all information about components and folders can be created using any ASCII editor, and consists of a header and a list of directives.

The Header

The first line of the file must begin with 'DRAWLOGIX-DEVICE-DEFINITION' followed by the version number consisting of 3 numeric characters. The current version number is 100.

DRAWLOGIX-DEVICES-DEFINITION-100
...
directives
...

The directives

Each directive occupies a line and is identified by the first character, other than the space or tabulation character, present in the line. A line starting with the asterisk character (*) is interpreted as a comment and ignored. The available directives are listed in the following table.

Directive Description

*

Comment.
Indicates that the contents of the line are ignored.

@

Symbolic constant.
Defines a symbolic constant. Assigns a name to a character string. In the rest of the file, all occurrences of the name are replaced with the character string.


Syntax: @name value
name is the name of the constant.
value is the character string.

Example: @TI Texas Instruments


Loop variable
If the constant is defined within a loop, it takes the form of a vector and you can specify multiple values by separating them with a semicolon character. In the loop block, all occurrences of the name are replaced with the current loop index value. The number of values must be equal to the number of loop repetitions.

Syntax: @name value1; value2; ... valueN
value1 is the value of the variable in the first loop pass.
value2 is the value of the variable in the second loop pass.
valueN is the value of the variable in the last loop passage.

Example: @TOL 5%;10%;20%


The standard series of values can be specified using the following syntax:

Syntax: table(startvalue,stopvalue,format,scalefactor)
table is one of the standard series: E3, E6, E12, E24, E48, E96, E96E24, E192, E192E24.
startvalue is the initial value of the series.
stopvalue is the final value of the series.
format is the numeric format. This parameter can take the following values:

  • 0: Numerical value. E.g. 100000. Depends on the parameter scalefactor.

  • 3: Three-digit code. E.g.: 104.

  • 4: Four-digit code. E.g. 1003.

  • 10: Variable length code. E.g. 100K.

scalefactor is the scaling factor to be used for the numerical value. This parameter can be omitted. If not specified is 1. You can directly specify the scaling factor or one of the following values:

  • 0: No scaling factor is used.

  • 1: The scaling factor is 1.

  • m: milli (1e-3).

  • u, µ: micro (1e-6).

  • n: nano (1e-9).

  • p: pico (1e-12).


Example:

@CAP E24(10,91,0,p);E12(100,82000,0,p)

?

Conditional symbolic constant.
Assigns a value to a constant only if the expression is true.


Syntax: ?name (expr) value
name is the name of the constant.
expr is the expression to be evaluated.
value is the character string.

Example: ?FT ((CV==22) && (PAK==2)  &&  (VOLT=5)) DM

#

New component.
Create a new component. The component tab is initialized with the default values set with the & directive.

Syntax: #name
name is the name of the component in the library.

Example: #BC517

&

Default value.
Set the parameter default value. It is possible to specify a default value for the common parameters so as to set for each component only the parameters that characterize it.

Syntax: &code:value
code is the parameter code.
value is the parameter value.

Example: &4:Transistors

$

Parameter value.
Sets the value of the parameter in the component being defined.

Syntax: $code:value
code is the parameter code.
value is the parameter value.

Example: $2:U

!

Skip the loop pass.
If the expression is true, skip the current loop pass.

Syntax: ! expr
expr is the expression to evaluate. In the expression you can evaluate the values of the current loop indexes and the value of the variables. In the expression, the name of the variables must be specified without the @ initial character.

Example:  ! (CAP==10 && TOL==2)

{ }

New folder.
Creates a new folder. All components defined between the pair of curly brackets are placed in the new folder.

Syntax: { name
        ...
      }

name is the name of the folder.

[ ]

Loop.
The block between the pair of square brackets is repeated for the number of times specified by count.

Syntax: [ count name
        ...
      ]


count is the number of repetitions.
name is the name of the loop index. Use the loop indexes to change the value of the parameters for each repetition. The value of the loop index is zero at the first pass of the loop and increases by one at each pass.

< >

Conditional block.
The block between the pair of angular brackets is only executed if the expression is true.

Syntax: < expr
       ...
      >


To include also the else block use the following form. The block between the second pair of angle brackets is only executed if the expression is false.

Syntax: < expr
       ...
      ><
       ...
      >

expr is the expression to be evaluated. In the expression you can evaluate the values of the current loop indexes and the value of the variables. In the expression, the name of the variables must be specified without the @ initial character.

Example:  TOL==2 && PPM>1

%

Set an option.

Syntax: %code:value
code is the code of the option.
value is the value to be set.

Example: %1:;

Parameters

Each parameter in the Component Properties tab is identified by a numeric code. It is possible to specify a default value for the common parameters so as to set for each component only the parameters that characterize it. The following table lists the parameter codes.

Code Parameter

1

Name in the schematics.
Specify the name of the component when it is inserted in the schematic. This name is entered in the value field of the symbol when you place it in the schematic. If this field is empty, the component is assigned the same name as the component. If you only specify the character '@' the symbol keeps the name as specified in the symbol definition.

2

Reference prefix.
Specify the reference prefix. For example, R for resistors, J for connectors.

3

Icon.
You can specify the index (from 0 to 31) of the icon to be associated with the component. There are 32 icons available that can be set in the Job Properties dialog box. Group Library.

4

Family.
You can specify the type of component.

5

SubFamily.
You can specify the function of the component.

6

Manufacturer.
You can specify the name of the component manufacturer.

7

Datasheet link.
You can specify a reference to the technical documentation for the component. This field corresponds to the internal attribute ObjDoc. You can specify an Internet address or the name of a file. For format see To add documentation to symbols.

8

Description.
You can enter a short description of the component.

9

Symbol.
Specify the name of the symbol to be associated with the component. It is possible to associate more than one symbol to the component, but the number of pins must be the same for all symbols. If more than one symbol is specified, separate them with a semicolon character (;).

Syntax: symbol1;symbol2; ... symbolN
symbol is the name of a symbol defined by a frame object in a symbol document or can be a symbol definition.

A symbol definition has the following syntax: name(section1;section2; ... sectionN)
name is the name of the symbol that is defined by the sections specified in the round brackets. There may be one or more sections separated by the semicolon character (;).

The syntax of the sections is as follows: symbolname/library:op1=np1: ... opN=npN
symbolname is the name of the symbol representing the section.
/library is the name of the library file in which the symbol is defined. The library name can be omitted if the symbol is defined inside the Job.
:op1=np1 is the correspondence between the number that the pin has in the original symbol and the number that must be assigned to the pin in the new symbol.

Example: $9:PNP
Example: $9:S7400(NAND_2INP/LOGIC:1=1,4,9,12:2=2,5,10,13:3=3,6,8,11:4=7:5=14)
Example: $9:S7075(INVERTER/LOGIC:1=1,22:2=23,2:3=12:4=24;NAND_2INP/LOGIC:1=3,20:2=4,21:3=5,19:4=12:5=24;DFF_CPQNQ/LOGIC:1=6,18:2=8,16:3=10,14:4=7,17:5=11,13:6=9,15:7=12:8=24)

10

Footprint.
Specify the name of the component footprint. If you specify more than one footprint, you must separate them with the semicolon character (;).

Syntax: footprint1;footprint2; ... footprintN
footprint is a definition of footprint.

A footprint definition has the following syntax: footprintname:pintopadmap joinmap
footprintname is the name of a footprint defined by a Frame object in a footprint document.
pintopadmap is the map of correspondence between the pins of the symbol and the pads of the footprint.
joinmap is a map of the internal connections between the pad

The pintopadmap map has the following syntax: pin=pad,pin=pad, ... pin=pad
pin is the pin number in the symbol and pad is the number of the corresponding pad in the footprint. If the pin numbers on the symbol are progressive numbers starting from 1 then the map pintopadmap can only be made up of the list of pads sorted in ascending order of the pin number: padtopin1,padtopin2, ... padtopinN

The joinmap map has the following syntax: (id1:group1;id2:group2; ... idn:groupN)
id: is the connection code and is between 1 and 128. This parameter is optional.
group is the list of connected pads separated by a comma.

Example: $10:DIODES_SM-8:5,6,4,3,7,8,2,1(5,6;7,8)

11

CARD
Sets the CARD parameter of the SPICE category.

12

MODEL
Sets the MODEL parameter of the SPICE category.

13

PINS
Sets the PINS parameter of the SPICE category.

20

Attributes.
You can add the internal attributes associated with the component. Internal attributes have a name and value and can be used to associate information to objects. Example: the internal code, price etc. See Dialog: Attributes.

Syntax: name/category=value
name is the attribute name.
category is the attribute category.

value is the attribute value.

Example: $20:MFRPARTNUMBER/DEVICE=AB100

30

Arbitrary series repetition.
Use this code to fill in the list of repetitions on the component tab. Specify the value of each variable by separating them with the pipe character (|). You can insert a line for each repetition or chain all the repetitions into a single line by separating them with the semicolon character (;).

Syntax: $1|$2|...$n
$n is the variable {$n} with n that goes from 1 to 10.

Example: $30:1K|102;2K|202;5K|502

31

Standard series repetitions.

Use this code to compile the list of repetitions in the component tab. The list of repetitions is compiled with the values of the standard series specified by the table parameter. Variable {$1} is assigned the value of the component and variable {$2} is assigned the 3-digit or 4-digit numeric code of the value.

Syntax: table,startvalue,stopvalue,digits,scalefactor
table is one of the standard series: E3, E6, E12, E24, E48, E96, E96E24, E192, E192E24.
startvalue is the initial value of the series.
stopvalue is the final value of the series.
digits is the number of digits of the numerical code assigned to the variable {$2}. This parameter can have the following values:

  • 0: The variable is not compiled.

  • 1: The variable is compiled with the default code.

  • 3: The variable is filled in with the three-digit code. E.g: 104 (100000)

  • 4: The variable is filled in with the four-digit code. E.g: 1003 (100000)

  • 10: The variable is compiled with the variable length code. E.g.: 100K (100000)

scalefactor is the scaling factor to be used for the numerical value. This parameter can be omitted. If not specified, it is 1. You can directly specify the scaling factor or one of the following values:

  • 0: No scaling factor is used.

  • 1: The scaling factor is 1.

  • m: milli (1e-3).

  • u, µ: micro (1e-6).

  • n: nano (1e-9).

  • p: pico (1e-12).


Example: $31:E24,11,99000,10

Options

The options allow you to change some of the settings.

Code Description

1

Sets the separator character of arbitrary repetition values. The default value is the pipe character (|).

Syntax: %1:char
char is the separator character.

Example: %1:/

2

Sets the separator character for arbitrary repetition lines. The default value is the semicolon character (;).

Syntax: %2:char

char is the separator character.

Example: %2:/

Example

  Copy codeCopy code

DRAWLOGIX-DEVICES-DEFINITION-100 

&2:C
&3:2
&4:Capacitor
&5:Ceramic Chip Capacitor
&6:Kemet
&7:http://www.kemet.com/Lists/ProductCatalog/Attachments/53/KEM_C1002_X7R_SMD.pdf

{ X7R Dielectric, 6.3-250 VDC (Commercial Grade)
  [ 60 CAP
    @CV E24(10,91,0,p);E12(100,82000,0,p)
    @CC E24(10,91,3);E12(100,82000,3)
    { @CVF
      [ 9 VOLT
        @VV 6.3;10;16;25;35;50;100;200;250
        @VC 9;8;4;3;6;5;1;2;A
        { @VV VDC
          [ 3 TOL
            @TL 5%;10%;20%       
            @TC J;K;M
            { @TL
              [ 4 PAK
                @PK 0402;0603;0805;1206
                @PC BB;CF;DN;EB
                @FT @PC
                  
                * skip invalid devices 
                ! (PAK==0) && ((VOLT==4) || (VOLT>5))
                ! (PAK==1) && (VOLT==4)
                ! (PAK==0) && (VOLT==5) && (CV>22000p)
                ! (PAK==0) && (VOLT==3) && (CV>47000p)
                ! (PAK==1) && (VOLT==6) && (CV>47000p)
                ! (PAK==1) && (VOLT==7) && (CV>10000p)
                ! (PAK==1) && (VOLT==8) && (CV>10000p)
                ! (PAK==1) && (VOLT==8) && (CV<1000p)
                ! (PAK==2) && (VOLT==8) && (CV<180p)
                ! (PAK==2) && (VOLT==8) && (CV>68000p)
                ! (PAK==2) && (VOLT==7) && (CV>68000p)                
                ! (PAK==3) && (VOLT==8) && (CV<1000p)

                * replace default footprint
                ?FT ((CV==22p) && (PAK==2) && (VOLT<=5)) DM
                ?FT ((CV>=27000p) && (CV<=39000p) && (PAK==2) && (VOLT==6)) DP
                ?FT ((CV>=27000p) && (CV<=39000p) && (PAK==2) && (VOLT==7)) DE
                ?FT ((CV>=27000p) && (PAK==2) && (VOLT==7)) DG
                ?FT ((CV==39000p) && (PAK==3) && (VOLT==6)) EC
                ?FT ((CV==47000p) && (PAK==1) && (VOLT==5)) CJ
                ?FT ((CV==47000p) && (PAK==2) && (VOLT<6)) DO
                ?FT ((CV>47000p) && (PAK==2) && (VOLT<6)) DP
                ?FT ((CV>=47000p) && (PAK==2) && (VOLT==6)) DE
                ?FT ((CV>=47000p) && (PAK==2) && (VOLT==7)) DG
                ?FT ((CV>=27000p) && (PAK==2) && (VOLT==8)) DG
                ?FT ((CV==39000p) && (PAK==3) && (VOLT==6)) EC
                ?FT ((CV==47000p) && (PAK==3) && (VOLT==6)) EC
                ?FT ((CV>=47000p) && (PAK==3) && (VOLT>=7)) ED
                
                * build record
                #@CVF, @VV VDC, @TL, Case Size @PK
                $1:@CVF
                $9:CAP
                $10:KEMET_CAP_@PK_@FT
                $8:Surface Mount Multilayer Ceramic Chip Capacitor
                $20:MFRPARTNUMBER/DEVICE=C@PKC@CC@TC@VCRACTU
                $20:TOLERANCE/SPICE=@TL             
              ]
            }
          ]
        }
      ]
    }
  ]
}

See also