Network buffer size, Errors, Buffer counts – Echelon Neuron C User Manual

Page 204

Advertising
background image

192 Memory

Management

If explicit addressing is used, add an additional 11 bytes of system overhead.
For application messages,

message_size

equals 1 byte for the message code plus

the number of bytes of data. For network variables,

message_size

equals 2 bytes

plus the number of bytes in the network variable.
Table 14 on page 196 lists the valid sizes for application buffers. For example, if

message_size

is 40, then you need an application buffer of at least 45 bytes.

However, the next largest valid size for an application buffer is 50 bytes.

Application buffers are also used to receive network management messages used

by network tools for device configuration. A minimum input application buffer

size of 22 bytes (34 bytes if explicit addressing is used) is required to be able to
accommodate the largest possible network management messages.

Network Buffer Size

The size of a network buffer is less than or equal to the following:

message_size

+ 6 bytes of system overhead + 20 bytes of protocol overhead

Protocol overhead ranges from 5 to 20 bytes per message, and this formula uses

the maximum. A 40-byte message would thus need a network buffer of at least

66 bytes (see Table 14 on page 196).

Network buffers are also used to receive and respond to network management

messages that are used by network tools for device configuration. A minimum

input network buffer size of 42 bytes and output network buffer size of 50 bytes is
required to be able to accommodate the largest possible network management

messages.

Errors

If an input message fits into a network input buffer but does not fit into an
application input buffer, the message is discarded. An APP_BUF_TOO_SMALL

error code is logged by the Neuron firmware. If the message was sent with the
acknowledged service, no acknowledgment is sent. If the message was a request,

no response is sent.
If an output message fits into an application output buffer but does not fit into a
network output buffer, a NET_BUF_TOO_SMALL error is logged and the device

resets.

Buffer Counts

In most cases, the default number of output application buffers is sufficient.
Increasing the number of application buffers on the output side decreases the

likelihood of entering preemption mode if you are using synchronous network

variable outputs (see

Preemption Mode

on page 55).

The number of input network buffers needed is a function of the types of service

used and the types of connections between devices:

• If you are using authentication, you might need to increase the number of

network buffers because authentication doubles the number of messages.

Advertising