ns=2;s=DEPRAG Smart/Utilities/StringOperations/SubstringWithLength
Returns a part of the specified text. The part starts from the Startindex parameter and ends at Startindex+Length.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bStringSubstringWithLength : BOOL;
OutputDataStringSubstringWithLength : ST_StringOutputData;
hrStringSubstringWithLength : HRESULT;
fbStringOperations : FB_StringOperations;
END_VAR
hrStringSubstringWithLength := fbStringOperations.StringSubstringWithLength(
bExecute := bStringSubstringWithLength,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
ContainString := 'Ich bin ein String',
ContainStringLength := SIZEOF('Ich bin ein String'),
StartIndex := 8,
Length := 3,
OutputData => OutputDataStringSubstringWithLength);
IF hrStringSubstringWithLength <> S_FALSE THEN
bStringSubstringWithLength := FALSE;
END_IF
For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".