Documentation

Package Generator: Difference between revisions

 
(69 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<big><b>Get footprint pattern and 3D model.</b></big><br><b>Select default from the list. Enter dimensions. Done.</b><br><br>
<table border="0" cellpadding="20"><tr><td>[[Image:packagegenerator.jpg|600px]]</td></tr><tr><td><span class="plainlinks">[[Image:Videoicon_packagegenerator_144.jpg|link=//server.ibfriedrich.com/video/e/packagegenerator/packagegenerator.mp4|Video (3:28 Min)]]</span><br><br><big>'''Video (3:28 Min)'''</big></td></tr></table>
== The  Package generator dialog ==
== 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:<br><br>
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:<br><br>


[[Image:ghsgenerator_e.jpg|800px|The package generator dialog]]<br>Image: The package generator dialog<br><br><br>
[[Image:ghsgenerator_e.jpg|750px|The package generator dialog]]<br>Image: The package generator dialog<br><br><br>
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 In der Mitte des Dialoges findet sich die Liste der Parameter, die es gemäß der individuellen Gehäusespezifikation zu füllen gilt. Sie ist die Grundlage für die spätere Gestalt des Gehäuses. Die Kürzel links vom Gleichheitszeichen entsprechen den Variablen/Parametern der technischen Zeichnung ganz links. Rechts oben das GehäuseImage wie es sich später im Layout darstellt, darunter die 3D Ansicht.<br><br>
The dialog consists of four sections. Starting from the left: A list of various defaults to the left where you '''select your desired type''' of component. Right beside a technical drawing containing the definition of the parameters of the part. Such a drawing can be found in every data sheet. This image can not be modified here. Right beside the technical drawing you see the list of parameters, where all values according to the specifications of the data sheet can be entered. 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 left of it. Up to the right the package image can be seen the way it appears in the layout later. Below the 3D image is shown.<br><br>
 
Please select the default component type from the list top left:


Welchen Bauteiltypen man erzeugen will, wählt man aus der Liste links oben:
[[Image:ghsgenerator2_d.png|The list of component types]]<br>Image: The list of component types<br><br>


[[Image:ghsgenerator2_e.jpg|Die Liste der Bauteiltypen]]<br>Image: Die Liste der Bauteiltypen<br><br>
If you select a DIL (Dual-In-Line) from the list, the dialog changes the way that DIL parameters can be entered.


Wählt man beispielsweise DIL (Dual-In-Line) aus der Liste, verändert sich die Dialogansicht so, dass ein DIL Bauteil erzeugt werden kann.
[[Image:ghsgenerator3_e.jpg|750px|The dialog for a DIL]]<br>Image: The dialog for a DIL<br><br><br>


[[Image:ghsgenerator3_e.jpg|800px|Die Dialogansicht für ein DIL-Gehäuse]]<br>Image: Die Dialogansicht für ein DIL-Gehäuse<br><br><br>
The button '''Unit mm''' (top center) wants to make clear that 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.<br><br>
Der Knopf '''Einheit mm''' (oben mitte) dient nicht dem Umschalten auf imperiale Maßeinheit (Zoll) sondern verdeutlicht, dass sich im Bereich Bauteilzeichnung metrische Maßeinheit durchgesetzt hat. Demzufolge ist kein zölliges Zeichnen in diesem Generator möglich.<br><br>Die Knöpfe '''Standard''', '''Laden''', '''Speichern''' im Zentrum des Dialoges beziehen sich auf die aktuell vorliegende gesamte Feldbelegung. Man kann also bestimmte Parametersets unter eigenem Namen speichern.
 
<br><br>
[[Image:Ghsgenerator4_e.jpg|Generate the desired package|none]]Image: Generate the desired package in order to save it under an individual name.<br><br>
Der Knopf '''Generieren''' öffnet den bekannten Dialog für den Export des Gehäuses in die Datenbank. Gehäusetyp, Gehäusename, Gehäusebeschreibung und Hersteller können dann wie üblich angegeben werden und der Vorgang ist beendet. Was es mit den Knöpfen Edit und Debug auf sich hat, wird im Folgenden erklärt.<br><br>
 
The more information you add to the dialog above, the better. You will find the package now in the range of designated package types by the particularly given name.<br><br>
 
<br>
 
== Quick creation of a package using the N-Pole type ==
 
The package types in the list top left are based on a script. You can establish a new component type by saving a new script to a certain TARGET directory. 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:<br><br>
 
[[Image:npole_e.jpg|750px|Package type N-Pole]]<br>Image:Package type N-Pole<br><br>
 
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 blank" to a layout, finish it correctly there 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 by a different name).<br><br><br>


== Wie estellt man ein eigenens Gehäusescript ==
== How to create a package script ==


=== Was ist ein Gehäusescript? ===
=== What is a package script? ===


Jedem Bauteiltypen, den Sie in der Liste zur Auswahl finden, liegt genau ein Script zugrunde. Was man also im Dialogfenster bei Auswahl eines bestimmten Bauteiltyps sieht, ist durch ein Script bestimmt. Ein Gehäusescript ist ein Programm, das den geometrischen Zusammenhang der Zeichnungselemente eines Gehäuses beschreibt. Script heißt es deswegen, weil es textbasiert hinterlegt ist. Man erstellt ein Script nicht für ein einzelnes, kompliziertes Gehäuse, sondern für eine Gattung, einen Gehäusetypen. Ein solcher ist nach gleichartigen Regeln aufgebaut, seine endgültige äußere Erscheinung wird aber nur von wenigen Parametern bestimmt. Man ruft das Script des vorliegenden Bauteiltyps auf durch betätigen des Knopfes: [[Image: button_edit.jpg]]<br><br>
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: [[Image: button_edit.jpg]]<br><br>


Sie können es modifizieren, unter einem anderen Namen abspeichern ("Speichern als...") und dann verwenden. Beim erneuten Öffnen des Gehäuse-Generator-Dialoges erscheint Ihr Script später im Auswahlfenster.
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.




Der Knopf:  [[Image: button_debug.jpg]]  öffnet den "Debugger" des Scriptes.<br><br>
Button:  [[Image: button_debug.jpg]]  opens the "Debugger" of the script.<br><br>


[[Image: debugdialog_e.jpg|800px|Debug Dialog]]<br>Image: Der Debug Dialog<br><br>
[[Image: debugdialog_e.jpg|750px|Debug dialog]]<br>Image: The  Debug dialog<br><br>


Wenn Sie im Debug-Dialog die Taste "Step" betätigen, gehen Sie schrittweise durch das Script und sehen sofort die Auswirkungen einer jeden Script-Zeile. Wenn also Fehler im Script auftreten sollten, können Sie sie leicht erkennen und schnell beseitigen. Im obigen Dialog beispielsweise ist Zeile 52 zuständig für den horizontalen Strich am rechten Ende des Gehäuseumrisses.
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 ===
=== The setup of a script by an example ===


Für den Bauteiltyp SIL (Single-In-Line) hat das Script folgende Gestalt (Syntax linke Spalte, Erklärung rechte Spalte):  
For the component type SIL (Single-In-Line) the script has the following look (syntax to the left, explanation to the right):  


{|border="1" cellspacing="1" cellpadding ="5"
{|border="1" cellspacing="1" cellpadding ="5"
!Zeilenweise Syntax des Scriptes!!Erklärung
!Script syntax (line by line)!!Explanation
|-
|-
|01 Script:"SIL (Single-In-Line)"||Name des Scripts, der oben in der Auswahlbox gezeigt wird. Wirkt erst beim nächsten Öffnen des Generators.
|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"||Hinweis, der oben neben der Auswahlbox gezeigt wird.
|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"||Alles Folgende in dieser Zeile ist Kommentar
|03 Comment:"TARGET 3001! package script, Unit mm"||All following in this line is comment.
|-
|-
|04 Author:"Harald Friedrich"||Autor des Scriptes
|04 Author:"Steve Miller"||Author of the script.
|-
|-
|05 Date:"28.11.2013"||Datum der letzten Änderung. Muss manuell geführt werden.
|05 Date:"28.11.2013"||Date of last modification. Needs to be controled/managed manually.
|-
|-
|06 Image:"SIL.png"||Dateiname des Imagees, das links gezeigt wird. PNG-Image immer 350x580 Pixel.
|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||Numerische Variable deklarieren. Hier wird das Eingabefeld "Number of pins" definiert. Name, Defaultwert, Hinweis, Anzeige. Anzeige fehlt=wird nicht gezeigt, EDT=editierbar, RDO=Read-Only. Variablennamen müssen mit einem oder mehreren Buchstaben beginnen. Dann können Ziffern folgen. Groß- und Klein-Schreibung wird nicht unterschieden.
|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. Hier wird das Eingabefeld "Width of case" definiert.
|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. Hier wird das Eingabefeld "Length of case" definiert.
|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. Hier wird das Eingabefeld "Height of case" definiert.
|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. Hier wird das Eingabefeld "Pitch of pins" definiert.
|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. Hier wird das Eingabefeld "Width or radius of pins" definiert.
|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. Hier wird das Eingabefeld "Thickness of pins or zero" definiert.
|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. Hier wird das Eingabefeld "Width of pads" definiert.
|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. Hier wird das Eingabefeld "Height of pads" definiert.
|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. Hier wird das Eingabefeld "Diameter of drill holes" definiert.
|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. Hier wird das Eingabefeld "Distance to PCB" definiert.
|17 Num:F,0.1,"Distance to PCB",Edt||dito. Input box  "Distance to PCB" is defined.
|-
|-
|18 Str:Col,"$225522","Package color",Edt||Text-Variable deklarieren. Name, Defaultwert, Hinweis, Anzeige. Anzeige fehlt=wird nicht gezeigt, EDT=editierbar, RDO=Read-Only. 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.
|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 <br>||Leerzeile
|19 <br>||Blank line
|-
|-
|20 Comment:------------> Drawing<br>||Kommentar: Hier beginnt die Syntax für das Gehäuse (Lötfüßchenmuster mit Gehäuseumriss)
|20 Comment:------------> Drawing<br>||Comment: The syntax of the package (land pattern with package outline) starts from here.
|-
|-
|21 <br>||Leerzeile
|21 <br>||Blank line
|-
|-
|22 Name:("SIL-"+N+"/"+L+"x"+W+"x"+H)<br>||So wird ein Vorschlag für den Gehäusenamen beim Generieren erzeugt. Es handelt sich um eine Zeichenkette =String. Das Sichtbare steht in Anführungszeichen. Das was durch Pluszeichen angehängt wird, sind Variable.
|22 Name:("SIL-"+N+"/"+L+"x"+W+"x"+H)<br>||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)"<br>||Gehäusetyp. Bitte aus der Datenbank aus package_types entnehmen.
|23 Type:"SIL / SIP (single in-line package)"<br>||Package type. Please inherit from data base "package types".
|-
|-
|24 Calc:X1=(N/2-0.5)*P<br>||Berechnungen ankündigen. Variable=Ausdruck. Mehrere Berechnungen mit Komma trennen. Operatoren im Ausdruck: <nowiki>+, -, *, /, ()</nowiki>, mathematische Funktionen s. u.  
|24 Calc:X1=(N/2-0.5)*P<br>||Announce a calculation. Variable=Expression. More than one calculation separate by comma. Operators within the expression: <nowiki>+, -, *, /, ()</nowiki>, mathematic functions, see below.  
|-
|-
|25 For:I,1,N<br>||For-Schleife beginnen. Hierdurch werden iterativ das ausgeführt, was in Zeile 26 definiert Variablenname, Startwert, Endwert, (Schritt=1). Startwert und Endwert können Ausdrücke sein.
|25 For:I,1,N<br>||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<br>||Pad im Layout erzeugen. X, Y, Breite, Höhe, Bohrdurchmesser, Ebene, Form, Rotation, (Padname=''), (Lötpaste=True), (Lötstopp=True).
|26 Pad:-X1+P*(I-1),0,C,D,E,I,All,Oct<br>||Create a pad in the layout. X, Y, Width, Height, Drill diameter, Padnumber, Layer, Form, Rotation, (Padname=''), (Solder paste=True), (Solder stop=True).
|-
|-
|27 EndFor<br>||Ende der For-Schleife. For-Schleifen können auch geschachtelt sein (nested). Doppelpunkt optional.
|27 EndFor<br>||Ende of the For loop. For loops can be nested. Colon optionally.
|-
|-
|28 Calc:X=L/2<br>||Berechnungen ankündigen. Variable=Ausdruck. Mehrere Berechnungen mit Komma trennen. Operatoren im Ausdruck: <nowiki>+, -, *, /, ()</nowiki>, mathematische Funktionen s. u.
|28 Calc:X=L/2<br>||Announce a calculation. Variable=Expression. More than on calculation separate by comma. Operators within the expression: <nowiki>+, -, *, /, ()</nowiki>, mathematic functions, see below.  
|-
|-
|29 Calc:Y=W/2<br>||Berechnungen ankündigen. Variable=Ausdruck. Mehrere Berechnungen mit Komma trennen. Operatoren im Ausdruck: <nowiki>+, -, *, /, ()</nowiki>, mathematische Funktionen s. u.  
|29 Calc:Y=W/2<br>||Announce a calculation. Variable=Expression. More than on calculation separate by comma. Operators within the expression: <nowiki>+, -, *, /, ()</nowiki>, mathematic functions, see below.
|-
|-
|30 Line:-X,-Y,X,-Y,0.3<br>||Linie im Layout zeichnen. X1, Y1, X2, Y2, (Linienbreite=0.3), (Ebenenfunktion=4=Bestückung oben).
|30 Line:-X,-Y,X,-Y,0.3<br>||Draw a line in the layout. X1, Y1, X2, Y2, (Line width=0.3), (Layer Function=4=Position top).
*Ebenenfunktion: 3=Bestückung unten, 4=Bestückung oben, 12=Lötstopp oben, 15=Lötpaste oben, 16=Gold oben, 18=Kleber oben
*Layer function: 3=Position bottom, 4=Position top, 12=Solder stop top, 15=Solder paste top, 17=Gold top, 19=Glue top
|-
|-
|31 Line:X,-Y,X,Y,0.3<br>||Linie im Layout zeichnen. X1, Y1, X2, Y2, (Linienbreite=0.3), (Ebenenfunktion=4=Bestückung oben).
|31 Line:X,-Y,X,Y,0.3<br>||Draw a line in the layout. X1, Y1, X2, Y2, (Line width=0.3), (Layer Function=4=Position top).
*Ebenenfunktion: 3=Bestückung unten, 4=Bestückung oben, 12=Lötstopp oben, 15=Lötpaste oben, 16=Gold oben, 18=Kleber oben
*Layer function: 3=Position bottom, 4=Position top, 12=Solder stop top, 15=Solder paste top, 17=Gold top, 19=Glue top
|-
|-
|32 Line:X,Y,-X,Y,0.3<br>||Linie im Layout zeichnen. X1, Y1, X2, Y2, (Linienbreite=0.3), (Ebenenfunktion=4=Bestückung oben).
|32 Line:X,Y,-X,Y,0.3<br>||Draw a line in the layout. X1, Y1, X2, Y2, (Line width=0.3), (Layer Function=4=Position top).
*Ebenenfunktion: 3=Bestückung unten, 4=Bestückung oben, 12=Lötstopp oben, 15=Lötpaste oben, 16=Gold oben, 18=Kleber oben
*Layer function: 3=Position bottom, 4=Position top, 12=Solder stop top, 15=Solder paste top, 17=Gold top, 19=Glue top
|-
|-
|33 Line:-X,Y,-X,-Y,0.3<br>||Linie im Layout zeichnen. X1, Y1, X2, Y2, (Linienbreite=0.3), (Ebenenfunktion=4=Bestückung oben).
|33 Line:-X,Y,-X,-Y,0.3<br>||Draw a line in the layout. X1, Y1, X2, Y2, (Line width=0.3), (Layer Function=4=Position top).
*Ebenenfunktion: 3=Bestückung unten, 4=Bestückung oben, 12=Lötstopp oben, 15=Lötpaste oben, 16=Gold oben, 18=Kleber oben
*Layer function: 3=Position bottom, 4=Position top, 12=Solder stop top, 15=Solder paste top, 17=Gold top, 19=Glue top
|-
|-
|34 Calc:X=X1-P/2<br>||Berechnungen ankündigen. Variable=Ausdruck. Mehrere Berechnungen mit Komma trennen. Operatoren im Ausdruck: <nowiki>+, -, *, /, ()</nowiki>, mathematische Funktionen s. u.
|34 Calc:X=X1-P/2<br>||Announce a calculation. Variable=Expression. More than on calculation separate by comma. Operators within the expression: <nowiki>+, -, *, /, ()</nowiki>, mathematic functions, see below.
|-
|-
|35 Line:-X,Y,-X,-Y,0.3<br>||Linie im Layout zeichnen. X1, Y1, X2, Y2, (Linienbreite=0.3), (Ebenenfunktion=4=Bestückung oben).
|35 Line:-X,Y,-X,-Y,0.3<br>||Draw a line in the layout. X1, Y1, X2, Y2, (Line width=0.3), (Layer Function=4=Position top).
*Ebenenfunktion: 3=Bestückung unten, 4=Bestückung oben, 12=Lötstopp oben, 15=Lötpaste oben, 16=Gold oben, 18=Kleber oben
*Layer function: 3=Position bottom, 4=Position top, 12=Solder stop top, 15=Solder paste top, 17=Gold top, 19=Glue top
|-
|-
|36 Text:-X+1.5,W/2+1,2.5,1.6,0,"!Name","DIN-ISO-ANSI"<br>|| Text im Layout ausgeben. X, Y, Höhe, Breite, Rotation, Textinhalt, Zeichensatz, (Ebenenfunktion=4=Bestückung oben).
|36 Text:-X+1.5,W/2+1,2.5,1.6,0,"!Name","DIN-ISO-ANSI"<br>||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"<br>|| Text im Layout ausgeben. X, Y, Höhe, Breite, Rotation, Textinhalt, Zeichensatz, (Ebenenfunktion=4=Bestückung oben).
|37 Text:-X+1.5,-W/2-3.2,2.5,1.6,0,"!Value","DIN-ISO-ANSI"<br>||Display text in the layout. X, Y, Hight, Width, Rotation, Text content, Charcter set, (Layer function=4=Position top).
|-
|-
|38 Comment:------------> 3D<br>||Kommentar: Hier beginnt die Syntax für die 3D-AbImageung
|38 Comment:------------> 3D<br>||Comment: The syntax of the 3D image starts from here.
|-
|-
|39 Solid:0,0,F,0,0,F+H,L,W,Col,0.4<br>||Quader in 3D ausgeben. X1, Y1, Z1, X2, Y2, Z2, Breite, Höhe, Farbe, (Abrundungsradius=0). Es gilt die [[3D-Syntax|Syntax für die 3D-Modellierung]]
|39 Solid:0,0,F,0,0,F+H,L,W,Col,0.4<br>||Display a cuboid  in 3D. X1, Y1, Z1, X2, Y2, Z2, Width, Height, Color, (Champfer radius=0). The [[3D_Syntax|Syntax for the 3D modelling]] applies.
|-
|-
|40 Text3D:-X1+1.5,-0.5,F+H+0.01,1.2,0.5,0,"DIN-ISO-ANSI","!Value",$FFFFFF<br>||Text in 3D ausgeben. X1, Y1, Z1, Höhe, Breite, Rotation, Zeichensatz, Textinhalt, Farbe. Es gilt die [[3D-Syntax|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<br>||Display text in the 3D image. X1, Y1, Z1, Height, Width, Rotation, Character set, Text content, Color. The [[3D_Syntax|Syntax for the 3D modelling]] applies.
|-
|-
|41 Cylinder:-X1,0,F+H-0.1,-X1,0,F+H+0.01,1,$FFFFFF<br>||Zylinder in 3D ausgeben. X1, Y1, Z1, X2, Y2, Z2, Durchmesser, Farbe, (Abrundungsradius=0). Es gilt die [[3D-Syntax|Syntax für die 3D-Modellierung]]
|41 Cylinder:-X1,0,F+H-0.1,-X1,0,F+H+0.01,1,$FFFFFF<br>||Display cylinder in 3D. X1, Y1, Z1, X2, Y2, Z2, Diameter, Color, (Champfer radius=0). The [[3D_Syntax|Syntax for the 3D modelling]] applies.
|-
|-
|42 For:I,1,N<br>|| For Schleife zum iterativen Erzeigen der 3D Bauteilbeinchen
|42 For:I,1,N<br>|| For loop in order to create the 3D leads iteratively
|-
|-
|43  Calc:X2=-X1+P*(I-1),Y2=0,Z=(F+H)/2<br>||Ankündigung einenr Berechnung
|43  Calc:X2=-X1+P*(I-1),Y2=0,Z=(F+H)/2<br>||Announcement of a calculation
|-
|-
|44  IF:B>0<br>||If-Abfrage beginnen. Ausdruck Operator Ausdruck. Operatoren: =, <, >, <=, >=. Mehrere Bedingungen mit & (=and) verbindbar.
|44  IF:B>0<br>||Start If condition. Expression Operator Expression. Operators: =, <, >, <=, >=. Combine several conditions by & (=and).
|-
|-
|45    Solid:X2,Y2,-3,X2,Y2,0.1,A,B,$CCCCCC,0<br>||Quader in 3D ausgeben. X1, Y1, Z1, X2, Y2, Z2, Breite, Höhe, Farbe, (Abrundungsradius=0). Es gilt die [[3D-Syntax|Syntax für die 3D-Modellierung]]
|45    Solid:X2,Y2,-3,X2,Y2,0.1,A,B,$CCCCCC,0<br>||Display a cuboid  in 3D. X1, Y1, Z1, X2, Y2, Z2, Width, Height, Color, (Champfer radius=0). The [[3D_Syntax|Syntax for the 3D modelling]] applies.
|-
|-
|46  ELSE<br>||Else Zweig. Doppelpunkt optional.
|46  ELSE<br>||Else branch. Colon optional.
|-
|-
|47    Cylinder:X2,Y2,-3,X2,Y2,0.1,A,$CCCCCC<br>||Zylinder in 3D ausgeben. X1, Y1, Z1, X2, Y2, Z2, Durchmesser, Farbe, (Abrundungsradius=0). Es gilt die [[3D-Syntax|Syntax für die 3D-Modellierung]]
|47    Cylinder:X2,Y2,-3,X2,Y2,0.1,A,$CCCCCC<br>||Display cylinder in 3D. X1, Y1, Z1, X2, Y2, Z2, Diameter, Color, (Champfer radius=0). The [[3D_Syntax|Syntax for the 3D modelling]] applies.
|-
|-
|48  ENDIF<br>||Ende der If-Abfrage. If-Abfragen können geschachtelt sein (nested). Doppelpunkt optional.
|48  ENDIF<br>||End of the If condition. If conditions can be nested. Colon optional.
|-
|-
|49 EndFor||Ende der For-Schleife. For-Schleifen können auch geschachtelt sein (nested). Doppelpunkt optional.
|49 EndFor||End of the For loop. For loops can be nested as well. Colon optional.
|}
|}
<br><br>
<br><br>
'''Bitte beachten:''' Die aktuell vorliegenden Variablenwerte für das konkrete SIL-Bauteil findet man im Debugger-Dialog auf der rechten Seite.<br><br>
'''Please note:''' The values of the variables for the current SIL package are denoted on the right hand side of the debugger dialog.<br><br>
 
=== 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.
=== Script commands ===


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.
==== General ====


Every '''textual indication''' (=string) is embedded in quotes. Example: "Hello".<br>
'''Coordinate indications''' are in metric scale [mm]. If you look on the X-Y-plane, the positive Z-axis points upward to the spectator.<br>
'''Numeric characters''' are rounded to 1/1000.<br>
'''Angle indications''' are in 0...360 degrees [°].<br>
The '''rotational direction''' is CCW (=CounterClockWise). 0° is east.
The '''right-hand-rule''' applies for all axes.<br>
'''Colors''' are indicated hexadecimally according to $BBGGRR. B represents Blue, G represents Green and R represents Red.<br><br>


==== Script Befehle im Einzelnen ====
==== Script commands in detail ====


Folgende Script-Befehle gibt es derzeit:
The following script commands currently exist:


*SCRIPT: Name des Scripts, der oben in der Auswahlbox gezeigt wird. Wirkt erst beim nächsten Öffnen des Generators.
*SCRIPT: Name of the script, shown in the selection box top left. Active with the next opening of the generator.
*HINT: Hinweis, der oben neben der Auswahlbox gezeigt wird.
*HINT: Hint which appears in the dialog right beside the selection box.
*COMMENT: Alles Folgende in dieser Zeile ist Kommentar
*COMMENT: All following in this line is comment.
*AUTHOR: Autor des Scriptes
*AUTHOR: Author of the script.
*DATE: Datum der letzten Änderung. Muss manuell geführt werden.
*DATE: Date of last modification. Needs to be controled/managed manually.  
*IMAGE: Dateiname des Imagees, das links gezeigt wird. PNG-Image immer 350x580 Pixel.
*IMAGE: File name of the image shown to the left. PNG-Image always 350x580 pixel.  
*TYPE: Gehäusetyp. Bitte aus der Datenbank aus package_types entnehmen.
*TYPE: Package type. Please inherit from data base "package types".  
*NAME: So wird ein Vorschlag für den Gehäusenamen beim Generieren erzeugt.
*NAME: 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.  
*NUM: Numerische Variable deklarieren. Name, Defaultwert, Hinweis, Anzeige. Anzeige fehlt=wird nicht gezeigt, EDT=editierbar, RDO=Read-Only. Variablennamen müssen mit einem oder mehreren Buchstaben beginnen. Dann können Ziffern folgen. Groß- und Klein-Schreibung wird nicht unterschieden.
*NUM: 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 recognized.  
*STR: Text-Variable deklarieren. Name, Defaultwert, Hinweis, Anzeige. Anzeige fehlt=wird nicht gezeigt, EDT=editierbar, RDO=Read-Only.
*STR: Declare text variable. Name, Default value, Hint, Display. Display missing=not shown, EDT=editable, RDO=Read-Only.  
*CALC: Berechnungen ankündigen. Variable=Ausdruck. Mehrere Berechnungen mit Komma trennen. Operatoren im Ausdruck: <nowiki>+, -, *, /, ()</nowiki>, mathematische Funktionen:
*CALC: Announce a calculation. Variable=Expression. More than on calculation separate by comma. Operators within the expression: <nowiki>+, -, *, /, (),</nowiki> mathematic functions:
**ABS(x) Absolutwert,
**ABS(x) Absolute,
**SIN(x) Sinus [°],
**SIN(x) Sinus [°],
**ASIN(x) Arcus Sinus,
**ASIN(x) Arcus Sinus,
Line 180: Line 198:
**TAN(x) Tangens,
**TAN(x) Tangens,
**ATAN(x) Arcus Tangens,
**ATAN(x) Arcus Tangens,
**MAX(x,y) Größerer Wert der Ausdrücke x und y,
**MAX(x,y) Major value of the expressions x and y,
**MIN(x,y) Kleinerer Wert der Ausdrücke x und y,
**MIN(x,y) Minor value of the expressions x and y,
**INT(x) Gerundete Ganzzahl,
**INT(x) Integer, rounded,
**SQR(x) Quadrat,
**SQR(x) Square,
**SQRT(x) Quadratwurzel,
**SQRT(x) Square root,
**EVEN(x) 1 wenn gerade, 0 wenn ungerade,
**EVEN(x) 1 if even, 0 if uneven,
**ODD(x) 1 wenn ungerade, 0 wenn gerade.
**ODD(x) 1 if uneven, 0 if even.
**Berechnungen für Zeichenketten kennen nur den Operator + für Anhängen und die folgenden Funktionen:
**Calculations for strings only know the operator + for appending and the following functions:
**NCH(i) Number-Character: 1=A, 2=B, ... 21=Z, 22=AA, 23=AB, ... 42=AZ, 43=BA ... (z.B. für die Zeilen-Namen von BGA-Gehäusen)
**NCH(i) Number-Character: 1=A, 2=B, ... 20=Y, 21=AA, 22=AB, ... 40=AY, 41=BA ... (e.g. for the line naming of BGA packages, without I,O,Q,S,X and Z)
**CHR(i) ASCII-Zeichen: 33=!, ... 65=A, 66=B, ... 90=Z, ... 97=a, 98=b, ... 122=z, ... 219=?
**NCZ(i) Number-Character: 1=A, 2=B, ... 21=Z, 22=AA, 23=AB, ... 42=AZ, 43=BA ... (e.g. for the line naming of BGA packages, without I,O,Q,S,X but with Z)
**INT(i) Gerundete Ganzahl
**CHR(i) ASCII-Characters: 33=!, ... 65=A, 66=B, ... 90=Z, ... 97=a, 98=b, ... 122=z, ... 219=?
**REAL(i) Dezimalzahl mit maximal 3 Stellen
**INT(i) Integer, rounded,
**REAL(i) Decimal character with 3 digits after the decimal point


*FOR: For-Schleife beginnen. Variablenname, Startwert, Endwert, (Schritt=1). Startwert und Endwert können Ausdrücke sein.
*FOR: 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.  
*ENDFOR: Ende der For-Schleife. For-Schleifen können auch geschachtelt sein (nested). Doppelpunkt optional.
*ENDFOR:End of the For loop. For loops can be nested. Colon optionally.  
*IF: If-Abfrage beginnen. Ausdruck Operator Ausdruck. Operatoren: =, <, >, <=, >=. Mehrere Bedingungen mit & (=and) verbindbar.
*IF: Start If condition. Expression Operator Expression. Operators: =, <, >, <=, >=. Combine several conditions by & (=and), | (=or).  
*ELSE: Else Zweig. Doppelpunkt optional.
*ELSE: Else branch. Colon optional.  
*ENDIF: Ende der If-Abfrage. If-Abfragen können geschachtelt sein (nested). Doppelpunkt optional.
*ENDIF: End of the If condition. If conditions can be nested. Colon optional.  
*PAD: Pad im Layout erzeugen. X, Y, Breite, Höhe, Bohrdurchmesser, Ebene, Form, Rotation, (Padname=''), (Lötpaste=True), (Lötstopp=True).
*PAD: Create a Pad in the layout view. X, Y, Width, Height, Drill diameter, Padnumber, Layer, Form, Rotation, (Padname=''), (Solderpaste=True), (Solderstopp=True).
**Ebene = Top oder Bot oder All
**Layer = Top or Bot or All
**Form = Rnd oder Oct oder Rct oder Ovl
**Form = Rnd or Oct or Rct or Ovl
**Lötpaste = True oder False
**Solder paste = True or False
**Lötstopp = True oder False
**Solder stopp = True or False
**Angaben in Klammern sind optional. Default wird verwendet.
**Specifications in brackets are optional. Default is going to be used.
*LINE: Linie im Layout zeichnen. X1, Y1, X2, Y2, (Linienbreite=0.3), (Ebenenfunktion=4=Bestückung oben).
*LINE: Draw a line in the layout. X1, Y1, X2, Y2, (Line width=0.3), (Layer Function=4=Position top).
**Ebenenfunktion: 3=Bestückung unten, 4=Bestückung oben, 12=Lötstopp oben, 15=Lötpaste oben, 16=Gold oben, 18=Kleber oben
**Layer function: 3=Position bottom, 4=Position top, 12=Solder stop top, 15=Solder paste top, 17=Gold top, 19=Glue top
*ARC: Bogen im Layout zeichnen. X, Y, Radius, Linienbreite, Startwinkel, Endwinkel, (Ebenenfunktion=4=Bestückung oben).
*ARC: Draw an arc in the layout. X, Y, Radius, Line width, Start angle, End angle, (Layer function=4=Position top).
*CIRC: Scheibe im Layout zeichnen. X, Y, Radius, (Ebenenfunktion=4=Bestückung oben).
*CIRC: Draw a circle in the layout. X, Y, Radius, (Layer function=4=Position top).
*TRI: Dreieck im Layout zeichnen. X1, Y1, X2, Y2, X3, Y3, (Ebenenfunktion=4=Bestückung oben).
*TRI: Draw a triangle in the layout. X1, Y1, X2, Y2, X3, Y3, (Layer function=4=Position top).
*RECT: Rechteck im Layout zeichnen. X, Y, Breite, Höhe, Rotation, (Ebenenfunktion=4=Bestückung oben).
*RECT: Draw a rectangle in the layout. X, Y, Width, Height, Rotation, (Layer function=4=Position top).
*TEXT: Text im Layout ausgeben. X, Y, Höhe, Breite, Rotation, Textinhalt, Zeichensatz, (Ebenenfunktion=4=Bestückung oben).
*TEXT: Display text in the layout. X, Y, Hight, Width, Rotation, Text content, Character set, (Layer function=4=Position top).  
**!NAME und !VALUE als Textinhalt werden später in den Namen und den Wert des Bauteils gewandelt.
**!NAME and !VALUE as Text content are later swapped by name and value of the real component.
**Zeichensatz= TARGET oder DIN-ISO-ANSI oder Arial oder Times New Roman ...
**Character set= TARGET or DIN-ISO-ANSI or Arial or Times New Roman ...
*SOLID: Quader in 3D ausgeben. X1, Y1, Z1, X2, Y2, Z2, Breite, Höhe, Farbe, (Abrundungsradius=0).
*SOLID: Display a cuboid in 3D. X1, Y1, Z1, X2, Y2, Z2, Width, Height, Color, (Champfer radius=0).  
*CYLINDER: Zylinder in 3D ausgeben. X1, Y1, Z1, X2, Y2, Z2, Durchmesser, Farbe, (Abrundungsradius=0).
*CYLINDER: Display cylinder in 3D. X1, Y1, Z1, X2, Y2, Z2, Diameter, Color, (Champfer radius=0).  
*TORUS: Bogen in 3D ausgeben. X oder Y oder Z, Xm, Ym, Zm, Radius, Durchmesser, Startwinkel, Endwinkel, Farbe.
*TORUS: Display arc in 3D. X or Y or Z, Xm, Ym, Zm, Radius, Diameter, Start angle, End angle, Color.
*SPHERE: Kugel in 3D ausgeben. Xm, Ym, Zm, Durchmesser, Farbe.
*SPHERE: Display a ball in 3D. Xm, Ym, Zm, Diameter, Color.
*POLYGON3D: In Z-Richtung extrudiertes Polygon in 3D ausgeben. N, X1, Y1, X2, Y2, ... Xn, Yn, Z1, dZ, Farbe.
*POLYGON3D: Display a polygon being extruded to Z-direction. N, X1, Y1, X2, Y2, ... Xn, Yn, Z1, dZ, Color.
*TEXT3D: Text in 3D ausgeben. X1, Y1, Z1, Höhe, Breite, Rotation, Zeichensatz, Textinhalt, Farbe.
*TEXT3D: Display text in 3D. X1, Y1, Z1, Hight, Width, Rotation, Character set, Text content, Color.
*3D: Zeile für 3D zusammenbasteln.
*3D: Create any line for 3D display.
*EXIT: Programm sofort beenden.
*EXIT: Quit program immediately.




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.<br>
If an array has e. g. n=16 poles, it needs to have Pad 1 below and Pad 8=n/2 and a row from Pad 2 to Pad 7=n/2-1.<br>
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.<br>
Above one needs Pad 9=n/2+1 and Pad 16=n. Inbetween one needs the row from Pad 10=n/2+2 to Pad 15=n-1.<br>
Im 3D braucht es ein linkes und ein rechtes Endstück und (n-4)/2 Zwischenstücke.<br><br><br>
In 3D one needs a left and a right endcap and n-4)/2 intermediate pieces.<br><br><br>


=== Speichern und aktivieren des Skriptes ===
=== Save and activate a script ===




Ein Script wird im Edit-Dialog erzeugt, verändert und gespeichert. Speicherort ist das Verzeichnis:
A script is activated modified and saved in the Edit-Dialog. Directory of storage is:


'''Benutzer\Name\AppData\Roaming\ibf\TarVxx\<Ausbaustufe>\PCK_gen'''
'''User\Name\AppData\Roaming\ibf\TarVxx\<Edition>\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.<br><br>
To this place also the *.png image is saved which contains the technical drawing of the part in question. This image appears in the dialog to the left. It makes sense giving them the same file name like the script has (not a must).<br><br>


=== Ein Script aus der Liste löschen ===
=== Delete a script from the list ===


Löschen Sie es einfach aus diesem Verzeichnis:<br>
Simply delete it from this directory:<br>


'''Benutzer\Name\AppData\Roaming\ibf\TarVxx\<Ausbaustufe>\PCK_gen'''<br>
'''User\Name\AppData\Roaming\ibf\TarVxx\<edition>\PCK_gen'''<br>


Dann ist es beim nächsten Öffnen auch aus der Liste verschwunden.<br>
With the next opening of the dialog it will be vanished from the list.<br>


<br><br>
<br><br>


== Ein schnelles Bauteil mit der N-Pole-Variante erzeugen ==
Wer kein Programmierer ist und keine Scripte erstellen will, wendet einfach den Bauteiltyp '''N-Pole''' an. In der Liste finden Sie ihn hier:
[[Image:npole_e.jpg|800px|Der Gehäusetyp N-Pole]]<br>Image:Der Gehäusetyp N-Pole
Die Idee ist, einfach einen bestimmten Gehäuseumriss mit einer bestimmten Art und Anzahl Pads zu erstellen und in der Bauteildatenbank abzuspeichern. Zwar mag das Gehäuse nicht unbedingt einen Schönheitspreis gewinnen, aber der Generator hat Ihnen schon mal nicht wenige Konstruktionsschritte abgenommen. Diesen "Rohling" holt man später ins Layout herein, schiebt die Pads in Position und speichert erneut (ggf. unter einem anderen Namen) ab. Im Layout können Sie das Bauteil jederzeit verfeinern und erneut abspeichern.




<br><br>
<br><br>
[mailto:target@ibfriedrich.com?Subject=Gehaeuse_Generator Zu diesem Thema habe ich eine Frage]
[mailto:target@ibfriedrich.com?Subject=Package_Generator I have a question here]
<br><br><br>
<br><br><br>




[[de: Gehäuse-Generator]][[fr: Générateur de boîtier]]
[[de: Gehäuse-Generator]][[fr: Générateur de boîtier]][[category:homepage]]

Latest revision as of 08:20, 11 September 2018

Get footprint pattern and 3D model.
Select default from the list. Enter dimensions. Done.

Video (3:28 Min)

Video (3:28 Min)


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


The dialog consists of four sections. Starting from the left: A list of various defaults to the left where you select your desired type of component. Right beside a technical drawing containing the definition of the parameters of the part. Such a drawing can be found in every data sheet. This image can not be modified here. Right beside the technical drawing you see the list of parameters, where all values according to the specifications of the data sheet can be entered. 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 left of it. Up to the right the package image can be seen the way it appears in the layout later. Below the 3D image is shown.

Please select the default component type 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 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.

Generate the desired package
Generate the desired package

Image: Generate the desired package in order to save it under an individual name.

The more information you add to the dialog above, the better. You will find the package now in the range of designated package types by the particularly given name.


Quick creation of a package using the N-Pole type

The package types in the list top left are based on a script. You can establish a new component type by saving a new script to a certain TARGET directory. 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:

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 blank" to a layout, finish it correctly there 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 by a different 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:

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

The setup of a script by an example

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 one 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, Padnumber, 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, 17=Gold top, 19=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, 17=Gold top, 19=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, 17=Gold top, 19=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, 17=Gold top, 19=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, 17=Gold top, 19=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
Display a cuboid in 3D. X1, Y1, Z1, X2, Y2, Z2, Width, Height, Color, (Champfer radius=0). The Syntax for the 3D modelling applies.
40 Text3D:-X1+1.5,-0.5,F+H+0.01,1.2,0.5,0,"DIN-ISO-ANSI","!Value",$FFFFFF
Display text in the 3D image. X1, Y1, Z1, Height, Width, Rotation, Character set, Text content, Color. The Syntax for the 3D modelling applies.
41 Cylinder:-X1,0,F+H-0.1,-X1,0,F+H+0.01,1,$FFFFFF
Display cylinder in 3D. X1, Y1, Z1, X2, Y2, Z2, Diameter, Color, (Champfer radius=0). The Syntax for the 3D modelling applies.
42 For:I,1,N
For loop in order to create the 3D leads iteratively
43 Calc:X2=-X1+P*(I-1),Y2=0,Z=(F+H)/2
Announcement of a calculation
44 IF:B>0
Start If condition. Expression Operator Expression. Operators: =, <, >, <=, >=. Combine several conditions by & (=and).
45 Solid:X2,Y2,-3,X2,Y2,0.1,A,B,$CCCCCC,0
Display a cuboid in 3D. X1, Y1, Z1, X2, Y2, Z2, Width, Height, Color, (Champfer radius=0). The Syntax for the 3D modelling applies.
46 ELSE
Else branch. Colon optional.
47 Cylinder:X2,Y2,-3,X2,Y2,0.1,A,$CCCCCC
Display cylinder in 3D. X1, Y1, Z1, X2, Y2, Z2, Diameter, Color, (Champfer radius=0). The Syntax for the 3D modelling applies.
48 ENDIF
End of the If condition. If conditions can be nested. Colon optional.
49 EndFor End of the For loop. For loops can be nested as well. Colon optional.



Please note: The values of the variables for the current SIL package are denoted on the right hand side of the debugger dialog.

Script commands

General

Every textual indication (=string) is embedded in quotes. Example: "Hello".
Coordinate indications are in metric scale [mm]. If you look on the X-Y-plane, the positive Z-axis points upward to the spectator.
Numeric characters are rounded to 1/1000.
Angle indications are in 0...360 degrees [°].
The rotational direction is CCW (=CounterClockWise). 0° is east. The right-hand-rule applies for all axes.
Colors are indicated hexadecimally according to $BBGGRR. B represents Blue, G represents Green and R represents Red.

Script commands in detail

The following script commands currently exist:

  • SCRIPT: Name of the script, shown in the selection box top left. Active with the next opening of the generator.
  • HINT: Hint which appears in the dialog right beside the selection box.
  • COMMENT: All following in this line is comment.
  • AUTHOR: Author of the script.
  • DATE: Date of last modification. Needs to be controled/managed manually.
  • IMAGE: File name of the image shown to the left. PNG-Image always 350x580 pixel.
  • TYPE: Package type. Please inherit from data base "package types".
  • NAME: 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.
  • NUM: 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 recognized.
  • STR: Declare text variable. Name, Default value, Hint, Display. Display missing=not shown, EDT=editable, RDO=Read-Only.
  • CALC: Announce a calculation. Variable=Expression. More than on calculation separate by comma. Operators within the expression: +, -, *, /, (), mathematic functions:
    • ABS(x) Absolute,
    • SIN(x) Sinus [°],
    • ASIN(x) Arcus Sinus,
    • COS(x) Cosinus,
    • ACOS(x) Arcus Cosinus,
    • TAN(x) Tangens,
    • ATAN(x) Arcus Tangens,
    • MAX(x,y) Major value of the expressions x and y,
    • MIN(x,y) Minor value of the expressions x and y,
    • INT(x) Integer, rounded,
    • SQR(x) Square,
    • SQRT(x) Square root,
    • EVEN(x) 1 if even, 0 if uneven,
    • ODD(x) 1 if uneven, 0 if even.
    • Calculations for strings only know the operator + for appending and the following functions:
    • NCH(i) Number-Character: 1=A, 2=B, ... 20=Y, 21=AA, 22=AB, ... 40=AY, 41=BA ... (e.g. for the line naming of BGA packages, without I,O,Q,S,X and Z)
    • NCZ(i) Number-Character: 1=A, 2=B, ... 21=Z, 22=AA, 23=AB, ... 42=AZ, 43=BA ... (e.g. for the line naming of BGA packages, without I,O,Q,S,X but with Z)
    • CHR(i) ASCII-Characters: 33=!, ... 65=A, 66=B, ... 90=Z, ... 97=a, 98=b, ... 122=z, ... 219=?
    • INT(i) Integer, rounded,
    • REAL(i) Decimal character with 3 digits after the decimal point
  • FOR: 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.
  • ENDFOR:End of the For loop. For loops can be nested. Colon optionally.
  • IF: Start If condition. Expression Operator Expression. Operators: =, <, >, <=, >=. Combine several conditions by & (=and), | (=or).
  • ELSE: Else branch. Colon optional.
  • ENDIF: End of the If condition. If conditions can be nested. Colon optional.
  • PAD: Create a Pad in the layout view. X, Y, Width, Height, Drill diameter, Padnumber, Layer, Form, Rotation, (Padname=), (Solderpaste=True), (Solderstopp=True).
    • Layer = Top or Bot or All
    • Form = Rnd or Oct or Rct or Ovl
    • Solder paste = True or False
    • Solder stopp = True or False
    • Specifications in brackets are optional. Default is going to be used.
  • LINE: 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, 17=Gold top, 19=Glue top
  • ARC: Draw an arc in the layout. X, Y, Radius, Line width, Start angle, End angle, (Layer function=4=Position top).
  • CIRC: Draw a circle in the layout. X, Y, Radius, (Layer function=4=Position top).
  • TRI: Draw a triangle in the layout. X1, Y1, X2, Y2, X3, Y3, (Layer function=4=Position top).
  • RECT: Draw a rectangle in the layout. X, Y, Width, Height, Rotation, (Layer function=4=Position top).
  • TEXT: Display text in the layout. X, Y, Hight, Width, Rotation, Text content, Character set, (Layer function=4=Position top).
    • !NAME and !VALUE as Text content are later swapped by name and value of the real component.
    • Character set= TARGET or DIN-ISO-ANSI or Arial or Times New Roman ...
  • SOLID: Display a cuboid in 3D. X1, Y1, Z1, X2, Y2, Z2, Width, Height, Color, (Champfer radius=0).
  • CYLINDER: Display cylinder in 3D. X1, Y1, Z1, X2, Y2, Z2, Diameter, Color, (Champfer radius=0).
  • TORUS: Display arc in 3D. X or Y or Z, Xm, Ym, Zm, Radius, Diameter, Start angle, End angle, Color.
  • SPHERE: Display a ball in 3D. Xm, Ym, Zm, Diameter, Color.
  • POLYGON3D: Display a polygon being extruded to Z-direction. N, X1, Y1, X2, Y2, ... Xn, Yn, Z1, dZ, Color.
  • TEXT3D: Display text in 3D. X1, Y1, Z1, Hight, Width, Rotation, Character set, Text content, Color.
  • 3D: Create any line for 3D display.
  • EXIT: Quit program immediately.


If an array has e. g. n=16 poles, it needs to have Pad 1 below and Pad 8=n/2 and a row from Pad 2 to Pad 7=n/2-1.
Above one needs Pad 9=n/2+1 and Pad 16=n. Inbetween one needs the row from Pad 10=n/2+2 to Pad 15=n-1.
In 3D one needs a left and a right endcap and n-4)/2 intermediate pieces.


Save and activate a script

A script is activated modified and saved in the Edit-Dialog. Directory of storage is:

User\Name\AppData\Roaming\ibf\TarVxx\<Edition>\PCK_gen

To this place also the *.png image is saved which contains the technical drawing of the part in question. This image appears in the dialog to the left. It makes sense giving them the same file name like the script has (not a must).

Delete a script from the list

Simply delete it from this directory:

User\Name\AppData\Roaming\ibf\TarVxx\<edition>\PCK_gen

With the next opening of the dialog it will be vanished from the list.






I have a question here