Manual
Table Of Contents
- Table of Contents
- Preface
- 1 Introduction
- 2 Creating and Redistributing LNS Device Plug ins
- 3 How Plug ins Work with Directors
- How Plug ins Are Represented in the LNS Object Server
- How Plug ins are Installed and Made Visible to LNS
- How Plug ins Implement the Registration Command
- How Plug ins Respond to Commands from a Director Other than Registration
- How Directors Launch and Manipulate Plug ins
- What Plug ins Do When They Run in Standalone Mode
- Responding to Property Reads and Writes
- Uninstallation Issues
- Appendix A Standard Plug in Commands
- Appendix B Standard Plug in Properties
- Appendix C Standard Plug in Object Classes
- Appendix D Standard Plug in Exceptions
Field Description
Scope A ComponentAppScope value identifying the scope of the
plug-in’s command. This is known as the command scope,
which should not to be confused with the registration scope or
plug-in scope (see the
Glossary in Appenidx E for details).
Note: The LNS Plug-in Framework currently only
automatically supports the registration of commands at the
ObjectServer and System command scopes; however, you will
typically want to use the DeviceTemplate and/or
LonMarkObject scopes for device plug-ins.
See
Registering DeviceTemplate and LonMarkObject Scoped
Plug-in Commands later in this chapter for a description of the
code your plug-in must implement to support plug-in
commands at these scopes.
7. If your plug-in will include a user interface (typical), create a hidden instance of your PluginForm
class in the PluginObject constructor, and assign it to the PluginObjectBase.PluginForm base
class property.
The following code demonstrates how your plug-in object class should appear (note that MyPlugin
represents the name of your plug-in):
using System;
using System.Runtime.InteropServices;
using Echelon.LNS.Interop;
using Echelon.LNS.Plugin;
namespace YourCompany.DevicePlugin
{
[
ComVisible(true),
Guid("3CCF87F7-AEFD-4c8e-9936-FEEAB3BBA5A9"),
ProgId("YourCompany.DevicePlugin.MyPlugin"),
ClassInterface(ClassInterfaceType.None)
]
public class MyPluginObject : PluginObjectBase
{
// describe the plug-in
private static readonly PluginInfo _PluginInfo = new PluginInfo(
// standard LNS Plug-in properties
"YourCompanyMyPlugin", // PluginName
"Description of YourCompany’s MyPlugin", // Description
"3.22", // LcaVersion
"YourCompany Corporation", // ManufacturerName
"YourCompany C# Device Plug-in", // Name
ComponentAppScope.System, // Scope
"1.0", // Version
// advanced LNS Plug-in properties (optional)
Feature.Supported, // MultiObject (default: Unsupported)
Feature.Supported, // SingleInstance (default: Unsupported)
Feature.Unsupported // Prelaunch (default: Unsupported)
);
public
static PluginInfo PluginInfo
{
get { return _PluginInfo; }
}
// describe the plug-in commands
private static readonly PluginCommand[] _PluginCommands = new PluginCommand[]
{
new PluginCommand(
"YourCompany Test Device", // Name