Sharing of configuration properties, Sharing of configuration, Properties – Echelon Neuron C User Manual
Page 108
96
Using Configuration Properties to Configure Device Behavior
network output SNVT_amp nvoB
nv_properties { nciPwrUpDly[1] };
network output SNVT_count nvoC[2] = {100, 100}
nv_properties { nciPwrUpDly[2] };
Some configuration property types (for example, SCPTdefOutput) are
type-
inheriting
. This means that the SCPT definition does not, itself, specify the data
type for the configuration property. Instead, the configuration property's data
type is inherited from the network variable to which it applies. In this case, the
only explicit initialization that is permitted is in the instantiation in the property
list, not in the declaration. This situation is explained further in
on page 98.
Sharing of Configuration Properties
The typical instantiation of a configuration property is unique to a single device,
functional block, or network variable. For example, a CP family whose name
appears in the property list of five separate network variables has five
instantiations, and each instantiation is specific to a single network variable.
Similarly, a network variable array of five elements that includes the same CP
family name in its property list instantiates five members of the CP family, each
applying to one of the network variable array elements.
You can change the instantiation behavior using the static and global keywords.
The global keyword causes a single CP family member to be shared among all
network variables whose property list contains that CP family name. There can
only be one such global member in a CP family, and that member is shared
among all network variables that instantiate it in their property lists.
The same sharing considerations apply to configuration properties that apply to
functional blocks; see Chapter 5,
Using Functional Blocks to Implement a Device
, on page 101, for more information about functional blocks and
configuration properties, but note that a CP can only be shared among network
variables
or
functional blocks.
The static keyword causes a single CP family member to be shared among all
elements of a network variable array, but the sharing of the static member does
not extend outside of the array.
Example:
// CP for throttle (default 1 minute)
SCPTmaxSndT cp_family cpMaxSendT = { 0, 0, 1, 0, 0 };
// This family will have a total of 2 members
// NVs with shared throttle:
network output SNVT_lev_percent nvoValue1
nv_properties
{
global
cpMaxSendT
};
network output SNVT_lev_percent nvoValue2
nv_properties
{
global cpMaxSendT // The same as the one above
};
network output SNVT_lev_percent nvoValueArray[10]
nv_properties
{