Echelon Neuron C User Manual

Page 204

Advertising
background image

184

Functional Block Declarations

The functional block property list begins with the fb_properties keyword. It then

contains a list of property references, separated by commas, exactly like the
device property list and the network variable property list. Each property

reference must be the name of a previously declared CP family or the name of a

previously declared configuration network variable. The rest of the syntax is
very similar to the network variable property list syntax discussed in the

previous chapter.

Following the

property-identifier

, there can be an optional

initializer

, and an

optional

range-mod

. These optional elements can occur in either order if both are

specified. If present, the instantiation initializer for a CP family member
overrides any initializer provided at the time of declaration of the family; thus,

using this mechanism, some CP family members can be initialized specially, with

the remaining family members having a more generic initial value. If a network
variable is initialized in multiple places (in other words, in its declaration as well

as in its use in a property list), the initializations must match.
Each property instantiation can have a range-modification string following the
property identifier. The range-modification string works identically to the

range-

mod

described in

Configuration Property Modifiers (cp-modifiers)

on page 171. A

range-modification string provided in the instantiation of a CP family member
overrides any range modification string provided in the declaration of the CP

family.

The elements of an fblock array all share the same set of configuration properties

as listed in the associated

fb-property-list

. Without special keywords, each

element of the fblock array obtains its own set of configuration properties.
Special modifiers can be used to

share

individual properties among members of

the same fblock array (through use of the static keyword), or among all the

functional blocks on the device that have the particular property (through use of
the global keyword).
Example:

// CP Family Declarations:
SCPTgain cp_family cpGain;
SCPTlocation cp_family cpLocation;
SCPToffset cp_family cpOffset;
SCPTmaxSndT cp_family cpMaxSendT;
SCPTminSndT cp_family cpMinSendT;

// NV Declarations:
network output SNVT_lev_percent nvoData[4]
nv_properties

{

cpMaxSendT, // throttle interval

cpMinSendT // heartbeat interval

};

// four open loop sensors, implemented as two arrays of
// two sensors, each. This might be beneficial in that
// this software layout might meet the hardware design
// best, for example with regards to shared and individual
// properties.

fblock SFPTopenLoopSensor {

nvoData[0] implements nvoValue;

} MyFb1[2]

Advertising