Configuring lonmark functional blocks, Adding message tags to a custom interface – Echelon LNS User Manual

Page 197

Advertising
background image

LNS Programmer's Guide

183

Configuring LonMark Functional Blocks

You can assign existing dynamic network variables to dynamic LonMark Functional

Blocks using the

AssignNetworkVariable()

method, and you can unassign them

using the

UnassignNetworkVariable()

method. Alternatively, you can create new

network variables that will be automatically assigned to the network interface using the
procedure described in the Creating Dynamic Network Variables section on page 184.

This may be useful when working with sophisticated generic controller devices. Consider

the case of a generic device that controls an entire home. As features such as a new set of

lighting scene controllers are added to the home, related LonMark Functional Blocks or
network variables can be added to the generic home controller device as needed.

You can also move a dynamic

LonMarkObject

from one custom interface on a device to

another using the

MoveToInterface()

method.

Adding Message Tags To a Custom Interface

As of LNS Turbo Edition, you can add dynamic message tags to any device that supports

monitor sets, and use those message tags in conjunction with message monitor points to

send explicit messages from that device to a group of devices, as with static message
tags.

For example, consider the case of a Network Service Device. Network Service Devices do

not contain static message tags. However, you can add dynamic message tags to the
AppDevice object that represents a NetworkServiceDevice. Once you have done so,

you could connect the message tag to the devices you want to send messages to.
Following that, you could create a permanent message monitor point on the Network

Service Device that specifies the new dynamic message tag as its monitor target
(targetDevice element). You could then open the monitor set, and use the message

monitor point to send messages to the devices connected to the message tag. The

advantage of this approach, as opposed to creating message monitor points for each
device, is that a single message can be sent to all devices using group or broadcast

addressing, as determined by the connection description used to create the connection.

For more details on how to accomplish these tasks, see Adding Message Monitor Points to
a Monitor Set
on page 197.

Not all Interface objects support dynamic message tags. If you attempt to add a

message tag to a message tag collection on a main interface, or a custom interface on a
device that does not support dynamic message tags, the LCA#119
lcaErrInterfaceNotModifyable exception will be thrown.

To add a dynamic message tag to a device, follow these steps:

1. Access the custom interface on the device that you want to add the

message tag to. If necessary, create a new custom interface, as described

in Adding a Custom Interface to a Device on page 181.

2. Access the custom interface’s DynamicMessageTags collection.

Dim MyMessageTags as LcaMessageTags
Set MyMessageTags = MyInterface.DynamicMessageTags

3. Call

the

Add() method to add a new message tag to the collection.

Dim MyNewTag as LcaMessageTag

Advertising