Inheriting a configuration property type – Echelon LonTal Stack User Manual
Page 78
66
Creating a Model File
fblock SFPTopenLoopSensor {
nvoAmpere[0] implements nvoValue;
} fbAmpereMeter[NUM_PHASES] external_name("AmpereMeter")
fb_properties
{
cpGain,
static cpUpdateRate
};
Inheriting a Configuration Property Type
You can define a configuration property type that does not include a complete
type definition, but instead references the type definition of the network variable
to which it applies. A configuration property type that references another type is
called a type-inheriting configuration property. When the configuration property
family member for a type-inheriting configuration property appears in a property
list, the instantiation of the configuration property family member uses the type
of the network variable. Likewise, a configuration network variable can be
type-inheriting; however, for configuration network variable arrays and arrays of
configuration network variables, each element of the array must inherit the same
type.
Type-inheriting configuration properties that are listed in an nv_properties
clause inherit the type from the network variable to which they apply.
Type-inheriting configuration properties that are listed in an fb_property clause
inherit their type from the functional profile’s principal network variable
member, an attribute that is assigned to exactly one network variable member.
Recommendation: Because the type of a type-inheriting configuration property
is not known until instantiation, specify the configuration property initializer
option in the property list rather than in the declaration. Likewise, specify the
range-mod string in the property list because different range-mod strings can
apply to different instantiations of the property.
Restrictions:
• Type-inheriting configuration network variables that are also shared can
only be shared among network variables of identical type.
• A type-inheriting configuration property cannot be used as a device
property, because the device has no type from which to inherit.
A typical example of a type-inheriting configuration property is the
SCPTdefOutput configuration property type. Several functional profiles list the
SCPTdefOutput configuration property as an optional configuration property,
and use it to define the default value for the sensor's principal network variable.
The functional profile itself, however, might not define the type for the principal
network variable.
The following example implements a SFPTopenLoopSensor functional block
with an optional SCPTdefOutput configuration property. The configuration
property inherits the type from the network variable it applies to, SNVT_amp in
this case.
Example 1:
SCPTdefOutput cp_family cpDefaultOutput;
network output SNVT_amp nvoAmpere nv_properties {