ns=2;s=DEPRAG Smart/Utilities/StringOperations/IndexOf
Searches for a text in another text and returns the zero-based position of the first occurrence.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bStringIndexOf : BOOL;
OutputDataStringIndexOf : ST_Int32OutputData;
hrStringIndexOf : HRESULT;
fbStringOperations : FB_StringOperations;
END_VAR
hrStringIndexOf := fbStringOperations.StringIndexOf(
bExecute := bStringConcat,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
StringToSearchIn := 'IamATestString',
StringToSearchInLength := SIZEOF('IamATestString'),
StringToSearchFor := 'Test',
StringToSearchForLength := SIZEOF('Test'),
OutputData => OutputDataStringIndexOf);
IF hrStringIndexOf <> S_FALSE THEN
bStringIndexOf := 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".