Message codes, Ge 123 – Echelon Neuron C User Manual

Page 135

Advertising
background image

Neuron C Programmer’s Guide

123

It might not always be possible to determine rate_est and max_rate_est. For

example, message output rates are often a function of the particular network
where the device is installed. These optional values can be used by a network

tool to perform network device analysis. Although any value in the range

0-18780 can be specified, not all values are used. The values are mapped into
encoded values

n

in the range 0-127. Only the encoded values are stored in the

device's self-identification (SI) data. The actual value can be reconstructed from
the encoded value. If the encoded value is zero, the actual value is undefined. If

the encoded value is in the range 1-127, the actual value is:

5

)

8

/

(

2

=

n

a

rounded to the nearest tenth. The actual value,

a

, produced by the formula, is in

units of messages per second.

You must assign a message tag to the msg_out.tag field for each outgoing

message. This specifies which connection point (corresponds to an address table

entry) to use for the outgoing message. After the tag field has been assigned, the
message must be either sent or cancelled.
Besides addressing, message tags are also used for correlating completion events

and responses with outgoing messages. For example, the following when clause
correlates a message completion event with a message sent by means of the tag1

message tag:

when (msg_completes(tag1))

By qualifying an event with a message tag, the event becomes TRUE only when

an event corresponding to that particular outgoing message occurs.

Message Codes

A

message code

is a numeric identifier for a message. Each application message

must include a message code that the receiving applications can use to interpret

the contents of the message.

Message codes are used by all LonTalk messages, not just application messages.

They fall into the ranges shown in Table 8. Codes 0-62 and 64-78 are for use by

applications. The lower range is used for proprietary application-specific
messages, and the upper range is used for proprietary application-level gateways

to other networks.

Table 8. Ranges for Message Codes

Type of Message

Message Code

Description

User Application

Messages

0 to 47

(0x00..0x2F)

Generic application messages. The

interpretation of the message code
is left to your application.

Standard Application
Messages

48 to 62
(0x30..0x3E)

Standard application messages
defined by L

ON

M

ARK

International.

Advertising