Network variable property lists – Echelon Neuron C User Manual

Page 102

Advertising
background image

90

Using Configuration Properties to Configure Device Behavior

A Neuron C program can have multiple device property lists. These lists are

merged together by the Neuron C compiler to create one combined device
property list. However, you cannot have more than one configuration property of

any given SCPT or UCPT type that applies to the device.
If two separate modules specify a particular configuration property of the same
type in the device property lists, this situation causes a compilation error.
Example of incorrect CP conflict:

UCPTsomeDeviceCp cp_family cpSomeDeviceCp;
SCPTlocation cp_family cpLocation;
SCPTlocation cp_family cpPlacement;

device_properties {
cpSomeDeviceCp,
cpLocation,

cpPlacement // Conflicts with cpLocation

};

Network Variable Property Lists

A network variable property list declares instances of configuration properties

defined by CP family declarations and configuration network variable

declarations that apply to a network variable. See the

Neuron C Reference Guide

for the configuration network variable’s property list syntax.
Example:

// CP for heartbeat and throttle (default 1 min each)
SCPTmaxSndT cp_family cpMaxSendT = { 0, 0, 1, 0, 0 };
SCPTminSndT cp_family cpMinSendT = { 0, 0, 1, 0, 0 };

// NV with heartbeat and throttle:
network output SNVT_lev_percent nvoValue
nv_properties

{

cpMaxSendT,

// override default for minSendT to 30 seconds:

cpMinSendT = { 0, 0, 0, 30, 0 }

};

The network variable property list begins with the nv_properties keyword. It
then contains a list of property references, separated by commas, exactly like the

device 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 device property list syntax

discussed above.
Following the

property-identifier

, there can be an optional

initializer

, and an

optional

range-mod

. These optional elements are discussed in more detail in the

Neuron C Reference Guide

.

You cannot have more than one configuration property of any given SCPT or

UCPT type that applies to the same network variable. A compilation error occurs

when a particular configuration property type is used for more than one property
in the network variable’s property list.
Unlike device properties, network variable properties can be shared between two

or more network variables. The use of the global keyword creates a CP family

Advertising