005 - uGOAL - Buffer configuration







Initial version




This document describes configuration of RPC buffers depending on the application requirements.


This option defines the size of a buffer, the RPC protocol stores it’s requests and responses in. Because of that this must be adopted to the application requirements. Most features will be usable with the default value of 274 (see https://portgmbh.atlassian.net/wiki/spaces/IRJ45SOM/pages/138739774 ). If RPC requests should transport larger data chunks, this value needs to be increased.

The buffer also contains some RPC protocol overhead, so it is safe to reserver an additional 100 Byte buffer at all times.

Follow configuration of the buffer size is illustrated using example projects/ugoal/09_pnio_io_mirror_new_api ( https://portgmbh.atlassian.net/wiki/spaces/IRJ45SOM/pages/171704363 ). This example supports acyclic record reading and writing. For this feature a maximum length of data a PLC can read and write can be configured. This is done using the following define:

/* record data maximum length * * the maximum length supported by the profinet stack is 1116 */ #define RECORD_DATA_LENGTH 256


Depending on that option the configuration of CONFIG_UGOAL_RPC_RB_SIZE is done accordingly:

/* size of ring buffer entries * * To allow transportation of RECORD_DATA_LENGTH bytes record data this * size needs to be increased */ #if RECORD_DATA_LENGTH + DEFAULT_UGOAL_RPC_RB_OVERHEAD > DEFAULT_UGOAL_RPC_RB_SIZE # define CONFIG_UGOAL_RPC_RB_SIZE (RECORD_DATA_LENGTH + DEFAULT_UGOAL_RPC_RB_OVERHEAD) #endif


Thus initially the RB_SIZE is configured to 274. If the requested record data buffer requires a larger RPC buffer, this is configured here accordingly. Thus for the maximum number of 1116 bytes of record data the according RPC buffer size results to 1116 (RECORD_DATA_LENGTH) + 100 (DEFAULT_UGOAL_RPC_RB_OVERHEAD) bytes, thus 1216 bytes.


This option multiplies the reserved buffer size (CONFIG_UGOAL_RPC_RB_SIZE). By default 1 buffer is sufficient. Applications using HTTP, TCP or UDP generally require 2 buffers.


This option configures the Possible RPC requests being active at one time. By default 2 handles are reserved, one for the core system and one for the applications. Applications where a RPC request results in a RPC request to the peer (HTTP, PROFINET) need at least one handle more, thus 3 handles.