Importing a lonmaker network, Invoking the import command – Echelon LonWorks Network XML User Manual

Page 14

Advertising
background image

6

Using the LonMaker XML Plug-in


// *Insert export automation properties before invoking send command*


// Option to export NV and device-specific values

m_lmXml.XmlOptions = 0x10 | 0x40;

//Option to export subsystem specified in SendCommand

m_lmXml.ExportScope = 2;


m_lmXml.SendCommand(23, 5,

"MyXmlNetwork/MyXmlNetwork/Subsystem 1"

);

m_lmXml.Visible =

true

;

}
}
}

Importing a LonMaker Network

You can use the LonMaker XML Plug-in to automate the importing of a LonMaker network. To do
this, create a director application that does the following:

1. Defines the import automation properties.
2. Invokes the import command of the LonMaker XML Plug-in.

Invoking the Import Command

The import feature of the LonMaker XML plug-in implements the user level (10000)

SendCommand

request and registers for a subsystem object, which consists of the object class (Subsystem, 5) and the
subsystem name. The following Visual C# code example demonstrates how you can invoke the
LonMaker XML Plug-in import command.

using

System;

using

System.Collections.Generic;

using

System.IO;

using

System.Text;

using

System.Threading;

using

System.Xml;

using

PlugInWrapper;

//reference to Echelon PluginWrapper.dll file.

//You can use download and reference this instead of

//creating your own director application.

namespace

myLmXmlNetwork

{

class

myLmXmlNetwork

{

static

void

Main(

string

[] args)

{

//Create an instance of the LonMaker plug-in using its registered

//ActiveX name, which is "EchelonLonMakerXML.Application"

LonMakerXmlPlugIn

m_lmXml =

new

LonMakerXmlPlugIn

();


//Set the network name property to open the network

m_lmXml.NetworkName =

"MyXmlNetwork"

;


//Invoke the send command to specify the action and target

//object. The send command uses the following syntax:

//(10000, 5, “network/system/subsystem[/subsystem…])”

m_lmXml.SendCommand(10000, 5,

"MyXmlNetwork/MyXmlNetwork/Subsystem 1"

);


//Make plug-in visible so it shows itself

m_lmXml.Visible =

true

;

}
}
}

Advertising