beautypg.com

Echelon OpenLNS User Manual

Page 479

background image

OpenLNS Programmer's Reference

442

switch. In OpenLNS, function blocks are represented by

LonMarkObject

objects.

Some custom device interfaces support dynamic

LonMarkObject objects, which means that you can add them

to the interface manually. You can determine if an interface

supports dynamic

LonMarkObject

objects by reading the

interface’s

DynamicLonMarkObjectCapacity

property. If the

device interface does not support dynamic function blocks,

this property will be set to 0, and use of the Add method will

cause the LCA, #119 lcaErrInterfaceNotModifyable

exception to be thrown.
If the device interface supports dynamic function blocks, the

DynamicLonMarkObjectCapacity

property will be set to a

value greater than 0, and you can add function blocks to the

interface with this method.
Note that you cannot add LonMarkObjects to a device’s main

interface, although the

DynamicLonMarkObjectCapacity

property of that

Interface

may be set to a non-zero value. The

main interface of a device is stored in its

Interface

property.

The custom interfaces of a devices are stored in its Interfaces

property.
The

Name

and

ProgrammaticName

properties of the new

LonMarkObject

object will be set to match the name specified

as the fbName element.
The name assigned to the

LonMarkObject

objects on each

device must be unique. If you attempt to use a name that is

already used on a device when adding a new

LonMarkObject

object, the operation will fail, and the LCA, #151

lcaErrUniqueNameRequired exception will be thrown.

Echelon recommends that you make sure all

LonMarkObject

objects in the OpenLNS database have unique names.

Availability

newLonMarkObject = LonMarkObjects.Add fbName, fbType

Syntax

objectColl.Add name

Element

Description

newLonMarkObjec

t

The

LonMarkObject

returned by the

function. This is the newly defined

LonMarkObject

.

LonMarkObjects

The

LonMarkObject

collection to be

acted upon.

fbName

The name of the function block to be

created. This can be a maximum of

16 characters long, and must conform

to the character restrictions defined

in version 3.3 the LonMark

Application Layer Interoperability

Guidelines. These restrictions are

that the name must not begin with a

number, and it cannot include square