Echelon LNS User Manual

Page 119

Advertising
background image

LNS Programmer's Guide

105

• A device interface file may include information that is not included in the device

itself, such as network variable names.

• A device interface file can be used even when the device cannot be accessed by

the network engineering tool, such as during the definition phase of an

engineered mode installation.

• Importing from a device interface file may be substantially faster than recovering

interface information from a device.

• Importing from a device interface file allows LNS to accurately set the default

values for network variable characteristics such as message service type and

priority. If you recover the interface from the device, LNS will use the current

values in the first device with that program as the defaults.

• Importing from a device interface file ensures that configuration property

definitions and default values for the device are available to LNS. After
recovering an interface from a device, it is necessary to upload the configuration

definitions from the device, after the device has been commissioned and the
device application is running. Default values can be set to the current values in

the device.

The primary device interface file type is a text file with a .XIF extension. Some platforms

convert this file to alternate formats for performance optimization. For example, LNS

uses a binary device interface file (.XFB extension), and a device interface object file
(.XFO extension). Both of these files are created from the data contained within the text

device interface file. The device interface files (.XIF and .XFB file extensions) are

supplied by the device manufacturer. The optimized interface file (.XFO extension) is
automatically created and maintained by LNS when the device interface files are

imported. Note that some manufacturers supply the .XFO file with the device, which

allows for more efficient importation of the device interface.

When you add a device to an LNS network database, you must create a
DeviceTemplate object within the database to represent the device’s interface. You can

create the DeviceTemplate object by querying the desired device’s external interface

over the L

ON

W

ORKS

network, or by reading the device interface files. To read a device

interface file into a DeviceTemplate object, follow these steps:

1. Initialize the LNS Object Server and open the network and system you plan to install

your devices on. These tasks are described in Chapter 4, Programming an LNS

Application.

2. Access

the

System object’s DeviceTemplates collection. You can access the

DeviceTemplates collection through the System object’s TemplateLibrary object.

Dim MyTemplateLibrary as LcaTemplateLibrary

Dim MyDeviceTemplates as LcaDeviceTemplates

Set MyTemplateLibrary = MySystem.TemplateLibrary

Set MyDeviceTemplates = MyTemplateLibrary.DeviceTemplates

3. Call

the

DeviceTemplates collection’s Add() method to create a new

DeviceTemplate object. The programType parameter you supply to the Add
method must be set to lcaProgramTypeXif.

Dim MyTemplate as LcaDeviceTemplate

Set MyTemplate = MyDeviceTemplates.Add (“T1”, lcaProgramTypeXif)

Advertising