Configuration property modifiers (cp-modifiers) – Echelon Neuron C User Manual

Page 191

Advertising
background image

Neuron C Reference Guide

171

the NodeBuilder tool. There could be many similar resource files containing

UCPT definitions, and these are managed on the computer by the NodeBuilder
Resource Editor as described in the

NodeBuilder FX User’s Guide

.

A configuration property family can be declared with an optional

array-bound

.

This declares the family such that

each

member of the configuration property

family is a separate array (of identical size). Each instantiation of a member of

the configuration property family becomes a separate array. All elements of the
array are part of the

single

configuration property that instantiates a member of

such a family.
The

initial-value

in the declaration of a CP family is optional. If

initial-value

is

not provided in the declaration, the default value specified by the resource file is

used. The

initial-value

given is an initial value for a

single

member of the family,

but the compiler

replicates

the initial value for

each

instantiated family member.

For more information about CP families and instantiated members, see the

discussion in Chapter 4,

Using Configuration Properties to Configure Device

Behavior,

of the

Neuron C Programmer’s Guide

.

The cp_family declaration is repeatable. The declaration can be repeated two or

more times, and, as long as the duplicated declarations match in every regard,

the compiler treats these as a single declaration.

Example 1 – Repeated family declaration:

SCPTbrightness cp_family cpBrightness;
SCPTbrightness cp_family cpBrightness;

In Example 1, the compiler treats the two families as one. One of the two

declarations can be omitted. Note the CP family declaration is similar to a C

language typedef in that no memory is allocated; the repeated declaration simply
has no effect.
Example 2 – Repeated family declaration:

SCPTbrightness cp_family cpBrightness;
SCPTbrightness cp_family cpDarkness;

In Example 2, the compiler treats the two families as two distinct families,
because of the different family names.
Example 3 – Invalid re-use of family name:

SCPTbrightness cp_family cpBrightness = {100, ST_ON};
SCPTbrightness cp_family cpBrightness = {0, ST_OFF};

The declaration in Example 3 causes a compile-time error, because of the fact

that the two families have different properties (the default value) yet are
declared using the same family name.

Configuration Property Modifiers (cp-modifiers)

The configuration property modifiers are an optional part of the CP family

declaration discussed above, as well as the configuration network variable
declaration discussed later.
The syntax for the configuration property modifiers is shown below:

cp-modifiers

:

[ cp_info (

cp-option-list

) ] [

range-mod

]

Advertising