Using dynamic device interfaces, Accessing a device interface – Echelon LNS User Manual

Page 193

Advertising
background image

LNS Programmer's Guide

179

break communication between the LNS Server and a remote Full client, the

NS#182

lcaErrNsInsufficientRtrsForNsi

exception will be thrown.

Using Dynamic Device Interfaces

As described in the Device Interfaces section in Chapter 6, each L

ON

W

ORKS

device

contains a device interface that represents the device’s functionality. The device interface
consists of network variables, configuration properties and LonMark Functional Blocks.

In LNS, network variables, configuration properties and LonMark Functional Blocks are
represented by NetworkVariable, ConfigProperty, and LonMarkObject objects.

The device interface as a whole is represented by the Interface object, which can be
accessed through the Interface property of the AppDevice object associated with the

device.

In some cases, there may be a need to modify the functionality provided by a device

interface. For example, some controller devices are used to control other devices. The
number of components required on a controller device’s interface is often an attribute of

the network configuration (i.e. how many devices it is controlling). Ideally, the resources

on these controllers could be allocated dynamically to fit the changing requirements of a
given network as devices are added to it. As a result, LNS Turbo Edition features

additional support for dynamic interface components, meaning that you can use LNS to

add custom interface components to devices that support dynamic interfaces. This section
describes how you can use those features.

Accessing a Device Interface

A device interface is represented by an

Interface

object. The

Interface

objects

contained by an application device include the device’s main interface, as well as custom
interfaces that have been added to the device dynamically. You can access the main
interface of a device through its Interface property. The main interface contains the

device interface installed with the device by its manufacturer, as well as all the network

variables and LonMark Functional Blocks defined in the custom interfaces that have

been added to the device. Main interfaces are static interfaces that cannot be modified
directly.

You can access and modify each of the custom interfaces that have been added to a device
through the device’s Interfaces property. Figure 8.4 shows the relationship between

the device’s main interface and its custom interfaces. Note that the network variables

and LonMark Functional Blocks included in the custom interfaces are also included in
the device’s main interface.

Advertising