Define <nv> elements – Echelon LonBridg Server User Manual

Page 52

Advertising
background image

46

LonBridge Device Class File


network output polled SNVT_power nvoPower
nv_properties {
cpPwrSendOnDelta
};

The first network variable, nviValue, defines the input state for the simplified

Lamp Module, which the LonBridge application uses to set the lamp’s state. The

second network variable, nvoValueFb, defines the output state for the simplified
Lamp Module, which the lamp uses to report its current state to the LonBridge

application and to the network. And the third network variable, nvoPower,

defines the output power usage for the device, which the lamp uses to report its
power usage to the LonBridge application and to the network.
The next step is to define the network variables within the device class file, that

is, to translate the Neuron C declarations for the network variables into the XML
elements required by the device class file.

Define <nv> Elements

There are two sections within the device class file that define the network
variables (within <nvs> elements). The first section appears within the

<attributes> element:

<attributes>
<attribute name="state">
<nvs>
<nv index="?" direction="input" />
<nv index="?" direction="output" />
</nvs>
</attribute>
<attribute name="power">
<nvs>
<nv index="?" direction="output" />
</nvs>
</attribute>
</attributes>

The

state

attribute matches two network variables, an input network variable

and an output network variable. Thus, the <nvs> element contains two <nv>

elements, one with direction=”input” and the other with direction=”output”. At
this point, however, the network variable indices are unknown, so they are

marked with a question mark (?).
The

power

attribute matches one network variable. Thus, the <nvs> element

contains one <nv> element, with direction=”output”. The network variable index

is unknown, so it is marked with a question mark (?).

See

Browse the XIF File to Determine Indices

on page 56 to determine the

network variable indices.
The other section that defines network variables within the device class file is the
<nvs> element that is not within the <attributes> element. This section defines

the specific attributes of each network variable:

<nvs>
<nv index="?" direction="input" size="?">
<byte index="?" length="?">
<attribute name="state" enum="true">

Advertising