Related data structures – Echelon Neuron C User Manual
Page 205
Neuron C Reference Guide
185
fb_properties
{
cpOffset,
// offset for each fblock
static cpGain,
// gain shared in MyFb1
global cpLocation // location shared in all 4
};
fblock SFPTopenLoopSensor {
nvoData[2] implements nvoValue;
} MyFb2[2]
fb_properties
{
cpOffset,
// offset for each fblock
static cpGain,
// gain shared in MyFb2
global cpLocation // location shared in all 4
};
Like network variable properties, functional block properties can be shared
between two or more functional blocks. The use of the global keyword creates a
CP family member that is shared among two or more functional blocks. This
global member is a
different
member than a global member that would be shared
among network variables, because no single configuration property can apply to
both network variables and functional blocks.
The use of the static keyword creates a CP family member that is shared among
all the members of a functional block array, but not with any other functional
blocks outside the array. See the discussion of functional block properties in the
Neuron C Programmer’s Guide
for more information on this topic.
Consequently, the example shown above instantiates four heartbeat
(SCPTminSndT) and four throttle (SCPTmaxSndT) CP family members (one pair
for each member of the nvoData network variable array), and four offset CP
family members (SCPToffset), one for each member of each fblock array. It also
instantiates a
total of two
gain control CP family members (SCPTgain), one for
MyFb1, and one for MyFb2. Finally, it instantiates a
single
location CP family
member (SCPTlocation), which is shared by MyFb1
and
MyFb2.
Just as for properties of network variables, you can treat a network variable
array that is a configuration property either as a collection of separate properties
where each element is a separate property, or as a single configuration property
that is an array. In the former case, specify the network variable name with an
array index representing the starting index for the element of the network
variable array that is to be the first property used. In the latter case, specify the
network variable name without an index to treat the entire network variable
array as a single property.
Related Data Structures
Each functional block is assigned a global index (from 0 to
n-1
) by the compiler.
In the case of an array of functional blocks, each element is assigned a
consecutive index (but because these indices are global, they do not necessarily
start at zero). An application can get the global index for a functional block using
the global_index property as described in
Accessing Members and Properties of a
Functional Block from a Program
on page 186.
If one or more functional blocks are declared in a Neuron C program, the
compiler creates an array of values that can be accessed from the program. This
array is named fblock_index_map, and it has one element per
network variable
in