Network variable declarations syntax, Network variable modifiers (netvar-modifier) – Echelon Neuron C User Manual

Page 181

Advertising
background image

Neuron C Reference Guide

161

Network Variable Declarations Syntax

The complete syntax for declaring a network variable is one of the following:

network input | output [

netvar-modifier

]

[

class

]

type

[

connection-info

] [config_prop [

cp-modifiers

]]

identifier

[=

initial-value

] [

nv-property-list

] ;

network input | output [

netvar-modifier

]

[

class

]

type

[

connection-info

] [config_prop [

cp-modifiers

]]

identifier

[

array-bound

] [=

initializer-list

] [

nv-property-list

] ;

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.

The maximum number of network variables available to a device depends on the

target chip type, firmware version, and the device development platform used.

For all chips, firmware, and development platforms, each element of a network
variable array counts as a separate network variable relative to the maximum

number and configuration network variables count towards that maximum

number.

Network Variable Modifiers (netvar-modifier)

One or more of the following optional modifiers can be included in the declaration

of each network variable:
sync | synchronized

Specifies that all values assigned to this network variable
must be propagated, and in their original order. Mutually

exclusive with the polled modifier.

polled

Specifies that the value of the output network variable is
to be sent

only

in response to a poll request from a device

that reads this network variable. When this keyword is
omitted, the value is propagated over the network every

time the variable is assigned a value and also when

polled. Mutually exclusive with the sync modifier.

Normally only used for output network variables. Can be

used with input network variables in model files.

changeable_type

Specifies that the network variable type can be changed
at runtime. If either the sync or polled keyword is used

(these two keywords are mutually exclusive) along with

the changeable_type keyword, then the changeable_type
keyword must follow the other keyword. For more

information on changeable type network variables, see

Changeable Type Network Variables

in

How Devices

Communicate Using Network Variables

in the

Neuron C

Programmer’s Guide

.

The changeable_type keyword requires the program ID to

be specified, and requires the Changeable Interface flag to

be set in that program ID. A compilation error occurs
otherwise.

Advertising