Defining a changeable-type network variable, 30 for more – Echelon FTXL User Manual
Page 42
![background image](/manuals/735717/42/background.png)
30
Creating a Model File
The FTXL application in a device does not need to know anything about where
input network variables come from or where output network variables go. After
the FTXL application updates a value for an output network variable, it uses a
simple API function call to have the FTXL LonTalk protocol stack propagate it.
Through a process called
binding
that takes place during network design and
installation, the FTXL stack is configured to know the logical address of the other
devices (or groups of devices) in the network that expect a specific network
variable, and the FTXL stack assembles and sends the appropriate packets to
these devices. Similarly, when the FTXL 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.