Adding a custom interface to a device – Echelon LNS User Manual

Page 195

Advertising
background image

LNS Programmer's Guide

181

Property Description

MaxNVSupported

This property specifies the maximum number of

network variables (static or dynamic) that the
Interface object can contain.

MessageTags

This property contains the Interface object’s

collection of static MessageTag objects (i.e. the

message tags originally included in the interface).

NetworkVariables

This property contains the Interface object’s
NetworkVariables collection (i.e. the network

variables included in the interface).

StaticNVCount

This property indicates the number of static
network variables on the Interface object.

SupportDynamicNVsOnStaticLMOs

This property indicates whether static
LonMarkObject objects on the device’s interfaces

support the addition of dynamic network variables.

You can use LNS to add custom interfaces to devices that support dynamic interfaces
using the Interfaces property. And depending on what other types of dynamic objects

it supports, you can also modify its interfaces by adding or removing objects from its
NetworkVariables, LonMarkObjects, and MessageTags collections, as described in

the following sections.

Adding a Custom Interface to a Device

You can create custom interfaces on any device that supports dynamic network variables,

dynamic message tags, or dynamic LonMark Functional Blocks. To create a custom

interface on a device, follow these steps:

1. Access the device’s collection of custom interfaces.

Dim MyInterfaces as LcaInterfaces
Set MyInterfaces = MyAppDevice.Interfaces

2. Call

Add()

to add a new custom interface to the device. Specify the name

of the interface by filling in the

interfaceName

element. The name of

each custom

Interface

on a device must be unique. If you specify a

name that is already being used on the device containing this collection,
the

LCA:#3 lcaErrDuplicateKey

exception will be thrown.

Dim MyNewInt as LcaInterface
Set MyNewInt = MyInterfaces.Add(“NewInt”, NOTHING)

NOTE: You can specify an existing Interface object as the
sourceInterfaceObj element. If you do so, the new Interface object

will be created with the same NetworkVariables collection as the
Interface referenced as the sourceInterfaceObj. If the
sourceInterfaceObj is

NOTHING

, as in this example, an empty

Interface object will be created.

3. You can now add dynamic network variables, LonMark Functional Blocks

Advertising