Configuration property declarations – Echelon Neuron C User Manual

Page 190

Advertising
background image

170

Network Variable, Configuration Property, and Message Tag Declarations

Configuration Property Declarations

You can implement a configuration property as a configuration network variable

or as part of a configuration file. To implement a configuration property as a
configuration network variable, declare it using the network … config_prop

syntax described in

Network Variable Declarations Syntax

on page 161. To

implement a configuration property as a part of a configuration file, declare it
with the cp_family syntax described in this section.
The syntax for declaring a configuration property family implemented as part of

a configuration file is the following:

[const]

type

cp_family [

cp-modifiers

]

identifier

[[

array-bound

]] [=

initial-value

] ;

The brackets around

array-bound

are shown in bold type. The brackets do not, in

this case, indicate an optional field. They are a required part of the syntax of

declaring an array, and must be entered into the program code.

Example 1 – Declaring a CP family for a singular CP:

SCPTlocation cp_family cpLocation = "";

Example 2 – Declaring a CP family for a CP-array:

SCPTbrightness cp_family cpBrightness[3];

Example 3 – Declaring a CP family for CP-array with explicit initial values:

SCPTbrightness cp_family cpBrightness[3] = {

{ 0, ST_OFF },

{ 100u, ST_ON },

{ 200u, ST_ON }

};

Any number of CP families can be declared in a Neuron C program. Declarations
of CP families do not result in any data memory being used until a family

member is created through the instantiation process. In this regard, the CP

family is similar to an ANSI C typedef, but it is more than just a type definition.

A configuration property type is also similar to an ANSI C typedef, but it is also

much more. The configuration property type also defines a standardized

semantic meaning for the type. The configuration property definition in a
resource file contains information about the default value, minimum and

maximum valid values, a designated (optional) invalid value, and language string
references that permit localized descriptive information, additional comments,

and units strings to be associated with the configuration property type.
CP families that are declared using the const keyword have their family members
placed in the read-only value file. All other CP families have their family

members placed in the

writeable

value file (this file is also called the

modifiable

value file).

The

type

for a CP family cannot be just a standard C type such as int or char.

Instead, the declaration must use a configuration property type from a resource

file. The configuration property type can either be a standard configuration
property type (SCPT) or a user configuration property type (UCPT). There are

over 300 SCPT definitions available today, and you can create your own

manufacturer-specific types using UCPTs. The SCPT definitions are stored in
the standard.typ file, which is part of the standard resource file set included with

Advertising