Neuron id assignment, Service pin – Echelon LNS User Manual

Page 129

Advertising
background image

LNS Programmer's Guide

115

4. You should note that devices can be installed in multiple subsystems. You can use

the AddReference() method to create a reference to a device that has already been

added to another subsystem.

Set MyAppDevice = OtherSubsystemAppDevices.Item(“Device 1”)

Set MyAppDevices = MySubsystem.AppDevices

MyAppDevices.AddReference (MyAppDevice)

If a device has been added to AppDevices collections in multiple subsystems in this

fashion, you will need to call the Remove() or RemoveEx() method on each

collection containing the device when you want to remove the device from the

network. This does not apply to the ALL or Discovered subsystems. You can use the
AppDevice object’s Subsystems property to see which subsystems the AppDevice

belongs to. For more information on removing devices, see Removing Devices on page
137.

Neuron ID Assignment

Every L

ON

W

ORKS

device is assigned a unique Neuron ID when it is manufactured. The

Neuron ID differentiates the device from all the other L

ON

W

ORKS

devices in the world,

and LNS uses Neuron IDs to uniquely identify the devices on a network. There are three

ways to acquire a device’s Neuron ID, and write it to the LNS database:

Service Pin

Find and Wink

Manual Entry

Service Pin

Each device has a service pin. When a device’s service pin is activated, the device sends a

broadcast message containing its Neuron ID and program ID. The method used to

activate the service pin varies from device to device. Examples of mechanical methods

include activating via a push button, or using a magnetic reed switch. A Neuron C
function allows the service pin to be placed under software control as long as the device’s

application code is running. For example, a device can send a service pin message when

it is moved, or when a predefined series of I/O events occur.

You can program your LNS application to receive service pin messages from devices on your

network, and determine the Neuron IDs assigned to those devices from those messages. To
do so, follow these steps:

1. Invoke

the

System object’s BeginServicePinEvent() method to register your

application for service pin events.

MySystem.BeginServicePinEvent()

2. When the LNS Object Server receives a service pin message, the OnSystemServicePin

event will be fired. The parameters provided with this event include the Neuron ID,

program ID, location, channel handle, network handle, and system handle for the device
whose service pin was activated.

Advertising