Block transfers of data – Echelon Neuron C User Manual

Page 136

Advertising
background image

124

How Devices Communicate Using Application Messages

Type of Message

Message Code

Description

Responder Offline

63

(0x3F)

Used by application message

responses. Indicates that the

sender of the response was in an
offline state and could not process

the request.

Foreign Frames

64 to 78
(0x40..0x4E)

Used by application-level gateways
to other networks. The

interpretation of the message code
is left to the application.

Foreign Responder

Offline

79

(0x4F)

Used by foreign frame responses.

Indicates that the sender of the
response was in an offline state

and could not process the request.

Network Diagnostic

Messages

80 to 95

(0x50..0x5F)

Used by network tools for network

diagnostics.

Network Management

Messages

96 to 127

(0x60..0x7F)

Used by network tools for network

installation and maintenance.

Network Variables

128 to 255
(0x80..0xFF)

The lower six bits of the message
code contain the upper six bits of

the (14-bit) network variable
selector. The first data byte

contains the lower eight bits of the

selector.


Example of building an application message:

msg_tag motor;

#define MOTOR_ON 0
#define ON_FULL 100

msg_out.tag = motor;
msg_out.code = MOTOR_ON;
msg_out.data[0] = ON_FULL;

Block Transfers of Data

You can use the C memcpy( ) function to transfer blocks of message data into the

msg_out or resp_out objects (see

Using the Request/Response Mechanism

on page

136). You can also use memcpy( ) to copy a block of data from the msg_in or

resp_in objects. Using this function is the only case where you can use the

address of the msg_out, resp_out, msg_in, or resp_in objects.

For messages of an unknown or variable length, use msg_in.len or resp_in.len,

limited by the sizeof(

s

) to prevent writing past the end of

s

.

Advertising