Defining a changeable type network variable, Defining a changeable-type network variable – Echelon LonTal Stack User Manual

Page 70

Advertising
background image

58

Creating a Model File

other devices (or groups of devices) in the network that expect a specific network

variable, and the LonTalk Stack assembles and sends the appropriate packets to
these devices. Similarly, when the LonTalk Stack receives an updated value for

an input network variable required by its application program, it reads the data

from the network and passes the data to the application program.

The binding process creates logical connections between an output network

variable in one device and an input network variable in another device or group
of devices. You can think of these connections as “virtual wires.” For example,

the dimmer-switch device in the dimmer-switch-light example above could be

replaced with an occupancy sensor, without requiring any changes to the lighting
device.
Network variable processing is transparent, and typical networked applications

do not need to know whether a local network variable is bound (“connected”) to
one or more network variables on the same device, to one or more other devices,

or not bound at all. For those applications that do require such knowledge, API

functions (such as LonQueryNvConfig(), LonQueryAliasConfig(),
LonNvIsBound(), and LonMtIsBound()) are supplied to query the related

information.

Defining a Changeable-Type Network
Variable

A changeable-type network variable is a network variable that supports

installation-time changes to its type and its size.
You can use a changeable-type network variable to implement a generic
functional block that works with different types of inputs and outputs. Typically,

an integrator uses a network management tool plug-in that you create to change

network variable types.

For example, you can create a general-purpose device that can be used with a

variety of sensors or actuators, and then create a functional block that allows the

integrator to select the network variable type depending on the physical sensor or
actuator that is attached to the device during installation.
Restrictions:

• Each changeable-type network variable must be declared with an initial

type in the model file. This initial type defines the default type and the
maximum size of the network variable.

• A changeable-type network variable must be a member of a functional

block.

• Only network variables that are not bound can change their type. To

change the type of a bound network variable, you must first unbind
(disconnect) the network variable.

• Only a network management tool, such as OpenLNS Commission Tool,

can change the type of a changeable-type network variable. The LonTalk

Stack device does not initiate type changes.

To create a changeable-type network variable for a LonTalk Stack application,
perform the following tasks:

Advertising