Library Information ¶ GetLibVersion (Function) GetLibVersionNumber (Function) IsLibReleased (Function)
GetLibVersion (FUN) ¶ FUNCTION GetLibVersion : VERSION InOut: Scope Name Type Return GetLibVersion VERSION
GetLibVersionNumber (FUN) ¶ FUNCTION GetLibVersionNumber : DWORD InOut: Scope Name Type Return GetLibVersionNumber DWORD
IsLibReleased (FUN) ¶ FUNCTION IsLibReleased : BOOL InOut: Scope Name Type Return IsLibReleased BOOL
File and Project Information ¶ Scope Name Type Content FileHeader creationDateTime date 21.06.2023, 11:07:56 companyName string 3S-Smart Software Solutions GmbH libraryFile String Builder.library primaryProject True productName CODESYS productProfile CODESYS V3.5 SP16 Patch 3 contentFile String Builder.clean.json version version 2.0.0.0 ProjectInformation AutoResolveUnbound bool True Released True LastModificationDateTime date 21.06.2023, 11:07:54 LibraryCategories library-category-list Application|Strings Author string CODESYS Development GmbH Company CODESYS CompiledLibraryCompatibilityVersion CODESYS V3.5 SP16 Patch 3 DefaultNamespace SBD Description See: Description DocFormat reStructuredText LanguageModelAttribute qualified-access-only LibDocContent DocsOnly Placeholder StringBuilder Project String Builder Title String Builder UnitTestingDefine BuilderTesting Version version 4.0.0.0
Library Reference ¶ This is a dictionary of all referenced libraries and their name spaces. Immutable String Segments ¶ Library Identification ¶ Placeholder: StringSegs Default Resolution: Immutable String Segments, * (CODESYS) Namespace: STR Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: StringSegs Memory Block Manager ¶ Library Identification ¶ Placeholder: MemoryBlockManager Default Resolution: Memory Block Manager, * (3S - Smart Software Solutions GmbH) Namespace: MBM Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: MemoryBlockManager String Builder Base ¶ Library Identification ¶ Placeholder: StringBuilderBase Default Resolution: String Builder Base, * (CODESYS) Namespace: SBB Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: StringBuilderBase String Conversions ¶ Library Identification ¶ Placeholder: StrConv Default Resolution: String Conversions, * (CODESYS) Namespace: SCV Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: StrConv SysMem ¶ Library Identification ¶ Placeholder: SysMem Default Resolution: SysMem, * (System) Namespace: SysMem Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: SysMem UTF-16 Encoding Support ¶ Library Identification ¶ Placeholder: UTF16 Default Resolution: UTF-16 Encoding Support, * (CODESYS) Namespace: UTF16 Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: UTF16 UTF-8 Encoding Support ¶ Library Identification ¶ Placeholder: UTF8 Default Resolution: UTF-8 Encoding Support, * (CODESYS) Namespace: UTF8 Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: True SystemLibrary: False Key: UTF8
_Builder.Reset (METH) ¶ METHOD FINAL Reset Resets the Builder to be empty InOut: Scope Name Type Comment Output eErrorID ERROR Check error message for better diagnostics
Segments ¶ The handling of UTF-8 encoded strings without additional buffering The specification pbyData and udiSize can be used to describe a memory block that is to be considered for the processing of strings. Receiving Data eErrorID := itfPeer.Receive ( pbyData , udiSize , itfIPAddressFrom , uiPortFrom => uiPortFrom , udiCount => udiCount ); // UDP/IP eErrorID := itfConnection.Read ( pbyData , udiSize , udiCount => udiCount ); // TCP/IP udiCount := TO_UDINT ( SysFileRead ( hFile , pbyData , TO__XWORD ( udiSize ), ADR ( udiResult ))); // File Access udiCount := SysComRead ( hCom , pbyData , udiSize , ulTimeout , ADR ( udiResult )); // Serial Com Sending data eErrorID := itfPeer.Send ( itfIPAddress , uiPort , pbyData , udiSize , udiCount => udiCount ); // UDP/IP eErrorID := itfConnection.Write ( pbyData , udiSize , udiCount => udiCount ); // TCP/IP udiCount := TO_UDINT ( SysFileWrite ( hFile , pbyData , TO__XWORD ( udiSize ), ADR ( udiResult ))); // File Access udiCount := SysComWrite ( hCom , pbyData , udiSize , ulTimeout , ADR ( udiResult )); // Serial Com For all these use cases an IBuilder implementation offers the possibility to provide the buffer. This allows the corresponding IBuilder instance to be extended with the new content without a additional buffer and thus without additional effort for the management of the copy. Read content received by a a network connection to a ``IBuilder`` instance REPEAT eErrorID := itfBuilder.GetCurrentSegment ( pbyData => pbyData , udiSize => udiSize ); eErrorID := itfConnection.Read ( pbyData , udiSize , udiCount => udiCount ); IF eErrorID = ERROR.NO_ERROR AND udiCount > 0 THEN eErrorID := itfBuilder.ValidateSegment ( pbyData , udiCount ); IF eErrorID <> ERROR.NO_ERROR THEN // Handle Error EXIT ; END_IF END_IF UNTIL udiCount = 0 END_REPEAT Write the content of a ``IBuilder`` instance to a network connection pbyData := itfBuilder.GetFirstSegment ( udiSize => udiSize , eErrorID => eErrorID ); WHILE pbyData <> 0 AND eErrorID = ERROR.NO_ERROR DO eErrorID := itfConnection.Write ( pbyData , udiSize , udiCount => udiCount ); IF eErrorID <> ERROR.NO_ERROR OR udiCount <> udiSize THEN // Handle Error EXIT ; END_IF pbyData := itfBuilder.GetNextSegment ( pbyData , udiSize => udiSize , eErrorID => eErrorID ); END_WHILE GetCurrentSegment (Method) GetFirstSegment (Method) GetNextSegment (Method) ValidateSegment (Method)
_Builder.GetCurrentSegment (METH) ¶ METHOD GetCurrentSegment : ERROR Returns the available memory of the free segment Check error return value for better diagnostics InOut: Scope Name Type Comment Return GetCurrentSegment ERROR Output pbyData POINTER TO BYTE Pointer to the first byte of the free segment udiSize UDINT Data size of the free segment
_Builder.GetFirstSegment (METH) ¶ METHOD FINAL GetFirstSegment : POINTER TO BYTE Returns the pointer to the first segment of the builder InOut: Scope Name Type Comment Return GetFirstSegment POINTER TO BYTE Output udiSize UDINT Size of the first segment in bytes eErrorID ERROR Check error message for better diagnostics