CreateStringPool (FUN)

FUNCTION CreateStringPool : IStringPool

Creates a pool for IString instances in the specified memory space
The size of the strings is specified via udiStringSize

Example for a _StringPool instance with a capacity of 10 ``IString instances with a size of minimal 80 bytes each:

axwMemory : ARRAY[0..209] OF __XWORD;
fbStringPool : STR._StringPool := (udiStringSize:=80, pbyPool:=ADR(axwMemory), udiPoolSize:=SIZEOF(axwMemory));
   stPoolConfig : STR.CONFIG := fbStringPool.GetPoolConfig(); // -> udiStringSize = 87 | udiCapacity = 10
Please take a look to the function blocks in the Library “Generic String Base”
You can use the GSB.StringPool function block, which performs this task in a much more convenient way
InOut:

Scope

Name

Type

Initial

Comment

Return

CreateStringPool

IStringPool

Input

udiStringSize

UDINT

pbyPool

POINTER TO BYTE

Pointer to the first byte of the memory.
This address should aligned to a __XWORD boundary!

udiPoolSize

UDINT

Size of the allocated memory for the range.
This size must not be smaller than SIZEOF(STR._StringPool), because it includes an instance of _StringPool(FB)

usiExtensionFactor

USINT

0

Optional extension factor of the IStringPool instance

Output

eErrorID

ERROR