Device property lists – Echelon Neuron C User Manual

Page 101

Advertising
background image

Neuron C Programmer’s Guide

89

identify the association between the configuration property and the object or

objects to which it applies.

Device Property Lists

A device property list declares instances of configuration properties defined by

CP family declarations and configuration network variable declarations that

apply to a device. See the

Neuron C Reference Guide

for the device-property

syntax.
Example:

SCPTlocation cp_family cpLocation;

device_properties {

cpLocation = { "Unknown" }

};

The device property list appears at file scope. This is the same level as a function
declaration, a task declaration, or a global data declaration. The device property

list begins with the device_properties keyword. It then contains a list of property
references, separated by commas. Each property reference must be the name of a

previously declared CP family or the name of a previously declared configuration

network variable. If the network variable is an array, a single array element can
be chosen as the device property, so an array index must be given as part of the

property reference in that case to identify the element. Alternatively, the entire

network variable array can be chosen as the device property, so no array index is
given in the property reference in that case.
Example of a CP network variable array element:

network input SCPTlocation cp cpLocation[5];

device_properties {

cpLocation[0] = { "Unknown" }

};

The example above implements a single device property of type SCPTlocation,
which is implemented by the first element of the configuration property network

variable array. The remaining four elements of that array are unused in the
above example.
In contrast, the following example illustrates the use of a configuration network

variable array as a single device property. The device property with internal
name cpOemType is a single-dimensional array of three elements, each of type

SCPToemType.
Example of entire CP network variable array as a single property:

network input SCPToemType cp cpOemType[3];

device_properties {

cpOemType = { "Label 1", "Label 2", "Label 3" }

};

Following the

property-identifier

, there can be an optional

initializer

, and an

optional

range-mod

. These elements are discussed in detail in the

Neuron C

Reference Guide

chapter on

Configuration Properties and Network Variables

.

Advertising