Inheriting a configuration property type – Echelon FTXL User Manual
Page 50
![background image](/manuals/735717/50/background.png)
38
Creating a Model File
Example 2:
The following model file defines a three-phase ammeter, implemented with an
array of three SFPTopenLoopSensor functional blocks. The hardware for this
device contains a separate sensor for each phase, but a common analog-to-digital
converter for all three phases. Each phase has individual gain factors, but shares
one property to specify the sample rate for all three phases.
#define NUM_PHASES
3
SCPTgain cp_family cpGain;
SCPTupdateRate cp_family cpUpdateRate;
network output SNVT_amp nvoAmpere[NUM_PHASES];
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 property network variable can
be type-inheriting; however, for configuration network variable arrays and arrays
of configuration network variables (CPNVs), 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, you should specify the configuration property
initializer option in the property list rather than in the declaration. Likewise,
you should 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