Documentation

Package Generator

The Package generator dialog

The "package generator" is made for easy creation of component packages including 3D view. It can be found in layout menu "Packages" and opens like this:

The package generator dialog
Image: The package generator dialog


It consists of three parts: A technical drawing to the left, which contains the definition of the parameters of the part. Such a drawing can be found in any data sheet. This image can not be modified here. Middle of the dialog you find the list of parameters, where all parameters can be entered according to the specifications of the data sheet. It is the basis for how the package later will look like. The abbreviations left of the equal sign are the same as in the technical drawing to the very left. Up to the right the package image can be seen the way it appears in the layout later. Below the 3D image can be seen.

The component type to be created can be selected from the list top left:

The list of component types
Image: The list of component types

If you select a DIL (Dual-In-Line) from the list, the dialog changes the way that DIL parameters can be entered.

The dialog for a DIL
Image: The dialog for a DIL


The button Unit mm (top center) wants to make clear that metric scale has prevailed against inch in component drawing. There is no inch-scale here.

The buttons Default, Load, Save in the center of the dialog refer to the set of values currently entered. One can save certain sets of values under an individual name and load them again. Or you might use the default setting.

The button Generate! opens the well known dialog for saving the part to the data base. Component type, component name, package description and manufacturer can be entered as usual and the process is finished. Regarding the buttons Edit and Debug please see the following chapters.


Quick creation of a package using the N-Pole type

If you are not a programmer and don't like to create a script on your own for a part which isn't represented here, you might use the package type N-Pole. Find it in the list here:

Package type N-Pole
Image:Package type N-Pole


The idea is simply to have a package outline with a certain kind and number of pads in a row. You can import this "raw" to a layout, finish it correctly by pushing the pads on their correct place and save it again under a certain name. It might be the fact that the package won't come perfectly from the generator but the generator itself already has done a lot of constructive work. Now you might do corrections in the layout and save the part again. As you might know in the layout you can refine any part at any time and save it again (overwrite it or save it under a new name).


How to create a package script

What is a package script?

Each component type which you will find in the list top left is based on exactly one script. So what you see in the dialog windoe when selecting a certain component type is defined by a script. A package script is a program which determins the geometrical shape of all drawing elements of a package. It is called script because it is stored as a text. So one does not create a script for one singular more or less complicated package but always for a package kind or type. A package type normally is built up according to special geometrical rules, only the number of leads (this is the easiest case) varies. View the script of package type by pressing the button: Button edit.jpg

You can modify each script, save it under a different name ("Save as...") and then use it. When opening the package generator dialog again, the new script can be chosen from the list.


Button: Button debug.jpg opens the "Debugger" of the script.

Debug dialog
Image: The Debug dialog

The "Step" button in the debug dialog allows a step by step (= row by row) walk through the script in order to see what each script row effects for the image(s). So if bugs in the script would occur, one can easily find them and fix them. In the above dialog for example row 52 is responsible for the vertical line on the right edge of the package outline.

Der Aufbau eines Skriptes an einem Beispiel

For the component type SIL (Single-In-Line) the script has the following look (syntax to the left, explanation to the right):

Script syntax (line by line) Explanation
01 Script:"SIL (Single-In-Line)" Name of the script, shown in the selection box top left. Active with the next opening of the generator.
02 Hint:"Single-In-Line SIL/SIP THT packages" Hint which appears in the dialog right beside the selection box.
03 Comment:"TARGET 3001! package script, Unit mm" All following in this line is comment.
04 Author:"Steve Miller" Author of the script.
05 Date:"28.11.2013" Date of last modification. Needs to be controled/managed manually.
06 Image:"SIL.png" File name of the image shown to the left. PNG-Image always 350x580 pixel.
07 Num:N,7,"Number of pins",Edt Declare numeric variable. Here the input box "Number of pins" is defined. Name, Default value, Hint, Display. Display missing=not shown, EDT=editable, RDO=Read-Only. Variable names need to start with one or more alphabetic character. Then numeric characters may follow. Upper case/lower case is not recignized.
08 Num:W,2.5,"Width of case",Edt dito. Input box "Width of case" is defined.
09 Num:L,18,"Length of case",Edt dito. Input box "Length of case" is defined.
10 Num:H,5.1,"Height of case",Edt dito. Input box "Height of case" is defined.
11 Num:P,2.54,"Pitch of pins",Edt dito. Input box "Pitch of pins" is defined.
12 Num:A,0.6,"Width or radius of pins",Edt dito. Input box "Width or radius of pins" is defined.
13 Num:B,0.3,"Thickness of pins or zero",Edt dito. Input box "Thickness of pins or zero" is defined.
14 Num:C,1.5,"Width of pads",Edt dito. Input box "Width of pads" is defined.
15 Num:D,2.5,"Height of pads",Edt dito. Input box "Height of pads" is defined.
16 Num:E,0.9,"Diameter of drill holes",Edt dito. Input box "Diameter of drill holes" is defined.
17 Num:F,0.1,"Distance to PCB",Edt dito. Input box "Distance to PCB" is defined.
18 Str:Col,"$225522","Package color",Edt Declare text variable. Name, Default value, Hint, Display. Display missing=not shown, EDT=editable, RDO=Read-Only. Colors need to be defined hexadecimally like $BBGGRR . The two B represent Blue, the two G represent Green and the two R represent Red.
19
Blank line
20 Comment:------------> Drawing
Comment: The syntax of the package (land pattern with package outline) starts from here.
21
Blank line
22 Name:("SIL-"+N+"/"+L+"x"+W+"x"+H)
This is how the proposal for a package name is created when pushing the "Generate" button. It is a string. The visible is denoted within quotes. Those characters added by a plus sign are variables.
23 Type:"SIL / SIP (single in-line package)"
Package type. Please inherit from data base "package types".
24 Calc:X1=(N/2-0.5)*P
Announce a calculation. Variable=Expression. More than on calculation separate by comma. Operators within the expression: +, -, *, /, (), mathematic functions, see below.
25 For:I,1,N
Begin a For-loop. Hereby iteratively is executed what line 26 defines: Variable name, Start value, End value, (step=1). Start value and End value can be expressions.
26 Pad:-X1+P*(I-1),0,C,D,E,I,All,Oct
Create a pad in the layout. X, Y, Width, Height, Drill diameter, Layer, Form, Rotation, (Padname=), (Solder paste=True), (Solder stop=True).
27 EndFor
Ende of the For loop. For loops can be nested. Colon optionally.
28 Calc:X=L/2
Announce a calculation. Variable=Expression. More than on calculation separate by comma. Operators within the expression: +, -, *, /, (), mathematic functions, see below.
29 Calc:Y=W/2
Announce a calculation. Variable=Expression. More than on calculation separate by comma. Operators within the expression: +, -, *, /, (), mathematic functions, see below.
30 Line:-X,-Y,X,-Y,0.3
Draw a line in the layout. X1, Y1, X2, Y2, (Line width=0.3), (Layer Function=4=Position top).
  • Layer function: 3=Position bottom, 4=Position top, 12=Solder stop top, 15=Solder paste top, 16=Gold top, 18=Glue top
31 Line:X,-Y,X,Y,0.3
Draw a line in the layout. X1, Y1, X2, Y2, (Line width=0.3), (Layer Function=4=Position top).
  • Layer function: 3=Position bottom, 4=Position top, 12=Solder stop top, 15=Solder paste top, 16=Gold top, 18=Glue top
32 Line:X,Y,-X,Y,0.3
Draw a line in the layout. X1, Y1, X2, Y2, (Line width=0.3), (Layer Function=4=Position top).
  • Layer function: 3=Position bottom, 4=Position top, 12=Solder stop top, 15=Solder paste top, 16=Gold top, 18=Glue top
33 Line:-X,Y,-X,-Y,0.3
Draw a line in the layout. X1, Y1, X2, Y2, (Line width=0.3), (Layer Function=4=Position top).
  • Layer function: 3=Position bottom, 4=Position top, 12=Solder stop top, 15=Solder paste top, 16=Gold top, 18=Glue top
34 Calc:X=X1-P/2
Announce a calculation. Variable=Expression. More than on calculation separate by comma. Operators within the expression: +, -, *, /, (), mathematic functions, see below.
35 Line:-X,Y,-X,-Y,0.3
Draw a line in the layout. X1, Y1, X2, Y2, (Line width=0.3), (Layer Function=4=Position top).
  • Layer function: 3=Position bottom, 4=Position top, 12=Solder stop top, 15=Solder paste top, 16=Gold top, 18=Glue top
36 Text:-X+1.5,W/2+1,2.5,1.6,0,"!Name","DIN-ISO-ANSI"
Display text in the layout. X, Y, Hight, Width, Rotation, Text content, Charcter set, (Layer function=4=Position top).
37 Text:-X+1.5,-W/2-3.2,2.5,1.6,0,"!Value","DIN-ISO-ANSI"
Display text in the layout. X, Y, Hight, Width, Rotation, Text content, Charcter set, (Layer function=4=Position top).
38 Comment:------------> 3D
Comment: The syntax of the 3D image starts from here.
39 Solid:0,0,F,0,0,F+H,L,W,Col,0.4
Quader in 3D ausgeben. X1, Y1, Z1, X2, Y2, Z2, Breite, Höhe, Farbe, (Abrundungsradius=0). Es gilt die Syntax für die 3D-Modellierung
40 Text3D:-X1+1.5,-0.5,F+H+0.01,1.2,0.5,0,"DIN-ISO-ANSI","!Value",$FFFFFF
Text in 3D ausgeben. X1, Y1, Z1, Höhe, Breite, Rotation, Zeichensatz, Textinhalt, Farbe. Es gilt die Syntax für die 3D-Modellierung
41 Cylinder:-X1,0,F+H-0.1,-X1,0,F+H+0.01,1,$FFFFFF
Zylinder in 3D ausgeben. X1, Y1, Z1, X2, Y2, Z2, Durchmesser, Farbe, (Abrundungsradius=0). Es gilt die Syntax für die 3D-Modellierung
42 For:I,1,N
For Schleife zum iterativen Erzeigen der 3D Bauteilbeinchen
43 Calc:X2=-X1+P*(I-1),Y2=0,Z=(F+H)/2
Ankündigung einenr Berechnung
44 IF:B>0
If-Abfrage beginnen. Ausdruck Operator Ausdruck. Operatoren: =, <, >, <=, >=. Mehrere Bedingungen mit & (=and) verbindbar.
45 Solid:X2,Y2,-3,X2,Y2,0.1,A,B,$CCCCCC,0
Quader in 3D ausgeben. X1, Y1, Z1, X2, Y2, Z2, Breite, Höhe, Farbe, (Abrundungsradius=0). Es gilt die Syntax für die 3D-Modellierung
46 ELSE
Else Zweig. Doppelpunkt optional.
47 Cylinder:X2,Y2,-3,X2,Y2,0.1,A,$CCCCCC
Zylinder in 3D ausgeben. X1, Y1, Z1, X2, Y2, Z2, Durchmesser, Farbe, (Abrundungsradius=0). Es gilt die Syntax für die 3D-Modellierung
48 ENDIF
Ende der If-Abfrage. If-Abfragen können geschachtelt sein (nested). Doppelpunkt optional.
49 EndFor Ende der For-Schleife. For-Schleifen können auch geschachtelt sein (nested). Doppelpunkt optional.



Bitte beachten: Die aktuell vorliegenden Variablenwerte für das konkrete SIL-Bauteil findet man im Debugger-Dialog auf der rechten Seite.

Skript-Befehle

Allgemeines

Textuelle Angaben (=Zeichenkette=String) werden immer in doppelte Anführungszeichen gesetzt. Beispiel: "Hallo".

Koordinaten-Angaben sind immer in der Einheit [mm]. Wenn man auf die X-Y-Ebene schaut, zeigt die positive Z-Achse nach oben zum Betrachter. Alle Zahlen werden jederzeit auf 1/1000 gerundet.

Winkel-Angaben sind immer in 0...360 Grad [°]. Der Drehsinn ist immer CCW = CounterClockWise = gegen den Uhrzeigersinn. 0° ist immer Richtung Osten. Es gilt die Rechte-Hand-Regel für alle Achsen.

Farben werden immer nach dem Muster $BBGGRR als Hexadezimalzahl angegeben. Die beiden B stehen für Blau, die beiden G für Grün und die beiden R für Rot.


Script Befehle im Einzelnen

Folgende Script-Befehle gibt es derzeit:


Wenn ein Array z. B. n=16 Pole hat, braucht es unten Pad 1 und Pad 8=n/2 und eine Reihe von Pad 2 bis Pad 7=n/2-1.
Oben benötigt man rechts Pad 9=n/2+1 und Pad 16=n. Dazwischen die Reihe von Pad 10=n/2+2 bis Pad 15=n-1.
Im 3D braucht es ein linkes und ein rechtes Endstück und (n-4)/2 Zwischenstücke.


Speichern und aktivieren des Skriptes

Ein Script wird im Edit-Dialog erzeugt, verändert und gespeichert. Speicherort ist das Verzeichnis:

Benutzer\Name\AppData\Roaming\ibf\TarVxx\<Ausbaustufe>\PCK_gen

An diesem Ort werden auch die *.png- Imageer gespeichert, die die technische Zeichnung beinhalten und die im Dialog links dann auftauchen. Es ist sinnvoll (kein Muss), wenn das Image den gleichen Namen hat wie das Script.

Ein Script aus der Liste löschen

Löschen Sie es einfach aus diesem Verzeichnis:

Benutzer\Name\AppData\Roaming\ibf\TarVxx\<Ausbaustufe>\PCK_gen

Dann ist es beim nächsten Öffnen auch aus der Liste verschwunden.






Zu diesem Thema habe ich eine Frage