2 declaring variables in submodels, 3 naming variables – Micromod Micro-PWC: 53PW6000 MicroPWC Configuration Guide User Manual

Page 157

Advertising
background image

Micro-PWC CONFIGURATION GUIDE

Grafx Editor 137

Click on OK to complete the variable declaration and exit the window; click on Apply to complete the vari-
able declaration but leave the window open to declare additional variables. (In the parent Variables window
[

Figure 4-17

], click on Add or select an existing variable and click Edit; either of these actions will reset the

Declare Variables window and allow configuration of a new or existing variable.)

Once a variable is declared, it will appear in the list box in the Variables window (

Figure 4-17

). To change a

variable declaration, select the desired item on this list, then click on the Edit button. The Declare Vari-
ables
window containing that declaration's parameters will be displayed.

To see how many objects in a model have DynProps that reference a variable, select the variable by click-
ing on it in the list box, then click on the References button. The References window will appear, display-
ing the count of such objects.

To delete a variable, click on the appropriate entry in the list box to select it, then click on the Delete button.
A variable can be deleted only if it is not referenced by any object in the model; otherwise an error mes-
sage will appear.

4.3.3.2.2 Declaring Variables in Submodels

When declaring a variable in a graphic (described above), the public name of the variable must be the
name of a point in the global database (i.e., a tag.atom). This is not necessary when declaring a variable in
a submodel. Here, the public name can be a generic name. This allows the public name to be assigned to
a tag.atom or a constant each time an instance of the submodel is configured on a graphic.

No change is required to the DynProp; the following version remains a valid example:

( * ( stext _psetpoint "%.1f"))

The name _psetpoint would remain the private name for the variable, but the public name would now be
configured as some generic name such as setpoint instead of CON1.SP.

When an instance of this submodel is configured on a graphic (using the Configure Submodel item), set-
point will appear in the list of variables for the submodel. The user will assign the name of a tag.atom, or a
numeric constant, to the variable.

4.3.3.2.3 Naming Variables

The following naming conventions apply to variable names:

A variable name can be up to 60 characters in length.

The first character of a variable's name must be a letter.

Subsequent characters can be letters, numbers, or the underscore character. With few exceptions
(described below), no other characters should be used. The dash (-) is especially to be avoided, since that
character is interpreted as the subtraction operator.

Exceptions to the above naming conventions are:

The private name of a variable must begin with "_p".

Pairs of dollar sign ($) characters can be used in the public name of a variable in a submodel,

Note

Quotation marks should not be placed around the public name if the
model being configured is a submodel unless it is the name of a
tag.atom. When configuring dynamic objects on a submodel, the
type Submodel should be specified via the Model Type option on
the Edit menu before attempting to use the Model Variables menu
item. If this order is not followed, quotation marks will automatically
be placed around the public name and will cause an error.

Advertising