How to... "determine router memory"

In cases with high ADS message volume the router memory should be increased.

Calculation

The calculation of the router memory depends on several factors. The following rule of thumb can be used for guidance:

Router memory = packet size per notification* + 500 kB message buffer + 200 kB management information

*The packet sizes of the notification depends on the selected parameters (Cycletime and Maxdelay). The minimum size if 1 kB per notification.

Example*:

10 controls, each with 20 notifications, are used (DINT values, Cycle Time = 1 ms, MaxDelay = 100 ms).

In this example each notification message requires 1220 bytes (rounded up to 2 kB, since the memory is specified in kB).

Data field

Size

Description

Length

4 bytes

Data size in bytes.

Stamps

4 bytes

Number of elements of type AdsStampHeader.

TimeStamp

8 bytes

Timestamp. The timestamp is encoded according to the Windows FILETIME format. This means that the value contains the number of nanoseconds that have passed since 1.1.1601. The local time difference is not taken into account. The timestamp is in Universal Coordinated Time (UTC) format.

Samples

4 bytes

Number of elements of type AdsNotificationSample.

The MaxDelay parameter ensures that 100 values are put in the buffer:

Notification Handle

100 x 4 bytes

100 notification handle.

Sample Size

100 x 4 bytes

Size of the data area in bytes.

Data

100 x 4 bytes

DINT data.

Required router memory* = 10 controllers x 20 notifications/controller x 2 kB/notifications + 500 kB message buffer + 200 kB management information = 1100 kB

* The calculation refers to a case with maximum memory usage. The memory allocation may differ during normal operation.