LGF_ExtractStringFromCharArray (FC / V1.1.0)

Overview

Author: Siemens Online Support

Short description

The function extracts a String specified by a text before and after from an array of characters.

Block Interface

LGF_ExtractStringFromCharArray (FC)
String  textBefore Ret_Val  Word
    
String  textAfter extractedString  String
    
   status  Word
    
Variant  searchIn  Variant
       
   

Input parameter

IdentifierData type Description
textBeforeString Text in front of the characters which has to be extracted
textAfterString Text behind the characters which has to be extracted

Output parameter

IdentifierData type Description
Ret_ValWord 16#0000-16#7FFF: Status of the FB
16#8000-16#FFFF: Error identification (see following Table)
extractedStringString Extracted string
statusWord 16#0000-16#7FFF: Status of the FB
16#8000-16#FFFF: Error identification (see following Table)

In/Out parameter

IdentifierData type Description
searchInVariant Array of Character or Byte to search in

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_TEXT_FOUND
Successful, start text and end text were found
16#0000STATUS_NO_ERROR
Status: Execution finished without errors
16#8200ERR_NO_ARRAY
Error: No array of Char or Byte is present at the input `searchIn`
16#9001WARNING_ONLY_START
Unsuccessful, only start text was found, extracted String is filled with characters after start text
16#9002WARNING_NOTHING_FOUND
Unsuccessful, neither text was found

Change log

Version & DateChange description
01.00.00Siemens Online Support
01.04.2019First released version (LHttp)
01.01.00Siemens Online Support
10.06.2022Adaption and integration into LGF