Welcome to the CADSTARguys Blog - Information, hints, tips and my waffle on the CADSTAR Printed Circuit Board design suite.

Please note that all names used are completely fictitious and any thing written is my own personal opinion or knowledge and not related in any way to either my employers or their customers (or Zuken).
Also this is not a replacement for proper Maintenence/support and you should read the help files before asking anything techy:).

Thursday, 30 January 2014

Library version control.

Would you like to be able to keep records of what changes are made to your library symbols/components and parts? Who created them, when were they made, why they were changed, what their change history is etc?

Well you can, it does not need any external programs, OLE or version control software - you can do it all within CADSTAR using various attributes in the libraries.

For example, if on your symbols you want to record:
Who created it, when it was created, when and why it was modified etc

Then first decide what attributes you want, what content they are likely to have and when and how you want to extract this information. Note them down so you know what they are for and when to use them.

What you then need to do is add these attributes to your symbols, to do this you first have to create the attribute names.

You can create these attributes in your symbol library and then modify existing symbols but to me the best place to create them is in your symbol template.

From the menu "File\New\Schematic Symbol" - choose your Default template.
Then in "Settings\Attribute Names" choose "Add", type in the name and choose the usage of  "Symbol Definition" on "All Design Types".
Adding the attribute name.
Do this for each attribute that you want in your schematic symbol library, then without adding anything else into the blank symbol use "File\Save as template" and then select and overwrite your template file.

Now, whenever you create a new symbol you will automatically have the attribute fields available to you, then after you have saved a symbol into the library using this template, when you edit an existing symbol you will have them available to fill in.

To test this, start a new symbol - add terminals/outlines to it and then use "Library\Schematic Symbols" and "Save Symbol" and name the symbol as normal, but before you complete the save select the Attributes tab at the top of the symbol properties dialogue.

If you select the Attribute Of: "Symbol Definition" at the bottom left then it will display all the attribute fields ready to fill in. Populate them as required:

Symbol Properties - Symbol Attributes tab

Not to forget that you can add multiple lines so you have a field for comments, history, modification details etc. Also that for the very first one if an attribute has no content then it is not saved in the library.

Do similar for your Component library - these are also attributes of Symbol Definition and All Design Types and should be added to your component template file in the same way.

I have chosen to precede all schematic symbol attribute names with "Symbol", and in the same attribute types in the component library they are preceded by "Component" so that I can differentiate between the various fields.

Test populate a few symbol and components with records and then you can see how you can extract this information.

Within a schematic that has some of these symbols in, use Actions\Attribute Editor and then have a look on the symbol definition tab. Here you will see the attributes that you have populated. (Similar for components in the PCB.)

OK that's nice - you can view them in a design but how about getting a report with them in?

Selecting the attribute element.
This too can be done by using the Report Generator.
For the schematic create a "For each symbol" loop, add the usual items
 like "Name" etc and to obtain the attribute information use the element
"Attribute\Attribute Text" and the attributes names will be available
as "Symdef attribute".

Here are the details of an example schematic report:

For Each Symbol (Symbol) Sorted by Name
  Symbol.Name
  Symbol.Symbol Created By.Text
  Symbol.Symbol Creation Date.Text
  Symbol.Symbol Last Modification Date.Text
  Symbol.Symbol Version.Text
Next

This gives me a report with the data held by the symbols, it can be adjusted to suit and used for whatever purpose.

You can also do similar in the PCB by using a "for each component" report.

What if you modify the symbol yet want to keep a copy of the old one?
This you cannot do unless you rename it - but them why on earth would you want to keep it in your working library (an easy way for an error to occur). If you really need to keep old versions then simply open them, use File\Save As and save it using a naming convention that identifies the version etc.
Then either delete it from the library - or save your new version overwriting the previous version.

Using version control attributes on parts:
Then we come to parts, these too can be given attributes that can be used for version control - named like part created by, part checked by, part approved by and so on.
Perhaps make them using attribute names that are set as parts library usage, with this the attribute can be seen in the attribute editor on the part definitions tab but will not clutter your user attributes section in the colours setup and they cannot be seen in the schematic.
You can of course extract them using the report generator using a "for each part" report.

This is manual record keeping - not automatic.
Of course - these records will only be as good as the people keeping them, if you do not enter the changes when you create/modify a symbol then you will not be able to find out what/why later on.

There is nothing automatic about this process, you will still need to use the CADSTAR version control to ensure that you have the latest versions in your designs and cannot make any changes based on this information.

I have a sample setup with example CS14 attributes in that I will make available once I have had time to tidy them up.

If this works for you please leave a comment, if not also leave a comment and tell me why or if your struggling and want some advice - leave a comment. (hey - just comment.)

2 comments:

Smelter said...

Ok so we bought Cad* last year and we are still on the starting block (legacy designs in our existing CAD package are still holding us back) so I apologise in advance if I use the wrong terms, but here we go.
So Cad* has a "Symbol" which is matched to a unique "Component", into which do I place the in-house stock code?
I plan to place the manufactures code attribute and the supplier(s) code(s) attribute into the symbol and it seems to make sense to also have our in-house stock code in the "Symbol" to create a BOM (for buying/costings) before doing the PCB layout.
But I need to have the in-house stock code in the "Pick & Place" file for our surface mount machine to work.
Do I duplicate the in-house stock code attribute (error prone) or can the report generator pull attributes from both the "Component" and its matched "Symbol" to produce the "Pick & Place" file?

The CADSTAR Guy's Blog. said...

No, no no no NO! (Shakes finger and sighs.)

Do not do it that way.

The symbol is a shape used to indicate a circuit element, like a resistor symbol, a transistor symbol.
You have 1 resistor symbol that you use many times for different physical resistors and they can be made by Rohm, Vishay or anyone else so recording this information in the "symbol" is the wrong way to do it.

If you put the manufacturers code in the resistor symbol, and you use it for a part from rohm then use the same symbol for a part from Vishay then the vishay part will contain the Rohm information.

See whats happening there?


You are talking about information that belongs to a "part" the part is what joins a symbol and a component together to make the parts that you have in the stores.

The part calls for symbol xxx and component yyy and has the manuffacturers information stored in the part entry itself.


This information should be added using an attribute within the part library and it should have the usage of "part definition" so that the information is held within the part and can be accessed using the attribute editor when you look at the part entry in the symbol properties in the design. (and I say "symbol properties" because when it is in a design the symbol will actually be placed as a "part.)

This information can also be extracted from the pcb through the component properties and the attribute editor for a quick look, to extract it for the placement program the report generator can be used with the element "Attribute Text" and choose the part attribute.

I can see that I need to do a tutorial on how to setup attributes for a library so that they can be extracted when and where needed the correct way.
Might take a while to get it right though, have to dot the T's and cross the i's. :)

If you bought CADSTAR last year, did you get any training? If so there is information on attributes on the memory stick you should have received.
If on maintenance then contact your support guy and ask him to explain how all this attribute stuff works.

Post a Comment