Define <enum> elements – Echelon LonBridg Server User Manual

Page 59

Advertising
background image

LonBridge Server User’s Guide

53

</nv>

The definition still lacks the network variable indices for the nviValue and

nvoValueFb network variables; see

Browse the XIF File to Determine Indices

on

page 56 to determine the indices.
The next step is to define the enumerations for the

state

network variables.

Define <enum> Elements

The

state

network variables are structured network variables, and the example

LonBridge application for the simplified Lamp Module requires access to the

fields within these network variables. Thus, the <attribute> definition for each

<nv> element includes enum=”true” and a pair of <enum> elements. Each
<enum> element defines one state, “on” or “off”, and maps these values to the

network variable field enumeration values.
Thus, the <nv> elements for the

state

attribute within the device class file

includes the following information:

<nv index="?" direction="input" size="3">
<byte index="0" length="1">
<attribute name="state" enum="true">
<enum input="off" output="?" />
<enum input="on" output="?" />
</attribute>
</byte>
<byte index="1" length="1">
<attribute name="state" enum="true">
<enum input="off" output="?" />
<enum input="on" output="?" />
</attribute>
</byte>
</nv>
<nv index="?" direction="output">
<byte index="0">
<attribute name="state" enum="true" scale="100">
<enum input="?" output="off" />
<enum input="?" output="on" />
</attribute>
</byte>
</nv>

The enumeration values are marked with a question mark (?). Also, for the input

network variable, the unknown values are the output values because the

LonBridge application uses the logical names; for the output network variable,
the unknown values are the input values.
To determine the enumeration values for the “on” and “off” states, return to the
Resource Editor, and expand the entry for Enumerations, as shown in Figure 8

on page 54.

Advertising