PCI

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

1

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Creating PCI Templates

The creation of PCI templates provides an alternative way of creating a basic PCI based on a sequence of
manufacturing instructions. The PCI created will contain a user-specified selection of existing instructions,
with or without their dialog input and a single form-fill input for the variables used.

The advantages over the more traditional methods of command capture are :

The sequence can be developed and edited until you are satisfied before committing it to PCI form.

The variables used to add flexibility to the PCI will be collected together automatically into a single
dialog to be completed at run-time.

Common geometry, used by more than one cycle within the PCI will be digitised once when running
the PCI and this will not need to be repeated for each cycle.

It is not recommended that PCI templates are saved to the \cam\operates folder because the operation PCIs
are stored in it.


See Also

Designing the PCI

Sequence of Events

Building the PCI

Run-Time Variables

Adding Comments and Prompts

Finishing the PCI

Changing the Order of Directives within the PCI

Using Comments within the PCI

2

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Designing the PCI

Even though you are using an auto-generator to create your PCI it is absolutely essential that you have a
clear understanding of the purpose and limitations of the PCI that you are creating. A brief “design phase”
with conclusions noted down before starting work on the PCI will greatly streamline the process.

The following questions should be considered and answered before starting work:

What is the purpose of the PCI?

1.

What circumstances must it cater for, what is the likelihood of encountering conditions that it won’t
meet?

2.

Who will use it, and what is their level of understanding?

3.

Will the PCI create a complete sequence or is it intended to generate a series of instructions as part
of a larger sequence?

4.


As you create the sequence and ultimately your PCI a further set of questions arise. The earlier in the
project these are answered the more efficient the PCI creation process will be.

What is the optimum sequence of instructions to be included?

1.

Which machining parameters can be safely left as fixed values and which will need to be set up as
run-time variables?

2.

Which instructions need to present full dialog interfaces at run-time?

3.

Do any of the user prompts need clarification or expansion.

4.

A PCI created in an inch environment will run in metric and vice versa but no attempt will be made to
convert any values entered. Particular care must be taken in respect of feeds, speeds and cut
increments/offsets if this circumstance is likely to arise.


See Also

Usual Sequence of Events when Creating a PCI

3

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Sequence of Events

The following provides a guide to the usual sequence of events when creating a PCI.

Decide the purpose and outline requirements of the PCI.

1.

Create an EdgeCAM sequence that performs the desired functions.

2.

Decide which cycles will present full dialogs and where run-time variables should replace fixed values.

3.

Where necessary, edit the sequence to place variables in the cycles.

4.

Make sure that the sequence contains no unnecessary commands.

5.

Ensure that the sequence contains adequate comments.

6.

Create the PCI.

7.

Test the PCI, first on identical geometry and then on variants of the geometry to ensure that it runs
correctly and that prompts etc are adequate.

8.

If necessary, edit the PCI (see Finishing the PCI).

9.

If the PCI is intended for general use, always get another user to carry out tests, in addition to your
own, before releasing it for production use.

10.

4

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Building the PCI

There are two ways of creating PCI templates.

Select the PCI Template (Custom menu) command, OR

Select the required commands in the Sequence Window. With a right-hand mouse click, open the
shortcut menu and select the PCI Template option.


To generate a PCI using the menu command

Select the PCI Template (Custom menu) command. You will be prompted for the PCI file name that
you want to create.

1.

Enter a name for the .pci file. You will be presented with a list of the instructions in the current
sequence.

2.

Pick the instructions to be included by selecting the individual instructions with a left-hand mouse click.

3.

Tip - Selecting Instructions

If required, use the Comments field to display a header/basic description before the initial user
request at run-time. This allows you to explain the purpose of the PCI and to tell the user which
geometry elements to select.

4.

To generate a PCI using instructions in the Sequence Window

Select the instructions you want to include in the PCI.

1.

With a right-hand mouse click, open the shortcut menu and select the PCI Template option. You will
be prompted for the PCI file name that you want to create.

2.

It is not recommended that PCI templates are saved to the \cam\operates folder because the operation
PCIs are stored in it. We suggest you save your PCI templates to the \cam\pci folder in your EdgeCAM
installation.

See Also

Selecting Instruction Dialogs

Selecting Geometry

5

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Selecting Instruction Dialogs

It is possible that at run-time you will want your PCI to give users the opportunity to change the parameters
of one or more cycles. The next stage in PCI creation is to select those instructions.

You will be presented a list of instructions containing all those instructions that were previously picked for
the PCI.

Highlight the instructions that you want to show an input dialog.

1.

Press OK to complete.

2.

Your PCI will now be automatically created. PCIs created using the PCI Template command will generate a
“Define Operation” record containing the name of the PCI in the sequence of instructions .

6

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Selecting Geometry

When the PCI is created any geometry used by more than one cycle will be identified and at run-time the
user will be given a single prompt to select it at the start of the PCI.

If you want to give users of the PCI additional instructions for selecting geometry they can easily be added
to the basic PCI. You can either add these instructions at the time of PCI creation by using the Add
Comment (M-Functions menu) command (see Adding Comments and Prompts) or at a later stage in an
editor (see Finishing the PCI).

7

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Run-Time Variables

To give users of the PCI flexibility you may want to use variables in certain dialog fields instead of fixed
values. Where only one or two fields are variable this may be preferable to displaying the whole dialog.

Any numeric entry field can be filled with a user-defined variable. Simply enter the variable name in the
appropriate field, enclosed in square brackets [ ]. For example you may wish to give the user the
ability to specify the cut increment for a profile cycle – Use [Finish-Profile-Cut-Increment].

When you use a variable in this way you will be prompted to enter a value. This value will become the
default value in the PCI variable input dialog, which is displayed for data input at run-time. All the
variables in a PCI are collected together in a single dialog at the beginning.

Each PCI variable must be unique within an individual PCI and for the purposes of automatically
created PCIs the names should be self-explanatory in meaning.

Note that if a cycle is to present a full input dialog at run-time there is no point in placing named variables in
the input fields.

8

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Adding Comments and Prompts

As the PCI works through your instruction list, all the usual cycle prompts will be presented to the user.
Where specified, full input dialogs will also be presented. The sequence of instructions generated will be
added to the Sequence Window as they are completed.

If you wish to give the PCI user additional information then comment instructions can be placed in the
sequence of instructions by using the Comment (M-Functions menu) command . Comments will be added
to the NC file if the sequence is passed to the Code Generator.

Example


Comments beginning with a ‘?’ will be converted to user prompts (using the PCI %DISPLAY directive) and
will not appear in the sequence or NC file created when the PCI is used.

Alternatively, additional PCI prompts and instructions can be added afterwards using an editor. See
Finishing the PCI.

9

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Finishing the PCI

The automatically generated PCI will be in the form of a text file which can, if you wish, be edited to make it
even more flexible or to give the user additional information.

Simple additions can be made to make the PCI more specifically applicable to your own circumstances,
using any valid PCI directive. See PCI Directives.

You may find the following directives especially useful:

To add additional instructions or information for the user

To add more variables or to subdivide the automatically generated form

To change the prompt shown to the user when digitising geometry

Run-time environment

Your PCI template will contain a check to ensure that it is run in the correct machining environment,
therefore a lathe PCI cannot be run in mill mode. If you want to use, for example, a mill PCI on CY lathe
parts it is necessary to modify the %IF [&3AXMILLL] = 0 statement in the PCI. See PCI System Variables.

Please note that PCI templates have not been designed for use in the wire environment. If used, severe
limitations will be encountered.

10

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Changing the Order of Directives within the PCI

This is not recommended until you have gained experience in writing and using PCIs as placing directives in
the wrong context or position could alter the way in which a PCI behaves.

The commands in a PCI mostly relate to the instructions in the EdgeCAM sequence with the directives
group relating to each instruction starting with a %InitCommand= directive and finishing with a
%ExecCommand directive.

Example

%InitCommand=cmd0=7,108

%ClearMods=[cmd0]

* Setting modifier 'Comment'

%SetModifier=[cmd0],15,Rough Turn from billet

%ExecCommand=nRet=[cmd0],-1

In general, if you want to move %DISPLAY or %ASKBOX directives to alternative positions in the PCI they
should be placed between such instruction groups rather than in the middle of them.

11

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Using Comments within the PCI

Comments for your own information when maintaining the PCI should start with a “*” character. Any line
starting with “*” will have no effect on the PCI.


Example

* Request for additional variable data

* Finishing profile command

Remember that * comments are for the PCI writer’s benefit only. Users of the PCI will not see them as the
PCI runs.

Note that the auto-generation process places a number of comments in the PCI file anyway to make it
easier to understand:


Example

* Setting modifier 'Gauge Point'

%SetModifier=[cmd0],214,Orthogonal|3

12

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Creating a Simple PCI

The following sequence lists the actions required to create a PCI file. The PCI is to be able to prompt the
user to specify the height, length and origin for a rectangle.

Display the PCI Variables Window.

1.

Activate the command save – Command Save On (Custom menu).

2.

Request parameters for rectangle – Define Askbox (Custom menu).

3.

Enter Prompt string for rectangle height – for example, “Enter rectangle height”.

Enter Variable name for rectangle height – for example, HEIGHT.

Enter Prompt string for rectangle width – for example, “Enter rectangle width”.

Enter Variable name for rectangle width – for example, WIDTH.

Select the Complete option to indicate that parameter definition is complete. A dialog box displays
the prompts.

3.

Enter the initial values for the height and width, and select OK.

4.

Right click on the PCI Variable tab in the window and select New from the shortcut menu to open the
Define Variable dialog.

5.

Enter Prompt String for origin – for example, Digitise origin for rectangle.

6.

Select Digitise from the list for the Numeric value option

7.

Enter Variable name for rectangle origin – for example, ORIGIN.

8.

Select OK and digitise the location of the initial origin (specific co-ordinates can be entered via the Co-
ordinate input sub-modifier).

9.

Select the Polyline button.

10.

Select the Co-ordinate input button, and enter these lines in the command box (including commas).
When you run this PCI, the ORIGIN, WIDTH and HEIGHT variables will be replaced by the values you
type in. ORIGIN is slightly different because the variable contains an X, Y and a Z value. You can
specify the co-ordinate by prefixing ORIGIN with 'X@', 'Y@', or 'Z@', as shown below.

11.

X[X@ORIGIN]Y[Y@ORIGIN],

IX[WIDTH],IY[HEIGHT],IX-[WIDTH],IY-[HEIGHT]

Select the Finish button.

12.

Complete the PCI save by selecting the Command Save Off (Custom menu) command, and define a
directory path and filename to which the PCI is saved.

13.

The PCI can then be accessed from the Run command file (Custom menu), by selecting the file.

See Also

The Simple PCI Example File

13

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

The Simple PCI Example File

This PCI will create a rectangle after prompting the user for height, width and the rectangle origin. These
values are held in the variables HEIGHT, WIDTH and @ORIGIN respectively. This example also contains
inline comments that have been generated automatically during the command save.

%ASKBOX=Enter rectangle height=height=Enter rectangle width=width

%ASKDIG=Digitise origin for rectangle=origin

* Initialising command:- Line

%INITCOMMAND=cmdh=2,1

%CLEARMODS=[cmdh]

* Setting modifier 'Polyline'

%SETMODIFIER=[cmdh],155,1

* Setting modifier 'Colour'

%SETMODIFIER=[cmdh],1,Aquamarine|20

* Setting modifier 'Layer'

%SETMODIFIER=[cmdh],3,15

* Setting modifier 'Style'

%SETMODIFIER=[cmdh],2,Solid|0

%INITDIGINFO=gdh1

* Add Free dig to Digitised input data

%ADDFREEDIG=[gdh1],PX[X@ORIGIN]Y[Y@ORIGIN]

* Add Free dig to Digitised input data

%ADDFREEDIG=[gdh1],IX[WIDTH]

* Add Free dig to Digitised input data

%ADDFREEDIG=[gdh1],IY[HEIGHT]

* Add Free dig to Digitised input data

%ADDFREEDIG=[gdh1],IX-[WIDTH]

* Add Free dig to Digitised input data

%ADDFREEDIG=[gdh1],IY-[HEIGHT]

* Finish Digitised input

%ADDFINISHDIG=[gdh1],[#FINISH]

%EXECCOMMAND=cmdret=[cmdh],[gdh1]

%FREEDIGINFO=[gdh1]

14

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

PCI Syntax

PCI Directives and variables are not case-sensitive and can be identified by their prefix. Here is a list of
prefixes and other syntax used within the PCI system:

%

PCI directive prefix, for example %ASKBOX

$

String variable prefix, for example $array

X@

Digitised position variable prefix, holding the X co-ordinate

Y@

Digitised position variable prefix, holding the Y co-ordinate

Z@

Digitised position variable prefix, holding the Z co-ordinate

&

System variable prefix, for example &PLUNGEFEED

#

Read-only variable prefix, for example #FREEDIG

*

Comment line, not processed by the PCI system, for example

* This is a comment line

[ ]

Use the contents of these brackets, for example
%IF[ANG]=>[EANG]%GOTO=endloop

( )

Perform an operation in these brackets first, as in standard mathematical notation

15

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

About PCI Directives

Directives are the key components of a PCI macro and control all aspects of program flow, command
execution, and variable assignment and manipulation. Each directive is identified by a ‘%’ prefix. All PCI
directive names are case insensitive.

16

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

About PCI Variables

Variables may be used in almost any PCI directive. When a PCI is executed, EdgeCAM substitutes the
variable for its currently defined value prior to execution of that directive, allowing true parametric
programming.

Variable names can be up to 28 characters long and are case insensitive.

Variables are assigned values in a PCI macro using either the %CALC, %ASK, %ASKBOX, %OPTION or
%ASKDIG directives.

During a command save, users may define their own variables. These variables can then be used within
command dialogs and digitised input.

If the variable name is surrounded by square brackets within a PCI file or EdgeCAM command, the
application uses the value associated to that variable.

When a variable name is entered in a parameter field on a command dialog, you can view its value by
selecting the name and then simultaneously pressing the Ctrl and ‘=’ keys on the keyboard. Release the
keys to switch back to the variable name.


Example

If you have defined the variable 'RADIUS', you could enter it into one of the parameter fields when
creating an arc.

1.

Pressing the Ctrl and '=' keys displays the current value for the variable:

2.

See Also

PCI Variable Types

17

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

PCI Variable Types

There are a number of different variable types available, named according to the following conventions:

String

String variables contain alphanumeric text and must be preceded by an ‘$’ to
identify them. Typically these would be used for text creation, filenames or user
identification in an EdgeCAM command. String variables may be up to 80
characters in length.

Digitised

These are preceded by an ‘@’ and refer to a digitised position. These positions
are 3D and therefore have an X, Y and Z component. The X, Y and Z
components of the digitised variable @ORIGIN can be referred to as
X@ORIGIN, Y@ORIGIN and Z@ORIGIN respectively.

Numeric

These have no prefix and can contain any floating point or integer value.

System

These are set up by EdgeCAM and are prefixed by ‘&’. A typical example
would be &NEXTENT, which defines the next available entity number in the
database. A full definition of all system variables is included in the reference
section of this specification.

Read only

These are preceded by a ‘#’ character and can only be written-to once. They
always have a numeric value. All subsequent writes using different values
generate an error.

These are typically used to add clarity to a macro and are used to identify so
called ‘magic numbers’. For instance, the number that indicates a user has
selected a free digitise position is defined as #FREEDIG. This and a number of
other read only variables are created by the system when initialising a
command save or executing a PCI macro.

18

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Compatibility Problems with PCIs

It is possible that software changes can lead to compatibility problems when using PCIs written for earlier
versions of the software.

In response to requests from the user base we have introduced a PCI variable that allows you to use PCIs
that were written before the Trim (Edit menu) command was altered.

If the user PCI variable "TrimEmulationMode" is set to a numeric value then the behaviour is as follows:

Numeric value

Behaviour

0

Same as if variable not set, normal behaviour of command. The
break option will always keep the start of the broken entity as
the original entity number.

1

Normal behaviour of the trim command except for the break
option which will try to keep as the original entity the broken
section nearest the second intersection point (or the first
digitised point if only one intersection). Note this is close but not
exactly the same as the old command's behaviour.

2

Use the command as shipped prior to EdgeCAM version 5.50.0
which is limited to the current CPL and lines/arcs.

19

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

PCI Comments

Comments are lines prefixed by an ‘*’, that are not processed when the PCI is run, and are typically used to
document various parts of a PCI program.

Full inline comments can be automatically generated or user specific comments specified at any time during
the command save process.

Comments can also be added by manually editing the resultant PCI macro file.

20

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Using Commands

This sample of ptams.cmd, the command file that describes the menu structure of EdgeCAM’s Design
mode, is shown here to illustrate the meaning of various terms, including ‘verb’, ‘noun’, and ‘modifier’:

*VERB SWITCH package helpnum dongle

* NOUN SWITCH package helpnum dongle

* Modifier switch type menu options exclusive control help prot

*

*

*

******************* Executive function ***************************

*

* curves

*

******************************************************************

#Curves 4 0 0 315 47

Alter 1 0 0 316 47

Bezier^Bèzier 63 0 0 317 47

Tolerance 56 5 0 0 0 0 0 318 47

Colour 1 10240 0 0 0 0 0 341 47

Layer 3 2 0 0 0 0 0 342 47

Style 2 10240 0 0 27 0 0 343 47

Name 242 8352 0 0 0 0 0 1322 47

Each EdgeCAM command may have modifier and digitised information associated with it and PCI directives
are available to set up both sets of information prior to command execution. Two PCI directives are required
to execute an EdgeCAM command: one to initialise it and a second to execute it following the setting up of
modifier and digitised information.

21

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Using Modifiers

Each EdgeCAM command can have a number of modifiers each with its own identifying number between 1
and 255.

When a modifier value is set, its modifier number and its requested value must be specified. Many
EdgeCAM modifiers offer a drop down list for selection, but the selected option always translates to a
numeric value inside EdgeCAM.

Because of this, PCI needs that number when setting the value for a drop-down list type modifier. One
example is colour, where Blue is referenced as Blue|2 in the command save file. The associated number
relates to the colour’s position on the drop down list, so Green=1, Blue=2, Cyan=3 and so on, from 1 to 32.

In a similar way, the line style font number is based on its position on the list, except that the list goes from 0
to 3, so Solid=0, Dotted=1, Dashed=2, and Chained=3. Note that the text before the ‘|’ is unnecessary.

If the command save facility is used to generate the PCI macro, this information is generated automatically.
The %TOOLBARMODS directive can also be used to access the current toolbar settings for colour, style
and layer information.

22

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

About the Database, Entity Numbers and Names

EdgeCAM supports a number of different entity types as detailed in the reference section of this document.
The EdgeCAM database is the data structure that contains all this information.

Each entity is given a unique number when created and PCI may reference each entity by this number.

However, this number may change in subsequent worksession, depending on which defaults file has been
loaded and which entities have been deleted. This makes writing PCI macros that reference existing
database entities quite difficult. PCI system variables do give access to the number of entities in an empty
part and the total number of entities present in the database at any one time (&BASEENT and &NEXTENT).

To simplify this problem, EdgeCAM also allows entities to be accessed by an entity name, for example by
using the %ADDENTNAMEDIG directive. The entity name is always unique and does not change. Entity
names of up to eight characters are supported. If the name has already been used in the database,
EdgeCAM generates a unique name by appending ‘.n’ (where n is a number between 1 and 999) to the
specified name.

Most entity types can be digitised at either end. A direction flag indicates which end of the entity has been
digitised. With a line entity, the direction flag will be zero if the start of the line is digitised, or 1 if the end of
the line is digitised.

When creating PCI macros to refer to existing geometry, we recommend that you name the geometric
entities.


About Handles

A ‘Handle’ is the name of a memory storage area. This area is where all digitised information for the PCI is
placed, including any geometric or toolpath entities created when the PCI is executed.

The default name given to this handle in the PCI commands is ‘gdh1’. You can edit this to any desired
name.

23

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

How to Execute Commands

During a command sequence save, the following process is typical for each command executed:

Initialise the command using the %INITCOMMAND directive.

1.

Clear all modifier fields for the Create command using %CLEARMODS.

2.

Set the modifier defaults as using %SETMODIFIER directives.

3.

Optionally Display the modifier dialog for the command, and allow the user to alter the default
modifiers values using the %ASKMODS directive.

4.

Initialise the digitise buffer to store digitises made by the user using %INITDIGINFO.

5.

Add the digitised information to the buffer set up by %INITDIGINFO using a series of
%ADDFREEDIG, %ADDENTNODIG, %ADDENTNAMEDIG, %ADDFINISHDIG or %ADDDIGINFO
directives.

6.

Execute the command with the handle (the name of a memory storage area) set up by
%INITCOMMAND and the digitise information set up by %INITDIGINFO using %EXECCOMMAND.

7.

Free up the digitise handle set up by %INITDIGINFO, ready for the next command using
%FREEDIGINFO.

8.

24

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

About PCI Text Files

The PCI text file is an ASCII format file that can be edited in any text editor.

A text file can be written ‘from scratch’ or a template created automatically from a command save. In
practice a combination of methods is used.

PCI file names have the extension .PCI and maybe up to 256 characters in length. Text files are subject to
any limitations imposed by the operating system.

25

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Writing Programs

A command sequence save usually provides the best template for a PCI, because it supplies all of the
relevant information to recreate the geometry and other information.

User variables can be added during a command save or added later along with flow control directives where
appropriate to add parametric capability.

26

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Editing Programs

PCI files can be constructed in many ways, for example, by cutting and pasting existing PCIs into a single
file, or by adding flow control and interactive calls to a command sequence save.

Comments can be used to mark a specific area of a file, or typically to indicate when another PCI has been
called from within the command save.

27

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Debugging Programs

EdgeCAM contains a useful feature, the %DEBUG directive, that allows you to step through the PCI file and
view the contents (including the name and value of variables).

The %DEBUG directive toggles debugging on or off. You can direct the output to screen or disk.

28

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Calling a PDI from a PCI

PDI programs that have been integrated into the command structure (that is, called from menubar.dfn) are
written to the PCI file in the same way as commands from the .cmd files. Use Command Save to capture the
command format.

Category-run PDIs can also be saved to the file and are activated on re-execution of the PCI.

29

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Calling a PCI from a PCI

One PCI can call another PCI using the %INCLUDE directive.

This allows ‘nesting’ of PCIs, and makes ‘master’ PCIs (the PCIs using the %INCLUDE directive) more
manageable and smaller in size.

If a second PCI is executed during a command save, you can see this as a single %INCLUDE in the
resultant PCI file.

30

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Using PCI Commands

All PCI operations are called from the Custom option of the Menu bar within the Design and Manufacture
modes.

See Also

Switching On a 'Command Save'
Switching Off a 'Command Save'
Aborting a 'Command Save'
Running a Command File
Defining Variables
Defining a Dialog Box
Viewing the Contents of Variables
Using Arrays in PCIs

31

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Aborting a 'Command Save'

A command sequence save can be aborted at any time by selecting the Abort Command Save (Custom
menu)
option.

32

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Adding Comments to a 'Command Save'

The Add Comments (Custom menu) command enables you to add unique comments “on the fly” during a
command sequence save. A single line comment of up to a limit of 256 characters can be saved.

33

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Running a Command File

A PCI file is executed by selecting Run Command File (Custom menu).


The command displays this dialog box:


Press the Browse... button to display the standard File Open dialog, and select a PCI file to execute. Click
OK to run the selected PCI.

You can abort a PCI at any time by pressing the Abort button

or the F8 key.

34

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Defining Variables

The definition of new or existing variables can be accessed by right clicking in the PCI Variables window and
selecting New from the shortcut menu.

This will open the Define Variable dialog box:

String Value – The string to be assigned to the variable (if the variable name indicates a string variable –
that is, the variable name is preceded by ‘$’)

Numeric Value – The numeric value to be assigned to the variable (if the variable name indicates a numeric
variable). The user may also select the <digitise> option in which case a digitise type variable is created.

Prompt string – The optional prompt string to be displayed by the PCI macro when replayed to prompt for
user input. If a prompt string is specified, the PCI macro contains a %ASK directive which prompts for input
of a new value for the specified variable each time the macro is executed. If no prompt string is defined, the
macro contains a %CALC directive and the input value is used for all subsequent executions of the macro.

Variable Name – The variable name to be assigned. A new name can be entered or an existing one can be
selected from the drop down list, and its value and/or prompt changed if required.

35

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Defining a Dialog Box

The Define Askbox (Custom menu) command allows you to define an input panel or dialog box during
command save which prompts for user input on subsequent executions of the PCI macro.

The command displays this dialog box:

Complete – Check this box to confirm that the Askbox definition is complete. Until this box is checked, the
above dialog is repeatedly displayed after each click of the OK button to allow definition of multiple Askbox
entries.

Prompt String – The prompt string for the variable displayed in the resultant Askbox dialog.

Variable Name – The name of the variable to be assigned when using this Askbox. String and numeric
variable are supported by the Define Askbox command. Digitise type variables must be defined using the
Define Variable command. To open the Define Variable dialog, right click in the PCI Variables Window and
select New from the shortcut menu.

36

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Viewing the Contents of Variables

By default the Sequence Window window displays the machining sequences and each set of machining
instructions. The PCI Variables Window shows all EdgeCAM variables and their values. To update the view,
right click to display the Refresh option, then left click to refresh the window data.

The wndow works on a tree-view principle,
so clicking on a plus sign expands the view
to display all variables within that category,
while clicking on a minus sign collapses that
part of the structure.

Once a category has been expanded, the variables and their values are displayed:

37

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Using Arrays in PCIs

Arrays can be used within PCIs by specifying one or more indices in a variable name. Variables are
evaluated as indices enclosed in square brackets [ ].

Key features of PCI array variables:

Can be used in place of an ordinary PCI variable

Multi-dimensional arrays are possible

Storage is only allocated for array elements used

No restriction on array indices (can be negative or even non-numeric)

See Also

About Arrays

Example of a One Dimensional Array

Mixing String and Numeric Variables

Evaluating Variables in an Array

Example of a Two Dimensional Array

38

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

About Arrays

Within computing, an array of data can be thought of as the equivalent of a table of numbers (or text
strings). A single dimension array is like a row of items across a page:

Mon

Tue

Wed

Thu

Fri

Sat

Sun

A two dimension array represents a table of rows and columns:

Week

1

2

3

4

5

Monday

1

8

15

22

29

Tuesday

2

9

16

23

30

Wednesday

3

10

17

24

1

Sometimes groups of data are more easily stored as arrays, since the data can be referenced using index
numbers representing the “row” and “column” position of the data.

You can use this method to store data within PCIs by allowing the use of one or more indices in a variable
name. Variables as indices, enclosed in [ ], will be evaluated.


For example, in a one dimensional array,

myarray(1)


indicates element “1” in “myarray”


In a two dimensional array,

calendar(3,5)

indicates the element in “row” 3, “column” 5 of table “calendar”.

You can place data in an array by structuring the variable name. For example,

%CALC=stock(1,5)=30

places value 30 in variable stock(1,5), and

%MessageBox=Value is [stock(1,5)]

makes use of that same data.

See Also

Example of a One Dimensional Array
Mixing String and Numeric Variables
Evaluating Variables in an Array

39

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Example of a Two Dimensional Array

40

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Example of a One Dimensional Array

The following example initialises a one dimensional array with the values 1 through 10, displays the
contents, reverses the array and shows the reversed contents of the array.

Running the PCI displays this box:

Click OK to display this box:

* Initialise TestArray() with 1 2 3 4 5 6 7 8 9 10

%CALC=Index=0

%LABEL=Initialise

%CALC=Index=[Index]+1

%CALC=TestArray([Index])=[Index]

%IF [Index] < 10 %GOTO=Initialise

%CALC=$Title=Initialised

%GOSUB=DisplayArray

* Now Reverse the array

%CALC=Forward=1

%CALC=Reverse=10

%LABEL=RevLoop

* Swap array elements

%CALC=Temp=[TestArray([Reverse])]

%CALC=TestArray([Reverse])=[TestArray([Forward])]

%CALC=TestArray([Forward])=[Temp]

* Loop for half the array

%CALC=Forward=[Forward]+1

%CALC=Reverse=[Reverse]-1

%IF [Reverse] > 5 %GOTO=RevLoop

%CALC=$Title=Reversed

%GOSUB=DisplayArray

%END

* Display contents of array

41

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%LABEL=DisplayArray

%CALC=$ArrayContent=

%CALC=ArrayIndex=0

%LABEL=DispArrayLoop

%CALC=ArrayIndex=[ArrayIndex]+1

%CALC=$ArrayContent=[$ArrayContent] [TestArray([ArrayIndex])]

%IF [ArrayIndex] < 10 %GOTO=DispArrayLoop

%MessageBox=[$Title] TestArray(1 - 10) [$ArrayContent]

%RETURN

42

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Mixing String and Numeric Variables

The array mechanism works by text substitution in the variable name. You can mix string and numeric
variables as array indices. Array variable contents can be numeric or string as dictated by the name (use
leading $ for strings). Expressions may not be used in indices.

* This is legal
%CALC=array([$name],[number])=6

* This is illegal
%CALC=array([number]+2)=6

43

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Evaluating Variables in an Array

Variable evaluation works from the innermost [ ] outwards. In the following example demonstrates the
evaluation of variables.

%CALC=$array(3,9)=HARRY
%CALC=number=9
%CALC=$string=ber
%MessageBox=[$array(3,[num[$string]])]

Evaluation steps for the %MessageBox line are:

%MessageBox=[$array(3,[num[$string]])]

1.

%MessageBox=[$array(3,[number])]

2.

%MessageBox=[$array(3,9)]

3.

%MessageBox=HARRY

4.

44

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Example of a Two Dimensional Array

The following example creates a turned profile using a two dimensional array to store the profile vertices
with the second index being non-numeric.

When run, the PCI should draw this:

* Initialise array Points() with profile vertices (Z,X)

%CALC=Points(1,Z)=0.0

%CALC=Points(1,X)=0.0

%CALC=Points(2,Z)=0.0

%CALC=Points(2,X)=20.0

%CALC=Points(3,Z)=-20.0

%CALC=Points(3,X)=20.0

%CALC=Points(4,Z)=-20.0

%CALC=Points(4,X)=60.0

%CALC=Points(5,Z)=-30.0

%CALC=Points(5,X)=60.0

%CALC=Points(6,Z)=-30.0

%CALC=Points(6,X)=40.0

%CALC=Points(7,Z)=-40.0

%CALC=Points(7,X)=40.0

%CALC=Points(8,Z)=-40.0

%CALC=Points(8,X)=60.0

%CALC=Points(9,Z)=-50.0

%CALC=Points(9,X)=60.0

* Initialise digitise buffer for Create Line command

%InitDigInfo=gdhPoints

%CALC=Index=0

%LABEL=InitialisePoints

%CALC=Index=[Index]+1

%AddFreeDig=[gdhPoints],Z[Points([Index],Z)]X[Points([Index],X)]

%IF [Index] < 9 %GOTO=InitialisePoints

%AddFinishDig=[gdhPoints],[#FINISH]

* Switch into turning

45

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%InitCommand=cmd1=16,31

%SetModifier=[cmd1],100,ZX|2

%ExecCommand=cmdret=[cmd1],-1

* Create profile

%InitCommand=cmd1=2,1

%ClearMods=[cmd1]

%SetModifier=[cmd1],155,<Yes>

%ExecCommand=cmdret=[cmd1],[gdhPoints]

%FreeDigInfo=[gdhPoints]

%End

46

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Building an Operation

These directives allow a PCI to build an EdgeCAM dialog using a combination of modifiers from previously
initialised commands and user defined variables. This means that you can specify all information required
for a single operation within a single dialog. This dialog will optionally have a number of tabs allowing more
complex operations to present information clearly (the ‘button’ method for addressing other pages on an
EdgeCAM dialog is not available for PCI operations).

To build a PCI operation

Step 1 - Initialise the Operation
Step 2 - Initialise the EdgeCAM Commands to be used in the Operation
Step 3 - Clear All Previous Modifier Values
Step 4 - Set Any Default Modifier Values
Step 5 - Build a Dialog for User Input
Step 6 - Add Any User Defined Modifiers to the Dialog
Step 7 - Set Up Mutual Inclusion Relationships Between Modifiers
Step 8 - Prompt for Selection of PCI Operation Modifiers
Step 9 - Select Entities Used in the Operation
Step 10 - Execute Each EdgeCAM Command
Step 11 - Free the PCI Operation reference

47

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Step 1 - Initialise the Operation

The PCI first initialises a new EdgeCAM operation using %INITOPERATION. A variable name is defined
and this is used as reference to the operation in subsequent steps. A name for this operation is also given.

In the PCI this appears as:

%INITOPERATION=OperationId=Rough Face Mill,EdgeOp.hlp,10021


OperationId is the PCI variable used to identify the operation.

“Rough Face Mill” is the textual name of the operation. This string is also used as the title of the operation
dialog when displayed to the user and for the name of the operation displayed in the EdgeCAM operations
list.

EdgeOp.hlp is the name of the help file to be used to display context sensitive help. This will be located in
the language directory in the normal way.

10021 is the help context ID for this command.

The help file name and the context ID are optional parameters.

48

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Step 2 - Initialise the Commands to be used in the Operation

The Rough Face Mill operation is made up of a number of steps. Here is a typical sequence for the ‘Rough
Face Mill’:

Select Tool.

1.

Positioning Move prior to Facemill Cycle.

2.

EdgeCAM Facemill Cycle.

3.

Rapid tool to Home Position.

4.

Each step corresponds to an EdgeCAM machining command. The PCI initialises each EdgeCAM command
to be used.

%InitCommand=cmdMillTool=36,108
%InitCommand=cmdRapidMove=101,1
%InitCommand=cmdFaceMill=102,4
%InitCommand=cmdHome=101,40


An additional parameter will be added to the %InitCommand directive to disable the validation of a command
based on the currently selected tool.

49

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Step 3 - Clear All Previous Modifier Values

Since the commands are initialised out of context, the modifiers for the commands are not set up in the
normal way. Modal values are not loaded, and neither are lists that are initialised dynamically by the
command. To aid clarity in the PCI, all modifiers for all commands used in an operation will be cleared using
%CLEARMODS:

%CLEARMODS=[cmdMillTool]
%CLEARMODS=[cmdRapidMove]
%CLEARMODS=[cmdFaceMill]
%CLEARMODS=[cmdHome]

50

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Step 4 - Set Any Default Modifier Values

Any hard-coded modifier values are now set. These are modifiers the user does not need to alter on an
operation by operation basis. Alternatively a PCI variable may have been defined previously which contains
the value to be used for a particular modifier.

In this operation the tool type is always considered to be an Endmill. The Clearance plane has been
previously defined by user variable ZCLEAR.

The PCI sets up default values using %SETMODIFIER, as shown below.

%SETMODIFIER=[cmdMillTool],100,EndMill|0
%SETMODIFIER=[cmdFaceMill],28,[ZCLEAR]


A number identifies each modifier. Tooltype is modifier 100, Z Clear is modifier 28. Full details of all
modifiers are defined in edgekrnl.txt.

51

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Step 5 - Build a Dialog for User Input

Each time the operation is executed, the user will be prompted to supply values for Tool Diameter, Tool
Position, Spindle Speed and Feedrate.

The PCI creates a dialog containing these modifiers using %ADDCMDMODTOOPERATION. Feed and
Speed are placed on a separate tab, labelled ‘Cutting Data’. The tooling parameters are placed on the
primary page. By default this is labelled ‘General’. Also, the separator can be specified by appending
^Separator_name to the tab name.

%ADDCMDMODTOOPERATION=[OperationID],[cmdMillTool],47

%ADDCMDMODTOOPERATION=[OperationID],[cmdMillTool],116

%ADDCMDMODTOOPERATION=[OperationID],[cmdMillTool],48

%ADDCMDMODTOOPERATION=[OperationID],[cmdFaceMill],5,

Cutting Data^Feedrates

%ADDCMDMODTOOPERATION=[OperationID],[cmdFaceMill],6,

Cutting Data^Feedrates

%ADDCMDMODTOOPERATION=[OperationID],[cmdFaceMill],7,

Cutting Data


Again, a number defines each modifier. 47 = Diameter, 116 = Units, 48 = Position, 5 = Planar Feed, 6 =
Plunge Feed and 7 = Spindle Speed.

An additional parameter allows you to specify mutual exclusivity of operation modifiers. This is a bit-oriented
value and is applied as follows:

%ADDCMDMODTOOPERATION=[OperationID],[cmdMillTool],48,,1

%ADDCMDMODTOOPERATION=[OperationID],[cmdFaceMill],5,

Cutting Data,1


Each modifier with the same bit field set is considered to be mutually exclusive. You can set up mutual
exclusivity between several modifiers by assigning multiple fields of the bit-oriented value.

In the above example, modifier 48 is mutually exclusive with modifier 5. If one of the modifiers contains a
value, the other modifier is greyed out and unavailable.

EdgeCAM commands have their own mechanism for defining mutual exclusivity. If the optional exclusivity
field is used in any EdgeCAM operation, the normal EdgeCAM mechanism is disabled.

The usual application of this exclusivity field would be to have a user defined modifier control the availability
of a command modifier.

52

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Step 6 - Add Any User Defined Modifiers to the Dialog

In some cases it is advantageous to add some additional user defined modifiers to the dialog. These may be
used to control ancillary functions such as the tailstock, which may need to be moved during the operation.
The %ADDUSERMODTOOPERATION PCI directive is used:

%ADDUSERMODTOOPERATION=[OperationID],_checkTailstock,

Use Tailstock,Misc^Machine


In this case the user modifier will prompt for ‘Use Tailstock’ on the ‘Misc.’ tab of the dialog and set up the
PCI Variable _checkTailstock. As the variable name is prefixed with ‘_check’ a check box will be displayed
and the value of ‘_checkTailstock’ will be set as 0 or 1 depending on if the box has been checked.

The prefix of the user modifier name controls the modifier type. In the above example, ‘_check’ is used to
specify a check box type modifier.

Click here to see a full list of modifier types.

53

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Step 7 - Set Up Mutual Inclusion Relationships Between Modifiers

The %ADDVALIDSTATE directive gives the user modifiers the ability to control the availability of other
modifiers, based on the current state of the user modifier.

In the case of a hole operation, different finishing strategies are offered (such as Tap and Bore) with a user
modifier being used for ‘Strategy’. In the case where Bore is selected as a strategy, the Pitch modifier for
Tap should be greyed out, and is only enabled if the strategy is changed to Tap.

Two flavours of the directive are required: one to set the valid states for command modifiers, and one for a
user modifier.

%ADDVALIDSTATE=[OperationID],UserVariable,Value,
[CommandId],[ModifierId],[State]

%ADDVALIDSTATE=[OperationID],UserVariable,Value,
UserVariable,[State]


For example:

%ADDVALIDSTATE=[HoleOp],_listStrategy,1,[DrillCmd],
[PitchMod],1


This would set up a relationship between the strategy user modifier and the Pitch command modifier, such
that the Pitch is only valid if Strategy has a value of 1.

%ADDVALIDSTATE=[HoleOp],_listStrategy,0,_realDepth,0


This would set up a relationship between the Strategy user modifier and the Depth user modifier, such that
the Depth is invalid if Strategy has a value of 0.

54

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Step 8 - Prompt for Selection of PCI Operation Modifiers

The user is then prompted to enter values for the modifiers. A standard Windows dialog is presented using
the %DOOPERATIONMODS directive, containing the modifiers as specified by the
%ADDCMDMODTOOPERATION directives.

%DOOPERATIONMODS=cmdRet=[OperationId]


If the user completes the dialog and selects ‘OK’, cmdRet is assigned the value #FINISH. If the user selects
‘Cancel’ #ESCAPE is assigned.

A standard EdgeCAM dialog is displayed, containing each modifier as specified by the
%ADDCMDMODTOOPERATION and %ADDUSERMODTOOPERATION directives.

55

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Step 9 - Select Entities Used in the Operation

Optionally, the PCI may prompt the user to select all entities that are to be used by this operation. This
would be done using the %ASKDIG and %ASKDIGINFO directives to select entities and positional
information, with the %ADDDIGINFO, %ADDENTNAMEDIG, %ADDENTNODIG, %ADDFINISHDIG
directives to build up a suitable buffer of digitised information to use with the %EXECCOMMAND directive.

Alternatively, the PCI may leave this stage to the application itself, by passing an empty buffer (-1) to the
%EXECCOMMAND call.

56

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Step 10 - Execute Each Command

Each EdgeCAM command is then executed in turn using the %EXECCOMMAND directive, with appropriate
modifier and digitised data, to create the toolpaths in the database.

%EXECCOMMAND=cmdRet=[cmdMillTool],-1

%EXECCOMMAND=cmdRet=[cmdRapidMove],-1

%EXECCOMMAND=cmdRet=[cmdFaceMill],-1

57

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Step 11 - Free the PCI Operation reference

Free up memory used by the PCI operation with the %FREEOPERATION directive.

%FREEOPERATION=OperationId

58

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDALLVISDIGINFO

Description

Adds all visible entities to a previously initialised digitised information buffer. The valid entity type is
controlled by a string which states which of the 255 EdgeCAM entity types are allowed to be digitises. For
example -255 states that all entity types are valid whereas the string 1;2;4 indicates only Lines, Arcs and
Points are valid. For a full list of entity types, see EdgeCAM Entity Types.


Format

%AddAllVisDigInfo=NumDig=handle,visible

Example

%AddAllVisDigInfo=NumDig=gdh1,1 (Select all visible line entities)

%AddAllVisDigInfo=NumDig=gdh1,1;2 (Select all visible line and arc entities)

%AddAllVisDigInfo=NumDig=gdh1,0-255 (Select all visible entities)

59

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDCALLBACKREF


Description:

Will take a value specified in the ToolStore and place its value in the modifier.


Example:

%AddCallBackReference=[OpId],tsFinish,[#IndexMillDepth],_realProfileDepth


This command is intended for use with ToolStore toolchanges and will usually be used together with
%SETCALLBACK. Click here to see an example.

60

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDCMDMODTOOPERATION

Description:

Each time a machining Operation is executed, the user will be prompted to supply values for Tool Diameter,
Tool Position, Spindle Speed and Feedrate. The PCI creates a dialog containing these modifiers and allows
other modifiers to be added.

Feed and Speed are placed on a separate tab, labelled ‘Cutting Data’. The tooling parameters are placed on
the primary page. By default this is labelled ‘General’. Also, the separator can be specified by appending
^Separator_name to the tab name.

An additional parameter is available to specify the mutual exclusivity of operation modifiers.


Format:

%AddCmdModToOperation=[OperationID],[cmdname],modifier

%AddCmdModToOperation=[OperationID],[cmdname],modifier,tab_name^separator_name

%AddCmdModToOperation=[OperationID],[cmdname],modifier,tab_name^separator_name,exclusivity


Example:

%AddCmdModToOperation=[OperationID],[cmdMillTool],47

%AddCmdModToOperation=[OperationID],[cmdMillTool],116

%AddCmdModToOperation=[OperationID],[cmdMillTool],48

%AddCmdModToOperation=[OperationID],[cmdFaceMill],5,Cutting Data^Feedrates

%AddCmdModToOperation=[OperationID],[cmdFaceMill],6,Cutting Data^Feedrates

%AddCmdModToOperation=[OperationID],[cmdFaceMill],7,Cutting Data

Again, each modifier is defined by its number. 47 is Diameter, 116 is Units, 48 is Position, 5 is Planar Feed,
6 is Plunge Feed and 7 refers to Spindle Speed.

The mutual exclusivity parameter is a bit-oriented value and is applied as follows:

%AddCmdModToOperation=[OperationID],[cmdMillTool],48,,1

%AddCmdModToOperation=[OperationID],[cmdFaceMill],5,Cutting Data,1

Each modifier with the same bit field set is considered to be mutually exclusive. Mutual exclusivity between
several modifiers can be set up by assigning multiple fields of the bit-oriented value.

In the example above, modifier 48 is deemed to be mutually exclusive with modifier 5. If one of the modifiers
contains a value the other modifier is greyed out and unavailable.

EdgeCAM commands have their own mechanism for defining mutual exclusivity. If the optional exclusivity
field is used in any EdgeCAM operation, the normal EdgeCAM mechanism is disabled.

The usual application of this exclusivity field would be to have a user defined modifier control the availability
of a command modifier.

61

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDDIGINFO (Advanced feature)

Description:

Add digitise information to a digitise buffer during a command sequence save. This directive is followed by a
number of records that define all information required for this digitise.

Directives %ADDFREEDIG, %ADDENTNODIG, %ADDENTNAMEDIG and %ADDFINISH offer a simplified
subset of this functionality and are more suitable in most instances.


Format:

%ADDDIGINFO=handle,number of records, digitise type

handle:

Reference to storage area for digitised information

number of records

Number of records that follow.

Digitise type:

Type of digitise:

Free digitise (#FREEDIG)

Entity digitise (#ENTITYDIG)


Note that the command may span multiple lines with comment lines, but blank lines are not permitted.

A number of record types can be used to complete the definition of the digitise and these are detailed below.
The first number always refers to the record type. The information following is dependent on record type.
The number of records following the directive is dependent on the type of digitise being asked for. Read only
variables are defined for each record type and PCI command save shows references to these read only
variables rather than the record numbers itself.

The attribute value used in some record type specifies if the 3D snap was selected on or off (0 or 1). For
Entity Digitises it also indicates if the entity was selected using the CHAIN submodifier and becomes a
bitwise value (bit 2 is set if the CHAIN submodifier was selected on).


#DIG_ENTNO_DIG, Entity number, attributes, direction

#DIG_ENTNAME_DIG,Entity name,attributes,direction

#DIG_COORDSTR,3D Snap ,Coord input string

#DIG_LOCATION, 3D Snap, X location, Ylocation, Zlocation

#DIG_WORLD, X location, Ylocation , Zlocation

#DIG_VIEW, X location, Ylocation

#DIG_SCREEN: X location, Ylocation

#DIG_UVSURF: U parameter, V parameter

#DIG_PORTNUMBER, port number

#DIG_ELEMENT, element number, element direction

#DIG_CONSTRUCT_REF, digitise type, number of component digitises

#DIG_COMPONENT_INFO, Attributes, type, number of records in component digitise

Extensive use is made of read only variables to improve clarity. For details see PCI Read-Only Variables.

62

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDENTNAMEDIG

Description:

Adds an entity name digitise to a previously initialised digitise information buffer. This directive requires the
following information about the entity, its entity name, 2D snap status (0=2D, 1=3D), and direction
(0=forward and 1=reverse)


Format:

%ADDENTNAMEDIG=handle,entity name,2D snap status,direction.


Example:

%ADDENTNAMEDIG=[gdh1],fred,0,0

This directive adds an entity digitise on the entity named ‘fred’ to the digitise buffer referenced by the handle
[gdh1]. with 2D snap on, and in the forward direction i.e. from the start of the entity

63

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDENTNODIG

Description:

Adds an entity number digitise to a previously initialised digitise information buffer. This directive requires
the following information about the entity, its entity number, 2D snap status (0=2D, 1=3D), and direction
(0=forward and 1=reverse)


Format:

%ADDENTNODIG=handle,entity number,3D snap status,direction


Example:

%ADDENTNODIG=[gdh1],[&BASEENT] + 20,0,0

64

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDFINISHDIG

Description:

Adds a FINISH, REDO or ABORT to a previously initialised digitise information buffer. These values are
defined by [#FINISH], [#REDO] and [#ABORT] respectively. Any sequence of digitised values requires this
to terminate the command. If an %ADDFINISHDIG is not added, EdgeCAM reverts to interactive input when
all digitised information has been processed.


Format:

%ADDFINISHDIG=handle,value


Example:

%ADDFINISHDIG=[gdh1],[#FINISH]

This example will add a FINISH to the buffer referenced by the variable [gdh1].

65

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDFREEDIG

Description:

Adds a free digitise position to a previously initialised digitised information buffer. The co-ordinate string is
as would be typed in to the Co-ordinate input dialog and may include incremental and polar values as well
as absolute X, Y and Z axis values.


Format:

%ADDFREEDIG=handle,co-ordinate string


Example:

%ADDFREEDIG=[gdh1],X[X@POSITION]Y[Y@POSITION]

This example would add a free digitise at the X,Y location referenced by the variable [POSITION] to the
buffer referenced by the variable [gdh1].

66

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDMESSAGESTRING

Description:

This PCI directive adds a string on a new line after all the lines already stored in the message string using
%MESSAGEBOX.


Format:


%AddMessageString=MessageHandle=String to add

MessageHandle: Handle number returned by %INITMESSAGESTRING

String to add: Text to be added on its own line


Example:

Initialise message string, add three lines of text, display message string and free it.


%InitMessageString=strMessage
%AddMessageString=[strMessage]=First line of text
%AddMessageString=[strMessage]=Second line of text
%AddMessageString=[strMessage]=Third line of text
%MessageBox=nRet=[#MB_ICONWARNING],[strMessage]
%FreeMessageString=[strMessage]

See Also: %FreeMessageString, %InitMessageString, %MessageBox

67

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDUSERMODTOOPERATION

Description:

In some cases it is advantageous to add some additional user-defined modifiers to the dialog. These may be
used to control ancillary functions such as the tailstock which may need to be moved during the operation.
This is done using the %ADDUSERMODTOOPERATION directive.


Format:


%AddUserModToOperation=[OperationID],prefixvariable,prompt,tabname^name


Example:


%AddUserModToOperation=[OperationID],_checkTailstock,Use Tailstock,Misc^Machine

In this case, the user modifier will prompt for ‘Use Tailstock’ on the ‘Misc.’ tab of the dialog and set up the
PCI Variable _checkTailstock. As the variable name is prefixed with ‘_check’, a check box will be displayed
and the value of ‘_checkTailstock’ will be set as 1 if the box has been checked and 0 is the box is empty.

The prefix of the user modifier name controls the modifier type. In the above example, ‘_check’ is used to
specify a check box type modifier.

Click here to view a full list of types.

68

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDVALIDSTATE

Description:

Gives the user modifiers the ability to control the availability of other modifiers, based on the current state of
the user modifier.

In the case of a hole operation, different finishing strategies are offered, such as Tap and Bore, with a user
modifier being used for ‘Strategy’. In the case where ‘Bore’ is selected as the strategy, the Pitch modifier for
Tap should be greyed out, and is only enabled if the strategy is changed to ‘Tap’.

Two flavours of the directive are required, one to set the valid states for a command modifiers, and one for a
user modifier.


Format:


%ADDVALIDSTATE=[OperationID],UserVariable,Value,[CommandId],[ModifierId],[State]

%ADDVALIDSTATE=[OperationID],UserVariable,Value,UserVariable,[State]


Example:


%ADDVALIDSTATE=[HoleOp],_listStrategy,1,[DrillCmd],[PitchMod],1

This would set up a relationship between the strategy user modifier and the Pitch command modifier, such
that the Pitch is only valid if Strategy has a value of 1.


%ADDVALIDSTATE=[HoleOp],_listStrategy,0,_realDepth,0

This would set up a relationship between the Strategy user modifier and the Depth user modifier, such that
the Depth is invalid if Strategy has a value of 0.

69

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ALIAS=VAR1=VAR2


Description:

Gives you the ability to use the name var1 instead of var2.


Example:

%ALIAS=FEED=XYFEED

70

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ANG

Description:

The angle between two points, specified by the X and Y signed increments from the first to the second point.
The value of this angle is returned under a specified variable.

%ANG returns values in the range 0° to 360°.


Format:


%ANG=variable=[XINC],[YINC]


Example:


%ANG=ANGLE=[XINC],[YINC]

%ANG=ANG=10,10

Given two points, P1 at X0 Y0 and P2 at X10 Y10, the angle in the direction of P1 to P2 gives an X
increment of 10 and a Y increment of 10.

With these values %ANG would return an angle of 45°. The angle from P2 to P1 would give increments of

-

10° and an angle of 225°.

71

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ASK

Description:

This displays a prompt to ask the user to enter a value for a numeric or string variable. The prompt string
can comprise a maximum of 45 characters (you can use spaces).


Format:


%ASK=prompt=variable


Examples:


%ASK=Please enter billet length:=BLEN
%ASK=ARC RADIUS:=RAD
%ASK=ENTER TEXT STRING:=$STRING


When this first line is run, the prompt is displayed


Please enter billet length


If the variable has already been assigned a value, this is displayed as the default.

72

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ASKBOX

Description:

This command is similar to %ASK, but is used for multiple input. If any of the variables have been defined
before the %ASKBOX command, these values are used as the default values.


Format:


%ASKBOX=prompt1=variable1=prompt2=variable2...


Example:


%ASKBOX=BlockLength=LEN=BlockHeight=HGT

This displays a dialog prompting for values for the variables:

An Askbox can be generated during a Command save using the Define Askbox command.

%ASKBOX can also be used in a similar way to %OPTION, in that it can be made to display a list of options.
For example:


%ASKBOX=LIST^LIST1^LIST2^LIST3=LIST

results in this dialog:

You can be more explicit in the type of variable you want to assign. Prefix the variable name with one of
these strings:

_CHECK

Displays a Check Box in the dialog. The value returned to the variable is
CHECKED=1, UNCHECKED=0.

_INT

Displays an integer field with up and down arrow controls.

_REAL

Displays a standard numeric field.

_TEXT

Displays a single-line text field.

_MTEXT

Displays a multi-line edit box.

_LIST

Displays a list of selectable options.

Text strings for the _LIST type are listed in cam\examples\pci\ptmods.txt.

In the example below _LIST5 is specified, which will display the options listed
on line 5 of ptmods.txt. This example is \cam\examples\pci\askbox.pci

73

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

For example:

%ASKBOX=RealNumber=_REAL_VALUE=IntegerNumber=_INT_VALUE=List Box=_LIST5=Check
Box=_CHECK_BOX=TextEntry=$_TEXT_ENTRY=Multi-line Text Entry=$_MTEXT_ENTRY=Default Data
Type=DEFAULT

results in this dialog:

The Edit button displays this dialog:

Note that the %ASKBOX is written on one line and only appears as wrapped due to the limitations of this
document.

74

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ASKDIG


Description:

Displays a prompt for a digitise and saves the resulting co-ordinate information.


Format:


%ASKDIG=<PROMPT>=<VAR>

The prompt <PROMPT> is displayed asking the user to digitise a point or entity on the screen. The variable
<VAR> assumes the co-ordinates of the point snapped to.

%ASKDIG sets up system variables as follows:

&ENTNO

entity number

&ENAME

entity name

&ETYPE

entity type number

&XDIG

X cursor location

&YDIG

Y cursor location

&ZDIG

Z cursor location

&XSNAP

X snapped location

&YSNAP

Y snapped location

&ZSNAP

Z snapped location

&DIRFLAG

0=start of entity, 1=end of entity

&PORT

port in which digitise was made

&DIGSTAT

>=0 position given

-1 abort ([#ABORT] read only
variable)

-2 escape ([#ESCAPE] read only
variable)

-3 finish ([#fFINISH] read only
variable)

Notes:

The system variables only retain these values until the next %ASKDIG.

Because of the complexity of even simple 3D entities with associated matrices (and so on), no information is
available on a snapped entity except for the point that was snapped to. Snapped locations on the graphics
screen can be provided through entity and grid digitises.

Any prompt string can comprise a maximum of 45 characters.

75

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ASKDIGINFO (Advanced Feature)

Description:

This directive prompts the user for a series of digitises which are stored in the buffer previously initialised by
a previous call to the %INITDIGINFO directive. This buffer can then be used in conjunction with any
EdgeCAM command. This would be used in cases where the same entities or digitises were to be used with
multiple commands as the buffer can be set up once and re-used for each command that requires it.

Entity digitises, Free digitises or both are permitted and the read only variables [#FREEDIG] and
[#ENTITYDIG] should be used as required.

For entity digitises the valid entity type is controlled by a string which states which of the 255 EdgeCAM
entity types are allowed to be digitises. For example -255 states that all entity types are valid whereas the
string 1,2,4 indicates only Lines, Arcs and Points are valid. See the full list of EdgeCAM entity types.

Format:


%ASKDIGINFO=nret,numdig=prompt=handle,visible,digtype

nret

determines if the user has done a finish, escape or abort when
performing the getdata.

[#FINISH],[#ABORT] or [#ESCAPE]

numdig

number of digitises entered (including final finish, redo or abort)

prompt:

string to tell user what to digitise

handle:

handle number for digitise buffer (defaults to ‘gdh’)

visible:

list of selectable entity types.

digtype:

type of digitise allowed

[#FREEDIG] for free digitises

[#ENTITYDIG] for entity digitises

Example 1

%INITDIGINFO=point

%ASKDIGINFO=NUMDIG=Dig Hole Locations=[point],4;11,[#FREEDIG]+[#ENTITYDIG]

%ADDFINISHDIG=[point],[#FINISH]

This PCI directive would allow a series of free digitises and entity digitises to be added to the specified
digitised information handle called ‘point’. The entity digitises are restricted to point and group elements only
(‘4;11’).


Example 2

%AskDigInfo=nret,NumDig="Select points"1,[hDigBuffPoints],[#ENTITYDIG]+[#FREEDIG],4;11

The PCI author can now test the value of nret, it will be set to [#FINISH],[#ABORT] OR [#ESCAPE]

The example below tests against nret, if the user has pressed escape or abort the PCI will go to the bottom
and finish with no action :-

%if [nRet]<>[#Finish]

%FreeOperation=[OpId]

%FreeDigInfo=[hDigBuffPoints]

%GoSub=DeleteNonModalUserMods

76

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%Goto=Bottom

77

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ASKMODS

Description:

Once a command has been initialised, you can allow the user of the PCI to override the set parameters
using the %ASKMODS directive. The dialog for the command will be displayed and the user can change the
parameters before the PCI continues.


Example:


%INITCOMMAND=cmd1=2,1

%CLEARMODS=[cmd1]

%SETMODIFIER=[cmd1],155,1

%SETMODIFIER=[cmd1],1,Gold|21

%SETMODIFIER=[cmd1],3,44

%SETMODIFIER=[cmd1],2,Solid|0

The %ASKMODS directive will display the modifier dialog for the Line command and the above parameters
can be changed.

%ASKMODS=CMDRET=[cmd1]

%INITDIGINFO=gdh1

%ADDFREEDIG=[gdh1],X0Y0

%ADDFREEDIG=[gdh1],X50

%ADDFREEDIG=[gdh1],IY50

%ADDFREEDIG=[gdh1],IX-50

%ADDFREEDIG=[gdh1],IY-50

%ADDFINISHDIG=[gdh1],[#FINISH]

%EXECCOMMAND=cmdret=[cmd1],[gdh1]

%FREEDIGINFO=[gdh1]

78

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ASKPROFILE

Description:


This is the operation PCIs need to execute the machining cycles with a digitise buffer. All user input must be
contained within this buffer. You cannot use %AskDig and %AskDigInfo to emulate the profile selection
methods (arrows and stars etc.). %AskProfile calls through to the same EdgeCAM function
(mc_gen_profs()) as the cycles themselves. In this way, an exactly matching digitise buffer can be
constructed, and fed to the cycles later.


Format:


%AskProfile=NumDig=Prompt=Handle,ProfType,Side

NumDig returned as the number of digitises added to the buffer.

Prompt the text to display in the EdgeCAM prompt window.

Handle the previously initialised digitise buffer.

ProfType one of [#PROF_CLOSED] (like AreaClear or Lace) or [#PROF_OPEN] (like Profile or Slot)

Side either [#PROF_SIDE_DIGITISE], [#PROF_SIDE_CENTRE], [#PROF_SIDE_LEFT],
[#PROF_SIDE_RIGHT]. If side is passed as [#PROF_SIDE_DIGITISE], it will be returned as either
[#PROF_SIDE_LEFT] or [#PROF_SIDE_RIGHT] to indicate which side the user chose.


Example:


%AskProfile=NumDig=Digitise profile=[hgdSlot],[#PROF_OPEN],[#PROF_SIDE_CENTRE]

%AskProfile=NumDig=Digitise profile=[hgdLace],[#PROF_CLOSED],[#PROF_SIDE_DIGITISE]

79

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ASKSURFACES

Description:


This directive generates a digitise buffer which can be used with surface machining cycles (e.g. Parallel
Lace, Profiling etc). %AskSurfaces uses the same EdgeCAM code as the cycles themselves.


Format:


%AskSurfaces=ReturnCode=Prompt,Handle

%AskSurfaces=ReturnCode=Prompt,Handle,HandleSides

ReturnCode: Either [#FINISH] if successful, or [#ESCAPE]/[#ABORT] if the user cancels the operation
of invalid data is input.

Prompt: The prompt displayed in the status bar

Handle: Previously initialised digitise buffer to hold surfaces selected to machine and if HandleSides is
not supplied will also contain the offset selection digitises

HandleSides: Optional argument which if present causes all offset selection digitises into this buffer
leaving just the surface selection in the [Handle] buffer.


Example:


%InitDigInfo=gdh1

%AskSurfaces=nRetCode=Digitise surface for machining,[gdh1]

%MessageBox=Return code from AskSurfaces [nRetCode]

%FreeDigInfo=[gdh1]

80

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%CALC

Format:


%CALC=variable1=expression


Description:

This assigns the result of an expression to a variable. See also Creating More Read Only Variables.

This command supports all variable types. The variable that is being assigned is not surrounded by square
brackets [], but any variable used in the expression must have square brackets, as you are using the value
held by that variable. For example:


%CALC=variable1=[variable2]+[variable3]

For numerical calculations the operators are, in order of precedence:

-

Negation

*/

Multiplication, Division

+ -

Addition, Subtraction


You can use brackets (parentheses) to change the order in which operations are performed.

Strings can be concatenated as follows:

‘abc’ + ‘def’ = ‘abcdef’


The trigonometric functions SIN(#), COS(#), TAN(#), ASIN(#), ACOS(#) and ATAN(#) are all supported, with
their arguments specified in degrees.

SQR(#) gives the square root of a number.

ABS(#) returns the absolute value of a number.

POW(#,#) returns the power of the number.

INT(#) truncates the number to return its integer value.

LOG(#) gives the natural logarithmic function, loge x.

EXP(#) gives the exponential function, ex.


Examples:


%CALC=START_ANGLE=45

%CALC=XPOS=[XCENT]+([RADIUS]*COS([ANGLE]))

%CALC=$STRING=THIS IS A TEST

%CALC=$STRING2=[$STRING]

%CALC=ANS=[X@ORG]+[VAL]

Please note when using integer values in %CALC that a number followed by a decimal point - but without

a numerator - is illegal (see example below).

Example

81

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%CALC=VAR=5.0 + 2

is correct

%CALC=VAR=5 + 2

is correct

%CALC=VAR=5.+ 2

is illegal

82

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%CHAINENTNAME

Description:


This directive chains entities from the specified entity name. The entity numbers chained are stored as
separate entity digitises in the supplied digitise buffer.

Format:


%ChainEntName=EntsChained=DigBuff,StartEnt,Direction,3DSnap,Branch

%ChainEntName=EntsChained=DigBuff,StartEnt,Direction,3DSnap,Branch,EndEnt

EntsChained: The number of entity digitises added to DigBuff

DigBuff: Digitise buffer to accept digitises for entities chained

StartEnt: Starting entity name for chain

Direction: Direction for chain, either [#DIR_FORWARD] or [#DIR_REVERSE]

3DSnap: Perform chaining in 3D? Either [#TRUE] or [#FALSE]

Branch: Check for branches? Either [#TRUE] or [#FALSE]

EndEnt: Optionally stop at this entity name if part of the chain


Example:

Select named start and end entities for a chain and smooth the entities chained.


* Wait for user to select entity to start chain

%CALC=$Empty=

%Label=StartEntity

%AskDig=Select first NAMED ENTITY for chain=Digitise

%If [&EName] = [$Empty]

%MessageBox=nRet=[#MB_ICONERROR],"Must Digitise a NAMED entity"

%GOTO=StartEntity

%Endif

%CALC=$Start=[&EName]

%CALC=ChainDir=[&DirFlag]

%Label=EndEntity

%AskDig=Select NAMED ENTITY to terminate chain=Digitise

%If [&EName] = [$Empty]

%MessageBox=nRet=[#MB_ICONERROR],"Must Digitise a NAMED entity"

%GOTO=StartEntity

%Endif

* Chain entities storing in buffer

%InitDigInfo=gdh1

%ChainEntName=nEnts=[gdh1],[$Start],[ChainDir],[#TRUE],[#FALSE],[&EName]

83

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%MessageBox=[nEnts] selected by chain

%AddFinishDig=[gdh1],[#FINISH]

* Create a smoothed continuous through the entities chained

%InitCommand=cmd1=2,56

%SetModifier=[cmd1],56,0.01

%SetModifier=[cmd1],43,1

%ExecCommand=cmdret=[cmd1],[gdh1]

%FreeDigInfo=[gdh1]

See Also: %ChainEntNo

84

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%CHAINENTNO

Description:

This directive chains entities from the specified entity number. The entity numbers chained are stored as
separate entity digitises in the supplied digitise buffer.

Format:


%ChainEntno=EntsChained=DigBuff,StartEnt,Direction,3DSnap,Branch

%ChainEntno=EntsChained=DigBuff,StartEnt,Direction,3DSnap,Branch,EndEnt

EntsChained: The number of entity digitises added to DigBuff

DigBuff: Digitise buffer to accept digitises for entities chained

StartEnt: Starting entity number for chain.

Direction: Direction for chain, either [#DIR_FORWARD] or [#DIR_REVERSE]

3DSnap: Perform chaining in 3D? Either [#TRUE] or [#FALSE]

Branch: Check for branches? Either [#TRUE] or [#FALSE]

EndEnt: Optionally stop at this entity number if part of the chain


Example:

Chain entities, change their colour to Lime Green and verify the changes.


* Wait for user to select entity to start chain
%Label=EntityRequired
%AskDig=Select first ENTITY for chain=Digitise
%If [&Entno] <= 0
%MessageBox=nRet=[#MB_ICONERROR],"Must Digitise an entity"
%GOTO=EntityRequired
%Endif
* Chain entities storing in buffer
%InitDigInfo=gdh1
%ChainEntno=nEnts=[gdh1],[&Entno],[&DirFlag],[#TRUE],[#FALSE]
%MessageBox=[nEnts] selected by chain
%AddFinishDig=[gdh1],[#FINISH]
* Change colour of entities to Lime Green (14)
%InitCommand=cmd1=1,1
%SetModifier=[cmd1],1,14|14
%ExecCommand=cmdret=[cmd1],[gdh1]
* Verify entities chained
%InitCommand=cmdh=17,69
%ExecCommand=ret=[cmdh],[gdh1]
%FreeDigInfo=[gdh1]


See Also: %ChainEntName

85

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%CLEARMODS

Description:

Clear all EdgeCAM modifier values for previously initialised command.


Format:


%CLEARMODS=handle

handle: handle number for the command


Example:


%CLEARMODS=[cmdh]

86

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%COMMITOPERATION

Description:


This directive commits the operation to the EdgeCAM database and creates a machining command in the
instruction list. Subsequent Machining instructions generated by the PCI are created as child instructions for
the operation. These are displayed with the '***' prefix in the instruction list.


Format:


%CommitOperation=OperationID

%CommitOperation=OperationID,DigBuff1^DigBuff2^&ldots;

OperationID: The ID returned by %InitOperation

DigBuff: Digitise buffer to be added to the operation. Each digitise buffer is added using the ^
separator. No digitise buffers have to be supplied if the operation does not require user interaction.
The digitise buffers supplied are added together and used when regenerating the operation.

87

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%COPYMODIFIERS

Description:


To copy similar modifiers from one command to another (similar is defined as having the same number and
type).


Format:


%CopyModifiers=SrcCmd,DestCmd,ListOfModifiers

SrcCmd: the handle of the command from which to copy the modifiers.

DestCmd: the handle of the command into which to copy the modifiers.

ListOfModifers: an optional parameter. It can be a caret-separated list of those modifiers that you
wish to copy. If not supplied, all similar modifiers are copied.


Examples:

For example, in the Pocket operation, the roughing cycle can either be AreaClear or Lace. Nearly all the
modifiers in the operation are common between these two cycles (Stepover, Cut Increment, Depth
parameters etc.). The most efficient way to implement this would be to add command modifiers from one of
the two commands (say Lace), and if the user chooses AreaClear, then copy over the modifiers from the
Lace command to the AreaClear command.


%CopyModifiers=[cmdLace],[cmdAreaClear]


This would copy over all similar modifiers from one command to the other.


%CopyModifiers=[cmdLace],[cmdAreaClear],28^29^161^9

This would copy the depth modifiers (Clearance, Retract, Level and Depth) from one command to the other.

88

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%DEBUG

Description:


This selects the level of debug, allowing you to view the substituted and unsubstituted version of each line of
the parametric as it is run.


Format:


%DEBUG=<d/s><0/1>

Debug messages can be output to:

Screen only (%DEBUG=s)

Disk File only (%DEBUG=d)

Screen and Disk File (%DEBUG=ds).

When output to a disk file, the file PT_DEBUG.TXT is created in the system temporary file location. Control
the level of debug by adding 0 or 1 to the end of the statement:

%DEBUG=0 debug off

%DEBUG=1 debug on all lines

When debug text is output to the screen, any lines longer than 78 characters are truncated.


Example:


%DEBUG=ds1

%DEBUG=0

%DEBUG=s1

89

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%DELETE

The %DELETE directive deletes the specified variable name. This directive is usually placed at the
beginning or the end of a PCI file. Note that all variables continue to exist until the PCI stops running.


Format:


%DELETE=variable


Examples:


%DELETE=$TEXT

%DELETE=COUNT

90

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%DELETE_ALL_VARS

The %DELETE_ALL_VARS directive deletes all currently defined variables. This directive is typically used at
the beginning or the end of a PCI file to delete all currently defined variables. Note that all variables continue
to exist until the PCI stops running.


Format:


%DELETE_ALL_VARS

91

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%DISPLAY

Description:

Allows text to be displayed on screen. Multi line text is supported by delimiting each line with the ‘\’
character. Note that %MESSAGEBOX can also display text in a dialog without the need to have a trailing \
on the message.

If a single line display is used, the text appears on the status bar and processing continues. You should not
exceed 80 characters per display line.

If the Feedback Dialog option on the General tab of the Preferences (Options menu) dialog is checked
multi line %Display text is sent to a dialog box and must be dismissed by the user before further processing
of the PCI takes place. If this preference is not checked the text is displayed in the feedback window and
processing continues without user acknowledgement.

Format:

%DISPLAY=<text to be displayed>


Examples:


Single line text

%DISPLAY=The value of the calculation is: [VAR]

If the value of [VAR] is 75 then the following text would be displayed

The value of the calculation is: 75

Note: the text for a single line display is displayed on the status bar, not in a dialog.


Multiple line text

%DISPLAY=Option 1\Option 2\Option 3

This would display the following in a dialog box:

Option 1

Option 2

Option 3

92

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%DOOPERATIONMODS

Description:

Prompts the user to enter values for the modifiers. A standard Windows dialog is presented containing the
modifiers as specified by the %ADDCMDMODTOOPERATION directives.

If the user completes the dialog and selects ‘OK’ , cmdRet is assigned the value #FINISH. If the user selects
‘Cancel’ #ESCAPE is assigned.

A standard EdgeCAM dialog is displayed, containing each modifier as specified by the
%ADDCMDMODTOOPERATION and %ADDUSERMODTOOPERATION directives.


Format:


%DOOPERATIONMODS=cmdRet=[OperationId]

93

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%END

Description:

To terminate PCI processing. This is typically used before subroutine definition or in an error condition.

Note that if %END is executed in a %INCLUDE file, the entire PCI is terminated.


Format:


%END=[#FINISH]

%END

If no parameter is given then [#FINISH] is assumed.


%END=[#ESCAPE]

%END=[#ABORT]


See Also: %GOSUB.

94

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ENDIF

Description:

To signify the end of a multiple %IF statement.


Format:


%ENDIF


Example:

%IF [FRED]=5

%CALC=BILL=[FRED]+6

%IF [BILL]>10

%GOTO=LABEL2

%ENDIF

%GOTO=LABEL3

%ENDIF

95

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ERROR

Description:

To enable/disable the display of warning messages on the screen.


Format:


%ERROR=#

If %ERROR is set to 1 then any warning messages will be displayed on the screen (this is the default
action). This option can be used to re-instate the display of messages on the screen.

If %ERROR is set to 0 then any warning messages will NOT be displayed on the screen. This option allows
a parametric to continue, skipping over a message that would be displayed on the screen (thereby halting
the PCI until the detection of a keypress).


Example:

In this example a ‘zero length line’ warning message would be displayed by default. However, no warning
messages will be displayed because %ERROR has been set to zero.

%ERROR=0

* Initialising command:- Line

%INITCOMMAND=cmdh=2,1

%CLEARMODS=[cmdh]

* Setting modifier 'Colour'

%SETMODIFIER=[cmdh],1,Green|1

* Setting modifier 'Layer'

%SETMODIFIER=[cmdh],3,1

* Setting modifier 'Style'

%SETMODIFIER=[cmdh],2,Solid|0

%INITDIGINFO=gdh

* Add Free dig to Digitised input data

%ADDFREEDIG=[gdh1],X-85.77Y28.655

* Add Free dig to Digitised input data

%ADDFREEDIG=[gdh1],X10.9162Y-49.7076

* Add Entity to Digitised input via its number 3DSnap NO Direction Reverse

%ADDENTNODIG=[gdh1],[&BASEENT]+1,0,1

* Add Entity to Digitised input via its number 3DSnap NO Direction Reverse

%ADDENTNODIG=[gdh1],[&BASEENT]+1,0,1

* Finish Digitised input

%ADDFINISHDIG=[gdh1],[#FINISH]

%EXECCOMMAND=cmdret=[cmdh],[gdh1]

%FREEDIGINFO=[gdh1]

96

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%EXECCOMMAND

Description:

This directive executes the previously initialised command (using %INITCOMMAND) with the modifiers and
sub-modifiers as defined by the user.

The %EXECCOMMAND includes context checking to prevent EdgeCAM commands being used with invalid
tooling. Additionally, the %EXECCOMMAND completes the initialisation of the command.


Format:


%EXECCOMMAND=retval=handle,getdata_vmh

retval:

return value from executed command

Handle:

handle number for command

Getdata_vmh:

optional getdata buffer


Example:


%EXECCOMMAND=cmdret=[cmdh],[gdh1]


Multiple digitise buffers may be used when executing a command

In some instances it is useful to add together digitise buffers, before passing a single handle to
%INITCOMMAND. Typically this helps when dealing with islands with the geometry from each island held in
a digitise buffer.

%EXECCOMMAND optionally takes additional digitise buffers in its arguments, as shown below.


%EXECCOMMAND=[cmdProfile],[gdOuterProf]^[#FINISH]^[gdIsland]^...

A variable number of digitise buffers are supported by this method.

The read only variables #FINISH, #REDO, and #ABORT may be used directly to complete the specification
of digitised information.

97

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%FREECOMMAND

Description:

This directive frees all storage associated with a previously initialised command. This is only used if the
command is not executed since the %EXECCOMMAND automatically frees any storage used.


Format:


%FREECOMMAND=handle

handle: handle number for the command

98

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%FREEDIGINFO

Description:

This directive closes the (previously initialised) digitised information buffer. This must be carried out for each
occurrence of %INITDIGINFO, since %EXECCOMMAND does not release storage allocated by this buffer.

Note that you may want to retain the digitised information held in the buffer (to use data in another
command). You can do this by changing the name of the handle on the %INITDIGINFO (and associated
data) to a unique name and only execute the %FREEDIGINFO=uniquename once you have finished with
the data.

An example of this is in the involute.pci file. This can be found in the edge\cam\examples\pci directory.


Format:


%FREEDIGINFO=handle

handle: number for the digitise buffer


Example:


FREEDIGINFO=[gdh1]

99

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%FREEMESSAGESTRING

Description

This PCI directive frees a message string previously initialised by %INITMESSAGESTRING.


Format:


%FreeMessageString=MessageHandle

MessageHandle: Handle number returned by %INITMESSAGESTRING


Example:


%FreeMessageString=[strMessage]

See Also: %AddMessageString, %InitMessageString, %MessageBox

100

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%FREEOPERATION

Description:

Frees memory used by the PCI operation.


Format:


%FREEOPERATION=OperationId

101

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%GETMODIFIER

Description:

This directive has to used in conjunction with %AddCmdModToOperation.


Format:


%GetModifier=variableset=[command handle],modifier number,variable name to store returned value


Example:

In the example below bSet is 1 when a value is returned for tool diameter or 0 when no value is returned,
and _realtooldiam is used to store the returned diameter value.


* Diameter

%AddCmdModToOperation=[OpId],[cmdTool],47,^"Tooling"17

%AddCallBackReference=[OpId],tsFinish,[#IndexDiameter],[cmdTool],[#ModDiameter]

*

%Label=DoOpMods

*

%DoOperationMods=nOpRet=[OpId]

%GetModifier=bSet=[cmdtool],47,_realtooldiam

See Also: %COPYMODIFIERS.

102

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%GOSUB

Description:

Processing jumps to the line specified by a label, until a %RETURN statement is encountered, at which point
processing resumes at the statement following the %GOSUB.

Subroutines may be nested.


Format:


%GOSUB=label


Example:


%ASK=ANGLE IN DEGREES? =DEG

%GOSUB=DEG_TO_RAD

%DISPLAY=ANGLE IN RADIANS IS [RAD]

%END

%LABEL=DEG_TO_RAD

%CALC=RAD=[DEG]*3.14159/180

%RETURN

This example prompts for an angle in degrees and then displays that value in radians. The calculations are
carried out in a subroutine.

103

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%GOTO

Description:

Processing jumps to a line specified by a label.

Using this command, a loop may be created to execute a portion of the parametric file several times, to jump
over a section of code, or to jump out of another loop. Note that you can create an infinite loop if there is no
end condition, or if the end condition is not met.


Format:


%GOTO=label


Example:


%GOTO=JUMP

...

...

%LABEL=JUMP

104

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%IF

Description:

If the result of the comparison between variable1 and variable2 is true, then processing jumps to the line
specified by a label.


Format:


%IF variable1 operator variable2 %GOTO=label

The variables may be of any type, but numeric and string variables may not be mixed.

Operators supported are:

<>

not equal to

<=

less than or equal to

>=

greater than or equal to

<

less than

>

greater than

=

equal to


Example 1:


%IF [COUNT]<10 %GOTO=REPEAT

%IF [COUNT]>[NUMBER] %GOTO=END

%IF [$STRING]=Q %GOTO=STOP

Note that single-line IF statements only work with %GOTO statements.


Example 2:


%IF [COUNT]=[NUMBER]

%CALC=[NUMBER]*2

%ENDIF

Multiple statements are also permitted, in which case an %ENDIF is used to signify the end of the
conditional statement. Nested %IF statements are valid.


Example 3:


%IF [COUNT]=5

%CALC=NUMBER=[COUNT]+6

%IF [NUMBER]>10

%GOTO=LABEL2

%ENDIF

%GOTO=LABEL3

%ENDIF

105

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Indentation may be used as above to aid readability, but you can only use tabs.

106

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%INCLUDE

Description:

Calls an existing PCI from within another PCI.


Format:


%INCLUDE=path

path: Directory location and filename (variables may be used)

Note that any variables used in the %INCLUDE string must be defined before PCI execution.


Example:


%CALC=$PATH=c:\tmp

%INCLUDE=[$PATH]\test.pci

... where $PATH has previously been assigned a value, for example ‘c:\EdgeCAM\examples’.

107

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%INITCOMMAND

Description:

This directive initialises a command from within a PCI. Each call of this directive returns a handle, which is a
unique reference to that instance of the command and is required with all subsequent references to it. The
variable ‘cmd1’ is the default for a command handle.


Format:


%INITCOMMAND=handle=verb,noun

handle:

returned handle number for command

verb:

Verb number for command

noun:

Noun number for command


Example:


%INITCOMMAND=cmd1=2,1

This would set up a handle for the GEOMETRY LINE command.

Turn off context checking when initialising a command

The PCI directive %INITCOMMAND needs valid tooling to be selected for the command being initialised.
Normally this works well, but when building up a PCI operation, the tooling is unlikely to have been pre-
selected since the tooling is an integral part of the operation.

The %INITCOMMAND has an optional additional parameter to turn off the context checking when initialising
a command:


%INITCOMMAND=cmdFaceMill=102,4,[#FALSE]

This will initialise the EdgeCAM command with no checking for the validity of the selected tool.

108

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%INITDIGINFO

Description:

Initialises storage space for digitised information. When command save is used the variable ‘gdh1’ is always
used to reference this storage.


Format:


%INITDIGINFO=handle

handle: name of the digitise buffer


Example:


%INITDIGINFO=gdh1

109

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%INITMESSAGESTRING

Description:

This PCI directive initialises a message string and sets up a handle used to identify it. A message string is a
list of text strings each of which is shown on a separate line when displayed using %MESSAGEBOX.


Format:


%InitMessageString=MessageHandle

MessageHandle: Returned handle number used to access message string


Example:


%InitMessageString=strMessage

When a message list is no longer required it can be freed by using %FREEMESSAGESTRING. When a PCI
terminates all message strings still defined are automatically freed.


See Also: %AddMessageString, %FreeMessageString, %MessageBox

110

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%INITOPERATION

Description:

This initialises a new EdgeCAM operation. A variable name is defined and this is used as reference to the
operation in subsequent steps. A name for this operation is also given.


Format:


%INITOPERATION=PCI variable=operation name,help file name,help context id


Example:

%INITOPERATION=OperationId=Rough Face Mill,EdgeOp.hlp,10021

OperationId: the PCI variable used to identify the operation.

“Rough Face Mill”: the textual name of the operation. This string is also used as the title of the
operation dialog when displayed to the user, and for the name of the operation displayed in the
EdgeCAM operations list.

EdgeOp.hlp: the name of the help file to be used to display context sensitive help. This will be
located in the appropriate ‘language’ directory or subdirectory.

10021: the help context id for this command.

The help file name and the context Id are optional parameters.

111

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ISTOOLSAME

Description:

The Toolchange command should only be executed if the current tool is different from the new one.
%ISTOOLSAME compares the tool defined in a toolchange command handle with the currently selected
tool.


Format:


%IsToolSame=Result=CommandHandle

Result: a variable in which the result will be placed. The result will be either #TRUE or #FALSE.

CommandHandle: the handle to the toolchange command about to be executed.


Example:


%IsToolSame=bToolSame=[cmdMillCutter]

%If [bToolSame]=[#FALSE]

%ExecCommand=cmdret=[cmdMillCutter],[hDigBuffEmpty]

%EndIf

112

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ISVARDEFINED

Description:

If a PCI accesses an undefined variable (using a %Calc directive for instance), an error message is
displayed. It can be useful to check if a variable exists without causing an error. It is also essential to be
able to tell if a User Modifier has had its value set by the user. %ISVARDEFINED lets you check if a variable
has been defined.


Format:


%IsVarDefined=Exists=Variable

Exists: a variable that will be set to [#True] or [#False].

Variable: the subject of the test.


Example:


%IsVarDefined=bExists=_realDepth

%If [bExists]<>[#True]

%MessageBox=Depth must be specified

%Endif

113

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%LABEL

Description:

This is the destination of a %GOTO or %GOSUB statement.


Format:


%LABEL=label


Example:


%IF[VAR]=1%GOTO=END

. .

. .

%LABEL=END

114

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%LEN

Description:

The length of a string is loaded into a numeric variable.


Format:


%LEN=variable=string


Example:


%LEN=LENGTH=ABCDEF

The string ‘ABCDEF’ is six characters long, so the directive assigns a value of ‘6’ to the numeric variable
LENGTH.

115

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%LOADTOOL

Description

Loads tools from the currently selected ToolStore.


Example


%LoadTool=[cmd1],10mm Slot Drill - 2 Flute - 13A F30m

To use this directive in a PCI the following sequence of commands is suggested:


* Initialising command:- Milling Cutter

%InitCommand=cmd1=36,108

* Clear the command modifiers

%ClearMods=[cmd1]

* Load required tool from ToolStore

%LoadTool=[cmd1],10mm Slot Drill - 2 Flute - 13A F30m

* Present dialog for interactive input (Optional)

%AskMods=cmdret=[cmd1]

* Check command completed

%if [cmdret]<>[#FINISH]

%FreeCommand=[cmd1]

%endif

* Execute command&#9;

%if [cmdret]=[#FINISH]

%InitDigInfo=gdh1

%ExecCommand=cmdret=[cmd1],[gdh1]

%FreeDigInfo=[gdh1]

%endif

Note that if an attempt is made to load a non-existent tool, no data will be placed in the dialog. This will be
trapped by the system at run time as it expects at least a diameter to be specified for each tool and a
warning to the effect that no diameter has been set will be given.

If no dialog is to be presented for user input then the %ASKMODS line, above, should be omitted.

116

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%MESSAGEBOX

Description:

Although you can use the %DISPLAY directive to display a Windows message box, for compatibility with
DOS a fixed-width font is used. A better look can be achieved by using %MESSAGEBOX since it uses a
proportionally spaced font. Read-only variables are supplied to define the message-box styles.

There are two forms of this directive, a shortened version which just displays the message with an OK
button and the full version which allows the style to be configured and the return code from the box to be
determined. The shortened version is an alternative to %DISPLAY.


Format:


%MessageBox=Message

%MessageBox=ReturnCode=Style,Message


ReturnCode

Indicates the button pressed to exit the message box. This can be one of the following constants:

[#MB_RET_OK] OK button was pressed

[#MB_RET_CANCEL] Cancel button was pressed

[#MB_RET_YES] Yes button was pressed

[#MB_RET_NO] No button was pressed

Style

Controls the Icon and buttons displayed on the message box. The button style and icon style can be
specified by using a + between them. Button styles are:

[#MB_OK] OK button is displayed

[#MB_OKCANCEL] OK and Cancel button are displayed

[#MB_YESNOCANCEL] Yes, No and Cancel buttons are displayed

[#MB_YESNO] Yes and No buttons are displayed

[#MB_ICONERROR] Message box has error (x) icon

[#MB_ICONINFORMATION] Message box has information (i) icon

[#MB_ICONQUESTION] Message box has question (?) icon

[#MB_ICONWARNING] Message box has warning (!) icon

[#MB_DEFBUTTON2] Second button is default

[#MB_DEFBUTTON3] Third button is default

[#MB_NODEFBUTTON] No button is default

[#MB_RIGHT] Message is right justified

Examples

117

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%MESSAGELISTBOX

Description:

This directive is an alternative to %OPTION directive. Instead of buttons the options are displayed in a
listbox. The return value is the option selected (first option is 1) unless Cancel is pressed when –1 is
returned. The default value determines which item is initially selected when the listbox is displayed.


Format:


%MessageListBox=Selection=DefaultOption,Title,Option1^Option2^Option3

Selection: Indicates the option selected (1, 2, 3 &ldots;) or –1 if Cancel was pressed.

DefaultOption: Determines which option is initially selected (1, 2, 3...). If this is not a valid option
number the last option is selected.

Title: This is the title for the ListBox

Option1^&ldots;: The list of options, each one separated by ^. Note: The

options cannot contain

commas.


Example:

Display a list of three choices (second choice is the default), and report user selection. The same sample is
also shown using message strings


* Listbox with second option defaulted

%MessageListBox=nRet=2,Select an Option,Option1^Option2^Option3

%MessageBox=Selected option : [nRet]

* Use Message Strings

%InitMessageString=strOptions

%Calc=Option=0

%Label=OptionLoop

%Calc=Option=[Option]+1

%AddMessageString=[strOptions]=Option[Option]

%If [Option] < 3 %GotoOptionLoop

%MessageListBox=nRet=2,Select an Option,[strOptions]

%MessageBox=Selected option : [nRet]

%FreeMessageString=[strOptions]

118

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%MID

Description:

This stores part of one string variable as another. That is, part of string2 is loaded into the string1 variable
(see the format and example below). The starting character and the length of the part are also defined.


Format:


%MID=string1=string2,start,length

length must be 252 or less


Example 1:


%MID=$SUBSTR=[$STRING],3,2


Example 2:


%MID=$STRING=ABCDEF,3,2

This second example would define $STRING as CD.

119

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%OPTION

Description:

To prompt the user to select one of a list of options and assign that option to a variable.


Format:


%OPTION=prompt^option1^option2^option3=variable

An %OPTION directive line can be a maximum of 128 characters long. The prompt string can be a
maximum of 45 characters long.

Note that %ASK can perform a similar function.


Example:


%label=page1

%OPTION=PAGE1^PAGE2^PAGE3^PAGE4^END=PAGE

%if[page]=1%goto=Page2

%if[page]=2%goto=Page3

%if[page]=3%goto=Page4

%if[page]=4

%end

%endif

%label=page2

%option=Page2^page1^page2^page3^page4^end=page

%if[page]=1%goto=page1

%if[page]=2%goto=page2

%if[page]=3%goto=page3

%if[page]=4%goto=page4

%if[page]=5

%end

%endif

...

(etc.)

This produces an option box from which only one option can be chosen. The selected option is then
assigned to the variable PAGE. The first option sets PAGE=1, the second sets PAGE=2 and so on. The
value of PAGE can be used with %IF statements to determine the program flow (see below)

120

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

If the number of options in this example is reduced by one, the type of dialog box changes, as shown here:

NOTE: This shows the options as buttons on a dialog. However if the options are Yes^No or OK^Cancel
then %MessageBox is better. If you want to display a list of options instead of buttons, use
%MessageListBox.

See Also: %MessageListBox, %MessageBox

121

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%PADTEXT

Description:

To justify the text string relative to the position defined, and "pad" the entire string to the specified length.


Format:


%PADTEXT=variable1=string,justification,length

string

Text string

justification

0 = Left, 1 = Right, 2 = Centre

length

specifies the total number of characters in the string


Example:


%PADTEXT=$STR1=1234,0,10

%PADTEXT=$STR2=1234,1,10

%PADTEXT=$STR3=1234,2,10

*

%MessageBox=1 *[$STR1]*\2 *[$STR2]*\3 *[$STR3]*


The text for this example appears as follows (with spaces shown as "-"):


1 *1234------*

2 *------1234*

3 *---1234---*

122

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%QUERY

Description:

To query EdgeCAM entities.

Format:


%QUERY=nret=[entno],[#true]

%QUERY=nret=[$entname],[#true]

entno the entity name or number

#true determines if the co-ordinates are returned in CPL or World Co-ordinates

A single directive is used for convenience.

The variable ('nret') is set to 1 if the entity exists, or 0 if the entity is deleted or doesn't exist. This variable
must be specified.

This will set up appropriate system variables for the entity specified. The system variables will be dependent
on the type of the entity being queried.

System variables are set as follows:

System Variable

Contents

&ETYPE

Entity Type (if deleted (that is recoverable with Undo), 16384 is added)

&ENAME

Entity Name.

&ENTNO

Entity Number

&XSTART,
&YSTART,
&ZSTART

Start point of entity

&XEND, &YEND,
&ZEND

End point of entity

&XCENTRE,
&YCENTRE,
&ZCENTRE

Centre point (Arcs/ellipses only)

&RADIUS

Radius (Arcs only)

A full list of entity types is defined in PAMS_PDI.DEF.

&Query returns values for X,Y and Z as if for the milling environment. If working in another environment
then due allowance must be made for this. For example, in the turning environment the XStart and XEnd
values will be held in &YStart and &YEnd and the ZStartZEnd values will be in &XStart and &XEnd.

123

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%QUERYDIGINFO

Description:

To allow the PCI to query the contents of a digitise buffer.


Format:

%QUERYDIGINFO=nret=[gdh],[ElementNumber]

The directive needs a specified digitise buffer [gdh] and element number.

Once executed the appropriate system variables are updated with the entities information.

The variable ('nret') is set to 0 if the entity is deleted, or 1 if the entity is not deleted. This variable must be
specified.

See PCI System Variables

Entity Name digitises are returned as DIG_ENTNODIG for the type (the name can be retrieved from the
relevant system variable).

Free digitise locations specified by co-ordinate strings are returned as DIG_LOCATION for the type. The co-
ordinate string is not accessible.

For free digitises, the X, Y and Z locations are set up in the system variables &XDIG, &YDIG and &ZDIG
respectively.

For world and view digitises, &XDIG, &YDIG and &ZDIG contain the world and view co-ordinates
respectively.

For port digitises, the port number is set up in the system variable &PORT.

No other system variables are set up for the other digitise types (DIG_SCREEN, DIG_UVSURF,
DIG_ELEMENT, DIG_CONSTRUCT_REF and DIG_COMPENENT_INFO).

For entity digitises, the information set up is as for the %QUERY directive.

All information is set up in the co-ordinate system of the current CPL.

Example

124

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%REINITCOMMAND

Description:

A command can be initialised “out of context”, that is without the normal checks to see if it is valid to execute
the command at that time. In bypassing the context checking, a number of actions that normal take place
during command initialisation are also bypassed. Modal values are not loaded, and modifiers from the code
generator are not added. In certain cases, these must be accessed before the command is executed, so
use %REINITCOMMAND to re-initialise a command that has been initialised out of context.


Format:


%ReInitCommand=CommandHandle

CommandHandle is the handle of the command to be re-initialised


Example:


%ReInitCommand=[cmdHole]

125

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%RESPONSE

Format:


%RESPONSE=value


Description:

There are a number of places in EdgeCAM which require confirmation from the user before a certain action
is carried out. There are three cases to consider:

Overwriting an existing data file. An example of this is saving a file over one which already exists.

Overwriting an existing part file by loading a new data file.

Exceptional circumstances, such as printer off line require a retry option box to be offered to the
printer.

This directive gives a mechanism to prevent EdgeCAM from offering an option box, thereby halting the PCI
application to wait for user input. The %RESPONSE settings are:

%RESPONSE=0

System processes all system confirmation boxes and asks user for
confirmation. This is the default value.

%RESPONSE=1

System ignores all file overwrite confirmation requests, assuming a
positive response.

Option boxes presented to the user in exceptional circumstances only (such as printer off line) always pause
and prompt the user for input. No method is offered for automatically forcing a negative response.

126

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%RETURN

Description:

Used at the end of a subroutine to return processing to the line following the last %GOSUB statement.


Format:


%RETURN

Example:

See %GOSUB.

127

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%SETCALLBACK


Description:

Sets up the ToolStore to be ready to return values into modifiers contained in the PCI.


Example:

%SetCallBack=tsFinish=[OpId],[cmdToolFinish],[#ModToolStore]

This command is intended for use with ToolStore toolchanges and will usually be used together with
%ADDCALLBACKREF. Click here to see an example.

128

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%SETFEATUREVARS

Description:

Assigns feature attribute values to PCI variables.

To see the assigned values, use the PCI variables window (use Right-Click menu Refresh once in the
window). Note that some feature attributes are not available as PCI variables.

This variable names shown in the window are the actual ones you need to use in PCI directives, such as
'~Diameter~', for Hole features.

This needs to be called before you create modifiers that use the variables, to be added to the operation
dialog (using AddUserModToOperation, AddCmdModToOperation and so on).

If more than one such feature is digitised, then only the attributes values common to all the features are set.
For example, if the diameter of a number of holes is the same then the ~diameter is set, but if they have
different depths then ~depth will not be set.

Format

%SetFeatureVars=handle

handle:

returned handle number for command


Please Note

You can use the directive without the handle to clear the variables, after use.

Only certain features support this mechanism:- Mill features found in EdgeCAM 9.0 (unless they are
superseded), Hole features found in EdgeCAM 10.0 or earlier and Turn features. For other features,
use Strategy Manager to allow operations to access feature attributes, rather than PCIs.

The behaviour of the PCI variables set by %SetFeatureVars will not be guaranteed in any PCIs that
use them (apart from the EdgeCAM operations); they may unintentionally become incompatible.

129

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%SETMODIFIER

Description:

This directive sets the value for an EdgeCAM modifier.


Format:


%SETMODIFIER=handle,modifier #,modifier text|value

handle

Handle number for command

modifier #

Modifier number to set

modifier text

Text associated to the modifier value

value

Modifier value


Example:


%SETMODIFIER=[cmdh],1,Blue|2

130

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%SETPACKAGE

Description:

To switch EdgeCAM between Design and Manufacture.


Format:


%SETPACKAGE=value


The %SETPACKAGE settings are:

0 = Design

1 = Manufacture


Example:

When moving to manufacture and initialising a new sequence the PCI currently assumes the machining
sequence values follow immediately afterwards in the PCI as shown in the example below:


%SETPACKAGE=1

* Initialising command:- Machining Sequence

%INITCOMMAND=cmd=2,90

%SETMODIFIER=[cmd],105,Mill|1

%SETMODIFIER=[cmd],102,rotary.mcp

%SETMODIFIER=[cmd],244,[&TOP]

%SETMODIFIER=[cmd],212,Incremental|0

%EXECCOMMAND=cmdret=[cmd],-1

If the machining sequence information is not present in the PCI or a sequence already available, the PCI will
fail.

131

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%TOOLBARMODS

Description:

This directive allows a PCI program to use the toolbar controls for colour, layer and style.


Format:


%TOOLBARMODS=toolbarmods

toolbarmods:

Controls where the PCI obtains colour, layer and style information:

0=Use embedded values in PCI,
1=Use current values from the toolbar.

By default, the PCI uses any values for these parameters that have been embedded in the PCI program.


Example:


%TOOLBARMODS=1

This allows the PCI to use the current toolbar values.

132

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%WAIT

Description:

Inserts a pause of the specified number of seconds. Pressing function key 8 stops the pause and aborts the
parametric.

Format:


%WAIT=time


Example:


%WAIT=20

This causes the program to pause for 20 seconds before continuing.

133

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

PCI System Variables

Note that the real number PCI system variables (for example &XSTART and &SYSTOL) are evaluated in
PCIs to 9 significant figures.

General

&BASEENT

This system variable is set to the last entity number in a new worksession or
loaded part. This allows the creation of new entities to be generated and
referenced to the variable, instead of to an actual entity number which could
be different between worksessions and loaded parts.

For further details on the following system variables refer to the %ASKDIG
directive.

&COLOUR

Colour number

&CPL

Active CPL Name

&DIAMETRAL

0 = Radial 1 = Diametral

&DIGSTAT

>=0 position given.

-1 abort ([#ABORT] read only variable)

-2 escape ([#ESCAPE] read only variable)

-3 finish ([#fFINISH] read only variable)

&DIRFLAG

0=start of entity, 1=end of entity

Used in conjunction with %ASKDIG, %ASKDIGINFO, %QUERYDIGINFO

&DRAWING

Holds the text sting in the selected language for the drawing CPL

&DRAWTOL

Drawing tolerance

&EDGEMASTER

The master folder path.

&EDGELOCAL

The local folder path, for example:

c:\Program Files\EdgeCAM\Cam

&EDGETOOLDIR

String value containing the path for the tool library.

&ENAME

Returns the entity name.

Used in conjunction with %ASKDIG, %ASKDIGINFO, %QUERYDIGINFO

&ENTNO

Returns the entity number.

Used in conjunction with %ASKDIG, %ASKDIGINFO, %QUERYDIGINFO

&ENVIRONMENT

1 = Milling/Wire 2 = Turn

&ETYPE

Returns the entity type.

Used in conjunction with %ASKDIG, %ASKDIGINFO, %QUERYDIGINFO

&GRID

0 = OFF 1 = ON

&LAYER

Name of active Layer

&NEXTENT

This system variable is set to the next entity number available in the current
part. See &NEXTENT for details

&NUMBEROFSOLIDS

Returns number of solids in part file.

&PARTNAME

The path and filename of the open part.

134

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

&PORT

Port in which digitise was made.

Used in conjunction with %ASKDIG, %ASKDIGINFO, %QUERYDIGINFO

&RADIUS

Arc radius

&STYLE

Style number

&SYSTOL

System tolerance

&TOP &FRONT &LEFT
&RIGHT &BOTTOM
&BACK

Holds the text string in the selected language for the standard milling CPLs

&TURN &INV_TURN
&RADIAL &AXIAL
&WRAP

Holds the text string in the selected language for the standard turning CPLs

&UNITS

Returns the current part units, either [#IMPERIAL] or [#METRIC].

&VERSION

Returns the current EdgeCAM version number (as reported in the About box)
as a string, e.g. in EdgeCAM version 7.0 it will return "7.0" but in the "a"
patch it would return "7.0a".

&XCENTRE &YCENTRE
&ZCENTRE

Arc centre co-ordinates

&XDIG &YDIG &ZDIG

XYZ cursor position.

Used in conjunction with %ASKDIG, %ASKDIGINFO, %QUERYDIGINFO

&XEND &YEND &ZEND

Arc or line end co-ordinates

&XSNAP &YSNAP
&ZSNAP

XYZ snapped location.

Used in conjunction with %ASKDIG, %ASKDIGINFO, %QUERYDIGINFO

&XSTART &YSTART
&ZSTART

Arc or line start co-ordinates


Manufacture Only

&3AXMILL

Defined as #TRUE or #FALSE. If #TRUE, the machine tool is a mill.

&4AXIS

Defined as #TRUE or #FALSE. If #TRUE, the machine tool has 4 axis
capability

&AT_TOOLCHANGE

Tool is at the tool change position (#TRUE / #FALSE).

&AT_TOOLHOME

Tool is at the tool home position (#TRUE / #FALSE).

&BAXIS

0 = No B Axis.

1 = Positional Only (machine can index to B angles but not simultaneously
drive the B axis).

2 = Simultaneous (machine can drive the B axis simultaneously).

&COOLANT

Current coolant status (assumes coolant is Macro 104). The values returned
are 1-based lists, as defined by the Code Wizard templates. A value of 0 is
returned if the macro has not been used and -1 is returned if the macro is not
found for the current machine.

&CSS

CSS selected (#TRUE / #FALSE).

135

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

&CYAXIS

Defined as #TRUE or #FALSE. If #TRUE, the machine tool has C/Y Axis
capability.

&FEED

Current planar feed rate.

&FEEDTYPE

Feed/Min (0) Feed/Rev (1).

&GEAR

Current Gear Status (Assumes Gear is Macro 110). The values returned are 1
based lists, as defined by the Code Wizard templates. A value of 0 is returned
if the macro has not been used and -1 is returned if the macro is not found for
the current machine.

&LATHE

Defined as #TRUE or #FALSE. If #TRUE, the machine tool is a lathe.

&MILLMODE

0 = Fixed 1 = Driven

&PLUNGEFEED

Current plunge feed rate.

&POSTNAME

Returns the name of the current code generator.

Example:
%messagebox=The current code generator is [&POSTNAME]

&ROTARY

Defined as #TRUE or #FALSE. If #TRUE, the machine tool has rotary
capability.

&SEQUENCENAME

Currently active sequence's name.

&SPEED

Current spindle speed.

&SPINDLE

Current spindle status (assumes spindle is Macro 101). The values returned
are 1 based lists, as defined by the Code Wizard templates. A value of 0 is
returned if the macro has not been used and -1 is returned if the macro is not
found for the current machine.

&TOOLPOSITION

Current turret position.

&TOOLRADIUS

Current tool radius.

&TOOLTYPE

Type number of the tool currently in use. One of:

Wire = -2, PDI tool = -1, End mill = 0, Ball nose = 1, Tap = 2, Drill = 3,
Taper = 4, Turn = 6, T-Slot = 6, Bore = 7, Lollipop = 7, Groove = 8,
Thread = 9, Parting off = 10, Pre load = 11, Assembly = 12

&WIRE

Defined as #TRUE or #FALSE. If #TRUE, the machine tool is a wire eroder.

&XHOME &YHOME
&ZHOME

Home position (xyz).

&XPOS &YPOS &ZPOS Current tool position (xyz).

&XTOOL &YTOOL
&ZTOOL

Tool Change position (xyz).

136

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

&NEXTENT

Description:

Assigns the next free entity number to the variable <VAR>. The advantage of &NEXTENT over &BASEENT
is that the value for &NEXTENT is continually updated during the execution of the PCI, because it
references the next available entity number.

For details of other system variables, see %ASKDIG.

Format:

%CALC=<VAR>=&NEXTENT

Example:

%CALC=NEXTENTITY=[&NEXTENT]

*Create a set of points

%INITCOMMAND=cmd1=2,36

%CLEARMODS=[cmd1]

%SETMODIFIER=[cmd1],1,Gold|21

%SETMODIFIER=[cmd1],3,44

%SETMODIFIER=[cmd1],2,Solid|0

%INITDIGINFO=gdh1

%ADDFREEDIG=[gdh1],X0Y0

%ADDFREEDIG=[gdh1],X10Y-10

%ADDFREEDIG=[gdh1],X20Y0

%ADDFREEDIG=[gdh1],X30Y-10

%ADDFREEDIG=[gdh1],X40Y0

%ADDFINISHDIG=[gdh1],[#FINISH]

%EXECCOMMAND=cmdret=[cmd1],[gdh1]

%FREEDIGINFO=[gdh1]

*Create line polyline between the points

%INITCOMMAND=cmd1=2,1

%CLEARMODS=[cmd1]

%SETMODIFIER=[cmd1],155,1

%SETMODIFIER=[cmd1],1,Gold|21

%SETMODIFIER=[cmd1],3,44

%SETMODIFIER=[cmd1],2,Solid|0

%INITDIGINFO=gdh1

%ADDDIGINFO=[gdh1],1,[#ENTITYDIG]

[#DIG_ENTNODIG],[NEXTENTITY],[#DIG_CHAIN]+[#DIG_3DSNAP],[#DIR_FORWARD]

%ADDDIGINFO=[gdh1],1,[#ENTITYDIG]

[#DIG_ENTNODIG],[NEXTENTITY]+1,[#DIG_CHAIN]+[#DIG_3DSNAP],[#DIR_FORWARD]

137

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%ADDDIGINFO=[gdh1],1,[#ENTITYDIG]

[#DIG_ENTNODIG],[NEXTENTITY]+2,[#DIG_CHAIN]+[#DIG_3DSNAP],[#DIR_FORWARD]

%ADDDIGINFO=[gdh1],1,[#ENTITYDIG]

[#DIG_ENTNODIG],[NEXTENTITY]+3,[#DIG_CHAIN]+[#DIG_3DSNAP],[#DIR_FORWARD]

%ADDDIGINFO=[gdh1],1,[#ENTITYDIG]

[#DIG_ENTNODIG],[NEXTENTITY]+4,[#DIG_CHAIN]+[#DIG_3DSNAP],[#DIR_FORWARD]

%ADDFINISHDIG=[gdh1],[#FINISH]

%EXECCOMMAND=cmdret=[cmd1],[gdh1]

%FREEDIGINFO=[gdh1]

138

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Digitise Types

[#FREEDIG]

[#ENTITYDIG]

139

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Command Return Types

[#FINISH]

[#ESCAPE]

[#ABORT]

140

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Digitise Buffer Element Types

For further details on the following read only variables refer to the %ADDDIGINFO directive:

[#DIG_ENTNODIG]

[#DIG_ENTNAME_DIG]

[#DIG_COORDSTR]

[#DIG_LOCATION]

[#DIG_WORLD]

[#DIG_VIEW]

[#DIG_SCREEN]

[#DIG_UVSURF]

[#DIG_PORTNUMBER]

[#DIG_ELEMENT]

[#DIG_CONSTRUCT_REF]

[#DIG_COMPONENT_INFO]

[#DIG_REL_WORLD]

141

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Construction Digitise Types

[#CMD_REFERENCE]

[#CMD_MIDPOINT]

[#CMD_CENTRE]

[#CMD_X_ON_ENT]

[#CMD_Y_ON_ENT]

[#CMD_INTOF]

[#CMD_LENGTH]

[#CMD_BISECT]

142

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Chaining Types

[#DIR_FORWARD]

[#DIR_REVERSE]

[#DIG_CHAIN]

[#DIG_2DSNAP]

[#DIG_3DSNAP]

143

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Boolean Types

[#TRUE]

[#FALSE]

144

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Message Box Types

[#MB_OK]

[#MB_OKCANCEL]

[#MB_YESNOCANCEL]

[#MB_YESNO]

[#MB_ICONQUESTION]

[#MB_ICONINFORMATION]

[#MB_ICONWARNING]

[#MB_ICONERROR]

[#MB_DEFBUTTON2]

[#MB_DEFBUTTON3]

[#MB_NODEFBUTTON]

[#MB_RIGHT]

[#MB_RET_OK]

[#MB_RET_CANCEL]

[#MB_RET_YES]

[#MB_RET_NO]

145

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Profile Selection Types

[#PROF_CLOSED]

[#PROF_OPEN]

[#PROF_SIDE_DIGITISE]

[#PROF_SIDE_CENTRE]

[#PROF_SIDE_LEFT]

[#PROF_SIDE_RIGHT]

146

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Unit Types

[#METRIC]

[#IMPERIAL]

147

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Environment Types

[#MILL_ENV]

[#TURN_ENV]

148

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Creating More Read Only Variables

The use of read only variables, or constants, instead of hard-coded constants in PCI source code is a big
help for clarity and readability.

Authors of PCI operations can create their own read only variables using the %CALC statement. This will
work as for normal variables, but the value of the read only variable cannot be reassigned. An example is
shown here:

%CALC=#TOOLDIAMETER=47


A range of read only variables cover the popular identifiers used with %INITCOMMAND, %SETMODIFER
directives. These are referred to as verb, noun and modifier identifiers. A unique verb and noun combination
identifies an EdgeCAM command. Modifier identifiers may be duplicated, but not within the same command.

Read only variables for verbs, nouns and modifiers begin #VERB, #NOUN and #MOD respectively. The full
definition of all verbs, nouns and modifiers are given in the EdgeCAM include files verb.def, noun.def and
modifier.def. Each constant from these files will be included as read only variables.

This will not give an exhaustive list as not all identifiers are included in these files.

The PCI Command Save will use these constants wherever possible.

149

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Reserved PCI Names

A number of special PCI variables are available that can control EdgeCAM.

!checkMDoubleClick=0

This will disable the ability to 'Zoom Extents' by double clicking the mouse wheel.

$SolidFilename

This variable name is used to reload a solid in a PCI. Useful for updating Solids or loading a different model
of the same family.

Example - %calc=$SolidFilename=c:\data\part1234.x_t

See Associative Reloading of Solid Models.

NoLayer

If the PCI variable "NoLayer" exists (with any numeric value, including 0) then Layer number "1" will be
called "1" instead of "Layer1"

DeleteOrphans

Orphaned features can be deleted by setting the numeric PCI variable DeleteOrphans:

In the PCI Variables Window, right-click the User Variables branch.

1.

From the shortcut menu, select New.

2.

Set the Numeric Value to 0 and enter the Variable Name DeleteOrphans.

3.

Click OK.

4.

150

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Entity Type Database Numbers

This section lists the EdgeCAM entities and their corresponding database numbers that are referenced by
the PCI.

1 Line

2 Arc

4 Point

5 Conic curve section

6 Helix

7 Bézier curve

8 Spline curve

9 B-Spline curve

10 Continuous

11 Group

12 Symbol

13 Surface Group

14 Generic collection entity (composite)

15 Generic collection entity (shared)

21 Construction line

22 Construction arc

24 Construction point

30 Arrow

31 Witness line

32 Text

33 Font

34 Linear dimension

35 Angular dimension

36 Diametral dimension

37 Radial dimension

38 Hatch area

50 Ruled Surface

51 Surface of revolution

52 Tabulated cylinder surface

53 Coons patch Surface

54 Spline Surface

55 B-Spline Surface

56 Bézier Surface

57 Flowed Surface

58 Offset Surface

59 Fillet Surface

60 Trimmed Surface

61 Joined Surface

65 Surface Curve

66 Toolpath poly

67 Mesh

68 Digital surface

100 Matrix

150 Associativity

151 Property

152 Sweep

153 List

155 Unwrap

156 Wrap

157 Wire (Linked)

158 Wire (Tapered)

159 Wire (Transformed)

160 Solid info

161 Solid body

162 Solid face*

163 Solid loop*

164 Solid edge*

165 Solid vertex*

171 STL entity

201 Toolpath

202 Mod

204 Gd_info

205 Gd_group

206 CPL

207 Layout

213 Pocket, boss or profile with contoured walls feature

214 Pocket, boss or profile with 3D walls feature

215 Set of faces feature

216 Pocket, boss or profile with vertical walls feature

217 Formed, Radial, 3+2,etc, grouped or single hole as
Feature

218 Edge Loop feature

219 Open Pocket Feature

250 Stock feature

151

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

251 Fixture feature

* You can digitise these to pick the topological object out of the solid entity and pass it to the command, but
no EdgeCAM database entities are created. This means that any entity reference in the PCI will be lost if
you reload the part or the solid.

152

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Limitations to PCI

Since PCI is a method of directly manipulating the EdgeCAM database, it is not applicable outside of the
main EdgeCAM Design and Manufacture modes. Although both the Code Generator and Tool Library
applications can be called from within a PCI, neither can interpret PCI directives.

Machining instructions cannot be manipulated directly under the control of PCI. Instruction editing
commands can be called up but require user intervention to select machining instructions.

153

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

PCI Example - involute.pci

This example creates an involute form with parameters supplied by the user.

Note that this and other example PCI files can be found in your edge\cam\examples\pci directory.

*

* Demonstration PCI

*

* Create an Involute curve with an option to smooth the resultant lines.

*

* This PCI demonstrates:

*

* %SETPACKAGE

* %ASKBOX

* %CALCSIN() COS()

* %IF %ENDIF

* %GOTO %LABEL

* %DISPLAY

* %ADDFREEDIG

* %OPTION

* Using a loop to create data.

* Holding onto a data array

***********************************

*

%setpackage=0

**** Set default values ****

%calc=diam=10

%calc=ang=0

%calc=eang=360

%calc=deg=30

%label=ask

%ASKBOX=Diameter=diam=Endangle=eang=Degreeincrement=deg

%if[eang]=<0

%display=End angle must be positive.\

%goto=ask

%endif

%if[eang]<=[deg]

154

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%display=End angle is less than increment.\

%goto=ask

%endif

%if[deg]=<0

%display=Degree increment must be greater than 0.\

%goto=ask

%endif



%CALC=RAD=[diam]/2

* Initialising command:- Arc

%INITCOMMAND=cmdh=2,2

%CLEARMODS=[cmdh]

* Setting modifier 'Diameter'

%SETMODIFIER=[cmdh],111,[diam]

* Setting modifier 'Colour'

%SETMODIFIER=[cmdh],1,Green|1

* Setting modifier 'Layer'

%SETMODIFIER=[cmdh],3,88

* Setting modifier 'Style'

%SETMODIFIER=[cmdh],2,Solid|0

%INITDIGINFO=gdh1

* Add Free dig to Digitised input data

%ADDFREEDIG=[gdh1],X0Y0

* Finish Digitised input

%ADDFINISHDIG=[gdh1],[#FINISH]

%EXECCOMMAND=cmdret=[cmdh],[gdh1]

%FREEDIGINFO=[gdh1]

* Initialising command:- Line

%INITCOMMAND=cmdh=2,1

%CLEARMODS=[cmdh]

* Setting modifier 'Polyline'

%SETMODIFIER=[cmdh],155,1

* Setting modifier 'Colour'

%SETMODIFIER=[cmdh],1,Cyan|3

* Setting modifier 'Layer'

%SETMODIFIER=[cmdh],3,88

* Setting modifier 'Style'

%SETMODIFIER=[cmdh],2,Solid|0

155

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

%INITDIGINFO=gdh1

* Add Free dig to Digitised input data

%ADDFREEDIG=[gdh1],X[RAD]Y0

*

%LABEL=LOOP

%CALC=ANG=[ANG]+[DEG]

%CALC=LEN=(6.2831853*[RAD])/(360/[ANG])

%CALC=HYP=SQR(([LEN]*[LEN])+([RAD]*[RAD]))

%CALC=HYPANG=ATAN([LEN]/[RAD])

%CALC=REANG=[ANG]-[HYPANG]

%CALC=XCOORD=[HYP]*COS([REANG])

%CALC=YCOORD=[HYP]*SIN([REANG])

* Add Free dig to Digitised input data

%display=End [eang] degrees : [ang] degrees Coord= x[xcoord] y[ycoord]

%ADDFREEDIG=[gdh1],X[XCOORD]Y[YCOORD]

%IF[ANG]=>[EANG]%GOTO=endloop

%GOTO=LOOP

%LABEL=endloop

* Finish Digitised input

%ADDFINISHDIG=[gdh1],[#FINISH]

%EXECCOMMAND=cmdret=[cmdh],[gdh1]

***%FREEDIGINFO=[gdh1]

*

* The %FREEDIGINFO line has been removed so that the data handle can be used for the smooth
operation.

*%FREEDIGINFO=[gdh1]

*

********** SMOOTH *********

*

%option=Smooth^Yes^no=smooth

%if[smooth]=2

* No smooth required. Ensure data handle is freed before PCI ends

%FREEDIGINFO=[gdh1]

%goto=nosmooth

%endif

%calc=tol=0.01

%askbox=Tolerance=tol

*

156

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

* Initialising command:- Smooth

%INITCOMMAND=cmdh=2,56

%CLEARMODS=[cmdh]

* Setting modifier 'Tolerance'

%SETMODIFIER=[cmdh],56,[tol]

* Setting modifier 'Colour'

%SETMODIFIER=[cmdh],1,Red|4

* Setting modifier 'Layer'

%SETMODIFIER=[cmdh],3,1

* Setting modifier 'Style'

%SETMODIFIER=[cmdh],2,Solid|0

* Setting modifier 'Continuous'

%SETMODIFIER=[cmdh],43,1

*%INITDIGINFO=gdh1

* Remove INITDIGINFO so that the data handle does not get cleared

%EXECCOMMAND=cmdret=[cmdh],[gdh1]

%FREEDIGINFO=[gdh1]

%label=nosmooth

* Initialising command:- Zoom Port

%INITCOMMAND=cmdh=4,6

%CLEARMODS=[cmdh]

* Setting modifier 'Extents'

%SETMODIFIER=[cmdh],8,1

%INITDIGINFO=gdh1

%EXECCOMMAND=cmdret=[cmdh],[gdh1]

%FREEDIGINFO=[gdh1]

157

EdgeCAM User Guide

background image

PCI - Command Macros

PCI is a parametric macro language that works directly on the EdgeCAM database.


Main Features

Save command sequences as ASCII text files. These can be replayed to recreate the same or similar
sequences of events.

Edit the PCI file to add functionality. Any EdgeCAM command may be called, with both predefined
modifier values and digitised information for that command.

Program flow, user input/output, entity selection, string manipulation and calculations are aided by a
set of high level directives.

Automatically generates comments during the command save. Further comments can be added at
any time.

Create, call, and delete user-defined variables.

Interactively define and use variables and user input dialogs with the command save facility. Complete
‘family of parts’ macros can be developed without further editing. Program flow control based on
conditional tests can be added by editing the PCI macro in any text editor.

PCI files can only be created and executed from within the Design and Manufacture modes. This includes
the ability to initialise the Code Generator and Tool Library and then return to the Manufacture mode to
continue a sequence.

PCI files usually work correctly on non-English language versions of EdgeCAM.

PCIs that initialise sequences select the discipline by position in the available list. Depending on your
licence configuration, this list can change. To avoid problems in this area, set the displine in the PCI to
“any|0” and allow the specified Code Generator to dictate the discipline.

Recording Active ToolStore Database Switches

Using Options Preferences

For a PCI that changes the active ToolStore database (and support files folder) you can record the
command Options menu Preferences Tool Libraries tab Database.

To make the PCI portable, so it could be used to set the same server instance and database names, delete
the computer name. For example changing from this:

%SetModifier=[cmd1],14,JohnSmithPC\ecsqlexpress\tstore

To this:

%SetModifier=[cmd1],14,\ecsqlexpress\tstore

Using PCI Set ToolStore

Recording Options Preferences produces a bulky PCI, with unwanted lines for setting other preferences.

For a smaller PCI, that only changes the database, record the command PCI Set ToolStore.

This command is not present on the User Interface as standard, so you will need to customise the User
Interface, adding a button for the command to a menu or toolbar of your choice. The command is in the
Options category.

This command also has the advantage of have a separate modifier for the parts of the SQL database
specification (computer name, server and instance), making it more suitable if variables need to be used.
Here is some example code:

* Initialising command:- PCI Set ToolStore

%InitCommand=cmd1=50,252

%ClearMods=[cmd1]

* Setting modifier 'Server'

%SetModifier=[cmd1],100,JohnSmith

* Setting modifier 'Instance'

%SetModifier=[cmd1],101,ecsqlexpress

* Setting modifier 'Database'

%SetModifier=[cmd1],102,tutorial

* Setting modifier 'Support files folder'

%SetModifier=[cmd1],103,c:\program files\edgecam\cam\tstore

%InitDigInfo=gdh1

%ExecCommand=cmdret=[cmd1],[gdh1]

%FreeDigInfo=[gdh1]

To make this PCI portable, so that it can be used on other machines (with the same instance and database
name) delete this line:

%SetModifier=[cmd1],100,JohnSmithPC

158

EdgeCAM User Guide


Document Outline


Wyszukiwarka

Podobne podstrony:
isa, pci i agp
BEZPRZEWODOWA KARTA SIECIOWA PCI N (NWD 310N) PL
datasheet pci 703
PCI
Spis wszystkich opcji BIOS-u, Wake On LAN or PCI Modem, Wake On LAN or PCI Modem
Oznaczenie pci i wieku, MYŚLISTWO STRZELECTWO, Kurs na Myśliwego, Inne
Psychologia pci i rodzaju - konwersatorium 0cc700d896b6267e45f4e1e4ce710a3c, Psychologia - studia, p
egzamin pci
PCI POSTcode display
Magistrala PCI
isCAN USB PCI UserManual
isa pci scsi 2, S
isa816 eisa pci DMA, Studia, WAT Informatyka 2, semestr IV, systemy wejścia-wyjścia
pci rev 2 1
PCI AGP monitors for 4CoreDual SATA2
isa, pci i agp
Premiere PCI LPX LP 4252

więcej podobnych podstron