Detecting existing plug-ins – Echelon LNS User Manual

Page 296

Advertising
background image

LNS Programmer's Guide

282

This will release the reference to the plug-in, and will therefore stop the director from
accessing the plug-in application’s properties and methods through the MyPlugIn

variable. However, releasing the reference will not terminate the plug-in itself. The LNS

Plug-In Programmer’s Guide contains a section called How Plug-Ins Know When To Exit
that addresses the plug-in lifetime considerations for the plug-in developer.

The director application is free to hold on to the reference. This will allow you to speed up

processing during the network commissioning phase, as plug-ins that are invisible but

attached do not need be re-loaded into memory. Therefore, the director can provide a very

responsive user-interface.

However, Echelon recommends that you release plug-in references using a timer-

controlled scheme to avoid blocking system resources with plug-ins. For example, the
director application could automatically release references to a plug-in 15 minutes after

the last use of that plug-in, and restart the timer each time the user demands the
services of that plug-in.

A complete example implementation of the client-side plug-in API is contained in the

example director application described in Appendix C of this document. The related
source code can be found in the Launch() method that is contained in the cCommand

class.

Detecting Existing Plug-Ins

Before you can use a plug-in to perform its prime service such as configuring a particular

implementation of a device, the plug-in must be fully registered within the Windows

operating system, and the LNS system. The LNS Plug-In Programmer’s Guide provides a
discussion of the plug-in registration process. This section provides a brief overview of

the process, focusing on the director’s role in plug-in registration.

When LNS plug-in software is installed, the installation includes registration of the plug-

in application’s COM server with the Windows Registry. Among other details, this
publishes the plug-in application’s Registered Server Name to the Windows system. At

the same time, the plug-in registers with an LNS-specific part of the Windows Registry,

by adding or updating data under the
HKEY_LOCAL_MACHINE\SOFTWARE\LonWorks\LCA\Plug-Ins key. The director detects

all subkeys stored under HKEY_LOCAL_MACHINE\SOFTWARE\LonWorks\LCA\Plug-Ins

in the Windows Registry. Each subkey relates to an LNS plug-in application. Following

is an example screenshot, showing the Plug-In Windows Registry key explored in the

Windows RegEdit.exe utility, highlighting the Echelon LNS Report Generator plug-in:

Advertising