Declaring a message tag – Echelon LonTal Stack User Manual

Page 79

Advertising
background image

LonTalk Stack Developer’s Guide

67

cpDefaultOutput = 123

};

fblock SFPTopenLoopSensor {

nvoAmpere implements nvoValue;

} fbAmpereMeter;

The initial value (123) must be provided in the instantiation of the configuration

property, because the type for cpDefaultOutput is not known until it is
instantiated.
You can also combine type-inheriting configuration properties with network

variables that are of changeable type. The type of such a network variable can be
changed dynamically by a network integrator when the device is installed in a

network.
Example 2:

SCPTdefOutput cp_family cpDefaultOutput;
SCPTnvType cp_family cpNvType;

network output changeable_type SNVT_amp nvoValue
nv_properties

{

cpDefaultOutput

=

123,

cpNvType
};

fblock SFPTopenLoopSensor {

nvoValue implements nvoValue;

} fbGenericMeter;

The nvoValue principal network variable, although it is of changeable type,
must still implement a default type (SNVT_amp in the example). The

SCPTdefOutput type-inheriting configuration property inherits the type
information from this initial type. Therefore, the initializer for

cpDefaultOutput must be specific to this instantiation. Furthermore, the
initializer must be valid for this initial type.
If the network integrator decides to change this type at runtime, for example, to

SNVT_volt, then it is in the responsibility of the network management tool to
apply the formatting rules that apply to the new type when reading or writing

this configuration property. However, your application has the responsibility to

propagate the new type to this network variable’s type-inheriting configuration
properties (if any).

Declaring a Message Tag

You can declare a message tag in a model file. A message tag is a connection
point for application messages. Application messages are used for the

L

ON

W

ORKS

file transfer protocol, and are also used to implement standard and

proprietary interfaces to L

ON

W

ORKS

devices as described in Chapter 8,

Developing a LonTalk Stack Device Application.
Message tag declarations do not generate code, but result in a simple

enumeration, whose members are used to identify individual tags. There are two
basic forms of message tags: bindable and nonbindable.
Example:

Advertising