Echelon Neuron C User Manual

Page 105

Advertising
background image

Neuron C Programmer’s Guide

93

network output SNVT_volt nvoVoltage[4];

Now, suppose that we want to provide a SCPTmaxSendTime configuration

property for each sensor output that is used to configure the maximum amount of
time (in seconds) between consecutive updates of the output network variable. If

we use a configuration property family, we can use the following declarations.

When using a configuration property in this manner, the Neuron C compiler
automatically creates a distinct family member for each element of the network

variable array.
Example with a CP family property:

SCPTmaxSendTime cp_family cpMaxSendTime;

network output SNVT_volt nvoVoltage[4]

nv_properties { cpMaxSendTime };

Another approach is to use a separate network variable array for the

SCPTmaxSendTime configuration properties. For example, the network variable
array declaration shown below provides four elements in the cpMaxSendTime

array, each of them a configuration property corresponding to the respective

element in the nvoVoltage array.

Example with a network variable property:

network input cp SCPTmaxSendTime cpMaxSendTime[4];

network output SNVT_volt nvoVoltage[4]

nv_properties { cpMaxSendTime[0] };

When using a distributed array of network variables for the configuration
properties as shown in the example above, the configuration property reference in

the nv_properties clause must contain an index. This index is used by the

compiler as a

starting index

; the compiler automatically assigns the subsequent

elements of the configuration property network variable array to the elements of

the underlying network variable array to which the property applies.
The compiler also checks for existence of a sufficient number of elements. The
following declarations would give errors:
Example of insufficient array size:

network input cp SCPTmaxSendTime cpMaxSendTime[3];
//

Insufficient

#

of

elements


network output SNVT_volt nvoVoltage[4]

nv_properties { cpMaxSendTime[0] };

Example of insufficient array elements in reference:

network input cp SCPTmaxSendTime cpMaxSendTime[4];

network output SNVT_volt nvoVoltage[4]

nv_properties {

cpMaxSendTime[1] // insufficient members left
};

The index of the configuration property reference in the nv_properties clause is a

starting

index. This index need not be zero. For example if there were two

network variable arrays named nvoVolt1 and nvoVolt2, and each were to have a
SCPTmaxSendTime property, the following declarations could accomplish this

Advertising