The network variable initializer, The network variable property list – Echelon LonTal Stack User Manual

Page 182

Advertising
background image

170

Appendix C: Appendix C


Neuron C Syntax for the

Model File

The Network Variable Initializer

initial-value
or

initializer-list

Specifies an initial value (or values) for the network

variable. All network variables, especially input network
variables, should be initialized to a reasonable default

value.

The initial value should be chosen such that if a device is reset, the initial value
can be used for subsequent calculations prior to the variable’s being updated from

the network, and these calculations will not cause the device to create a

hazardous condition or to create an error condition. Initializers should not be
propagated over the network, regardless of whether the network variables are

declared input or output. See Network Variable and Configuration Property
Declarations
for more information about initializers.
Example:

network input SNVT_temp nv_temp = 2960;

// 23 C, 73.4 F

The Network Variable Property List

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.
The syntax for the nv-property-list specification is:

nv_properties { property-reference-list }
property-reference-list :

property-reference-list , property-reference

property-reference

property-reference :

property-identifier [ = initializer ] [ range-mod ]

property-identifier [ range-mod ] [ = initializer ]

range-mod :

range_mod_string ( concatenated-string-constant )

property-identifier :

[ property-modifier ] identifier [ constant-expression ]

[

property-modifier ] identifier

property-modifier :

static | global

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 and functional block property lists. 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 and functional block property list syntax.

Following the property-identifier, there can be an optional initializer, and an

optional range-mod.
You cannot have more than one configuration property of any given SCPT or
UCPT type that applies to the same network variable.

Advertising