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
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 thanSIZEOF(STR._StringPool)
, because it includes an instance of_StringPool(FB)
usiExtensionFactor
USINT
0
Optional extension factor of the IStringPool instanceOutput
eErrorID