Introduction, Using the lonmaker xml plug in, Using the lonmaker xml plug-in – Echelon LonWorks Network XML User Manual

Page 10

Advertising
background image

2

Using the LonMaker XML Plug-in

Introduction

You can speed up your network design and ensure your devices are configured correctly by creating a
custom LonMaker user interface. Creating a custom LonMaker user interface is simple: you create a
an application that reads or writes XML files and then invokes the LonMaker XML Plug-in to
automatically export the LonMaker network created and import it into an LNS application. You can
configure your custom LonMaker application so that it is the only user interface required to create a
LonMaker network, which is ideal if the network includes only devices that are supported by your
application. Alternatively, you can configure your custom application so that user interacts with it and
the resulting LonMaker network (for example, the network includes devices not supported by your
custom application). Writing a custom LonMaker user interface provides a simpler, quicker
alternative to creating a custom LNS application. It also provides a more flexible solution than
creating a Visio add-on.

To develop a custom LonMaker user interface, you need to create an application that does the
following:

1. Optionally invokes the LonMaker XML Plug-in and exports all or part of a LonMaker drawing as

an XML file. See Exporting a LonMaker Network in the following section for more information
on exporting a LonMaker network.

2. Creates or modifies the XML file to create and configure the desired devices, functional blocks,

network variables, and network variable/message tag connections in a LonMaker network. See
Setting Object Attributes and Properties in Chapter 2 for more information on creating and
configuring LonMaker network objects

3. Invokes the LonMaker XML Plug-in and imports the XML file created into the LonMaker tool or

other LNS application. See Importing a LonMaker Network in the following section for more
information on importing a LonMaker network.

Note: This document uses a series of C# code examples, created with Microsoft Visual Studio 2008,
to demonstrate the concepts being described. You can create your custom LonMaker application using
any .NET environment such as C# or Visual Basic.

Using the LonMaker XML Plug-in

You can use the LonMaker XML Plug-in to automate exporting and importing your LonMaker
network to an LNS application. The LonMaker XML Plug-in provides a programmatic interface to the
XML import and export features in the LonMaker tool. The LonMaker XML Plug-in is registered at
the network level; therefore, it only needs to be registered once on a computer for it to be used to
export or import any LonMaker network.

To use the LonMaker XML Plug-in to automate the exporting and importing of a network, you
implement a director application that invokes the export or import command of the LonMaker XML
Plug-in and defines the export or import automation properties. You can also define standard LNS
plug-in properties in the director application.

Director applications use the LNS Plug-In API to invoke plug-in applications. The interface between
director applications and plug-ins consists of standard ActiveX automation interfaces. This
ActiveX-based API defines an automation object that provides a standard interface between a director
application and a plug-in. Director applications can launch plug-ins and communicate with them using
the methods and properties of the automation object. A set of ActiveX exceptions is defined for
passing back error information from the plug-in to the director. See the LNS Plug-In Programmer’s
Guide
for more information about using the LNS plug-in interface and API, and creating director
applications.

Advertising