Global Substitutions

 

Global substitutions provide a mechanism to use (i.e. substitute) pre-defined, constant values globally throughout a project.  A global value can be substituted within any module at any level in the project hierarchy, and is normally done so via component input parameters.

 

Global substitutions are similar to substitutions used within component definitions, in that they are simply a text string, which represents a literal value (or another string).  Once defined, the text string (or key) can be inserted into any component input parameter; its value will be substituted by the PSCAD compiler when the project is built.

 

The syntax for using a defined global substitution is as follows:

 

$(<Key>)

 

The substitution contains an item <Key>, where:

Component input parameters containing global substitutions will be pre-processed before their value is used within the component code (or canvas if a module).  To the component, the input parameter appears exactly as if the user entered the data directly.

Viewing Defined Global Substitutions

In the workspace window, right-click on a project and select Global Substitutions | Edit Values... (or simply press Ctrl + g on your keyboard), to bring up the Global Substitutions dialog window.

 

 

Existing global substitution values may be modified directly from the dialog.  For example, say two substitutions to represent system frequency and transmission line length (called f and length) already exist.  A user wants to set the system frequency globally as 50 Hz, and the transmission line length globally as 100 km in a project.   This can be modified as follows in the global substitutions dialog:

 

Adding/Editing Global Substitutions

Global substitutions are handled in a very similar manner as component input parameters, in that they are defined as ‘parameters’ of the Main page.  As such, the user can add new, and edit existing global substitutions by using the parameter editor for the Main module definition (i.e. the Parameters section).

 

To add or edit a global substitution, right-click on a project and select Global Substitutions | Add or Modify Items....  This will simply open the Main module parameters section.  

 

For more details on adding and editing input parameters, see The Parameters Section in Chapter 9 – Component Design.

Utilizing Global Substitutions

To utilize these substitutions, enter either of the keys in the appropriate component input parameter field, according to the syntax given above:

 

Entering f in Single-Phase Transformer Parameters Dialog

Entering length in Transmission Line Configuration Dialog