Commands fit into different categories, each with their own different edit dialogs as follows:
Item Field Commands
This is the basic command for a report, used to output some information about an item in the design. These commands are listed in the bottom section of the command list box in the dialog. Only the fields that can extracted from the currently selected command in the script will be listed. So if the currently selected command is within the indented command set following a “List of Pins ” command, the only fields available will be component pin fields (“Pin Name ” for example). Note: if you select a command in the script, the current design item type is displayed at the top of the command list box.
When you edit an Item Field Command you get displayed an Edit Value dialog to set up how the information will be output to the report. You can specify if this field is the start of a new column, how wide the column is, any text to be output before and after the field and whether a new line should be started in the report after the field is written.
The item field commands divide into many categories, each with their different edit dialogs as follows:
- Attributes
- The value of a specified attribute on the current item.
- Positions - You can output either coordinate, or the whole position.
- Questions - where the value is always “true” or “false”. For example ” Is Selected” and “Is SMD”. These fields are usually used in the If command, explained below.
- Extents - allows you to choose from a list of sub-fields e.g. “Width”.
- Pad Style - allow you to choose from a list of sub-fields e.g. “Drill Diameter”.
Additional item field commands available for the Pulsonix Database Connection option:-
- Database Value - The ‘live’ value of a specified Database field for the current item.
- Database Status - The result of the last Database Check on the item.
Fixed Field Commands
These commands report a fixed string that is specified by the Edit Fixed Field dialog, or implied by the name of the command.
- Blank Lines
- End of Line - end the current line in the report and starts a new line.
- Text
- Multi-Line Text
- Line Number - reports the current line number in the report.
- Underline - underlines the previous line reported with the chosen character.
Control Flow Commands
-
When the report is run the commands in the script act on a current item from the design. When the script starts, the current item is the design itself. You can report fields from the design, like ‘Design Author’ for example, to build up a report header. To report information from items within the design, like components and nets, you need to spin through a list of these items using the “List of …” commands available in the middle section of the commands list box.
For example when the “List of Components” command is run the indented set of commands in the script following this command are run for each component in the design. Each component in turn becomes the “current item” to be acted upon by the indented command set.
In the example above each component in the design has its name reported followed by all of its pin’s names.
The list command can be edited to set up sorting criteria to specify the order in which the items in the list are processed.
Some List Field Commands are available to provide information about the list being processed.
-
List - Total Count - reports the number of items in the current list. E.g. the number of components in the design.
-
List - Reported Count - reports the number of items already processed in the list that have had at least one field written to the report file.
-
List - Current Item No. - reports the index of the current item within the list, i.e. 1 for the first item in the list, etc.The lists that are available in the command list box in the dialog depend on the command currently selected in the script. So in our example, if “List of Components” was selected, the current item when the script is running would be the design itself and so many lists will be available. If the “Component Name” command was selected, the current item when the script is run would be a component, and so only lists that apply to a component are available e.g. “List of Pins”.
One special list is the “List of Component Groups”. This enables you to process a list of component “groups”, instead of a “List of Parts”. A component group is defined by entering a set of component attributes that have to have the same value on two components for them to be in the same group.
-
-
Add this command to the script using the If button. A dialog will be presented to set up the test criteria. The If command allows you to test a value against a supplied condition and perform a set of commands if the result is true, or else (optionally) run an alternative set of commands if the result is false. The value being tested can be either a design item field, or the current value of a variable (see ‘Variables’ below). The value it is tested against can be a fixed value or the current value of another variable.
For example you can add a command to do: “If the current component is mirrored ” write “Bottom Side” else write “Top Side” to the report as follows:
-
Add this command to the script using the While button. A dialog will be presented to set up the test criteria. The While command allows you to perform the set of indented commands following it, while a variable’s current value satisfies a supplied condition. (See “Variables” below).
-
Cancel Report - when this command is run the report generation will be stopped and the report thrown away.
-
Finish Report - when this command is run the report generation will be stopped and the report saved with its current contents.
Report Drawing Commands
If the current report is being generated as part of an inserted user report, it is being drawn into the design. These commands are to do with drawn reports.
- Draw Line - This will draw a horizontal line in the report, between the two edges of the report box outline. If not drawing the report nothing will be reported.
- Is Drawing Report - This tests whether the current report is being generated as part of an inserted user report, and therefore being drawn in the design. Use this to report different information if you are inserting the report into a design rather than running it to a file.
Report Formatting Commands
These commands control how the report is formatted.
-
Use this command to define the units to use to format any design positions or lengths written to the report from this point on. If this command is not used, the units defined in the current design will be used.
-
Use this command to define the units to use to format any design item angles written to the report from this point on. If this command is not used, the angle units defined in the current design will be used.
-
Report File Extension - used to define a particular extension to be used for the report file.
-
CSV - include this command to specify that the report is written using comma separated values, required by some spreadsheet applications.
-
Fixed Column Output - include this command if the report represents an output that has fixed column widths. In this mode, text in a column will be truncated if it is longer than the column width, and no space will be ’ forced’ between columns.
Run Commands
These commands run another option when they are processed during the generation of a report:
-
Runs another report, either to a separate file, or to the same report currently being generated. this ‘other’ report can be one of the standard reports or another format file report. You can use this to combine reports into one report. See the “PCB Acceptance Report” format file for an example of these commands.
-
Use this to run a design rule check on the current PCB design. The DRC report can be written to a separate file, or included in the report currently being generated. See the “PCB Acceptance Report” format file for an example of this command.
-
Use this to run an electrical rules check on the current Schematics design. The ERC report can be written to a separate file, or included in the report currently being generated. See the “Schematics Acceptance Report” format file for an example of this command.
-
Use this to run a database check on the current PCB or Schematics design. The report can be written to a separate file, or included in the report currently being generated. See the “PCB Acceptance (Database)” format file for an example of this command.
Variables
From the top section of the commands list you can add a variable command. Variables are user named fields that have their values assigned during the running of the report. They can be used in a report for many purposes, including counts, remembering names, remembering the previous item’s fields, calculating largest sizes, and many more uses.
If the variable is of type “Number”, use the Number Format command to set the precision and decimal point character to be used in the report.