Echelon Neuron C User Manual
Page 99

Neuron C Programmer’s Guide
87
in the standard.typ file, which is part of the standard resource file set included
with the NodeBuilder tool. There can be many similar resource files containing
UCPT definitions, and these are managed by the NodeBuilder Resource Editor as
described in the
NodeBuilder User’s Guide
.
A configuration property type is similar to an ANSI C typedef, but it is also much
more. The configuration property type also defines standardized semantics for
the type. The configuration property definition in a resource file contains
information about the default value, minimum and maximum valid values, a
designated (optional) invalid value, and language string references that permit
localized descriptive information, additional comments, and units strings to be
associated with the configuration property type.
The
cp-modifiers
begin with the cp_info keyword followed by a parenthesized list
of option keywords. The keywords and their meanings are discussed in the
Configuration Property and Network Variable Declarations
chapter of the
Neuron C Reference Guide
.
If the declaration of the CP family contains an
array-bound
expression following
the family identifier name, each member of the CP family is declared to be a
separate array. For example, a family can consist of three members: an array
property for some network variable
A
, another array property for another
network variable
B
, and a third array property for a functional block
C
.
Example:
SCPTgain cp_family cpGain[3] = { { 2, 3 },
{ 1, 5 },
{ 2, 1 }
};
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.
The initialization rules for a CP family member are shown below. The
initialization rules are used to set the initial value that is to be loaded in the
value file from the linked image, as well as the value file stored in the device
interface file. A network tool can use the initial value as a
default value
, and
might, at times, reset the configuration properties (or a subset of them) back to
the default values. Consult the documentation of the particular network tool, for
example, the
LonMaker User's Guide
, for more information on the tool’s use of
configuration property default values.
In the initialization rules that follow, the compiler uses the first rule that applies
to the configuration property.
1
If the configuration property is initialized explicitly in its instantiation,
then this is the initial value that is used.
2
If the configuration property is initialized explicitly in the CP family
declaration, then the family initializer is used.
3
If the configuration property applies to a functional block, and the
functional profile that defines the functional block specifies a default
value for the associated configuration property member, then the
functional profile default is used.