Echelon Neuron C User Manual

Page 106

Advertising
background image

94

Using Configuration Properties to Configure Device Behavior

scenario, where part of the configuration property network variable array is used

for one array of output network variables, and the other is used for another array
of output network variables. Although this case shows all members of the

cpMaxSendTime array being used, that is not a requirement.
Example of an array split between different property clauses:

network input cp SCPTmaxSendTime cpMaxSendTime[7];

network output SNVT_volt nvoVolt1[4]

nv_properties { cpMaxSendTime[3] };


network output SNVT_vold nvoVolt2[3]

nv_properties { cpMaxSendTime[0] };

The examples above focused on applying single configuration properties to arrays
of network variables. However, a second case exists where the configuration

property itself is an entire array, rather than an element, as shown below.
Example of CP family array applying to network variable array:

UCPTeventData cp_family cpEventData[100];

network output SNVT_volt nvoVolt[4]

nv_properties { cpEventData };

This example implements four output network variables nvoVolt[0]..nvoVolt[3].

Each of these four network variables implements a cpEventData configuration
property, which itself is an array of 100 elements. Each array element is of the

hypothetical type UCPTeventData.
A similar construct cannot be achieved with configuration network variables,
however, because of a crucial difference in the two configuration property

implementation techniques. That difference is, as discussed earlier, that the
declaration of a cp_family alone does not create any configuration properties,

whereas configuration network variable declaration actually creates the

(configuration) network variable. Consider the following, incorrect, example for
illustration:
Example of CP-NV array applying to network variable array:

network input UCPTeventData cp cpEventData[10];

network output SNVT_volt nvoVolt[4]

nv_properties {

// causes compilation error:
cpEventData
};

This last example does not compile. Because a configuration network variable

declaration actually creates the (configuration) network variable, the compiler
cannot multiply the number of configuration network variables by four as

required to implement one configuration property array for each of the network

variable elements in the array nvoVolt.

Consequently, a configuration property network variable array that applies to an

array of network variables (or functional blocks) must be shared using either the

static keyword or the global keyword. See

Sharing of Configuration Properties

on

page 96 for more information on these keywords.

Advertising