Debugging plug ins, Debugging plug-ins – Echelon LNS Plug-in User Manual

Page 29

Advertising
background image

Registering DeviceTemplate and LonMarkObject

Scoped Plug-in Commands

The LNS Plug-in Framework does not currently support registration of DeviceTemplate and
LonMarkObject scoped plug-in commands; however commands at one or both of these scopes are
essential to device plug-ins. You can override the framework function and implement registration of
DeviceTemplate and LonMarkObject scoped plug-in commands by following these steps:

1. Set your plug-in command’s PluginCommand.Scope property to

ComponentAppScope.DeviceTemplate or ComponentAppScope.LonMarkObject.

2. Override the PluginObjectBase.PreRegisterPluginCommand and

PluginObjectBase.PreUnregisterPluginCommand methods and hook the commands with
scopes of ComponentAppScope.DeviceTemplate and/or
ComponentAppScope.LonMarkObject. Other command scopes should be sent back to the base
class implementation.

3. Implement your plug-in registration command for the ComponentAppScope.DeviceTemplate

and/or ComponentAppScope.LonMarkObject scopes by adding the logic described in How
Plug-ins Implement the Registration Command
in Chapter 3. Upon completion of your
processing, return null to the PluginObjectBase.PreRegisterPluginCommand.

4. Implement your plug-in unregistration command for the

ComponentAppScope.DeviceTemplate and/or ComponentAppScope.LonMarkObject scopes
by undoing the LNS network database changes that you made when registering your plug-in.

Debugging Plug-ins

You can collect trace information from the LNS Plug-in Framework by copying the app.config file
from the LonWorks\ObjectServer\Examples\PluginFramework\ExampleCSPlugin to your plug-in’s
project folder. Visual Studio will automatically copy this file to your plug-in’s target folder changing
the name of the file to match that of your plug-in. You can then modify this file as desired.

To check that your plug-in has been successfully registered, you can use the OLE/COM
ObjectViewer
to display the registration information associated with your plug-in.

Advertising