Concat

TwinCAT TIA
Tools String functions

ns=2;s=DEPRAG Smart/Utilities/StringOperations/Concat

Concatenates the first specified string with the second specified string.

Parameters:

    StrB
    The second string that is appended to the end of the first string.

Returns:

    Concat
    A structure variable of type OpcMethodReturnValueString. The Result property contains the command-specific return values.

Examples:

In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:

Beckhoff parameter:

    bStringConcat
    A boolean variable that can be used to trigger the execution of the Concat command.
    OutputDataStringConcat
    An instance of the "ST_StringOutputData" structure into which the return value of the Concat method is written.
    hrStringConcat
    This can be used to monitor the execution of the command. Error codes have the type "HRESULT".
    fbStringOperations
    An instance of the "FB_StringOperations" function block supplied with the DEPRAG Smart library.
    StringOneToConcat
    The first string of type "STRING(80)" to concatenate.
    StringOneToConcatLength
    The length of the first string to concatenate.
    StringTwoToConcat
    The second string to be concatenated of type "STRING(80)".
    StringTwoToConcatLength
    The length of the second string to concatenate.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
    bStringConcat   : BOOL;
    OutputDataStringConcat : ST_StringOutputData;
    hrStringConcat   : HRESULT;

    fbStringOperations : FB_StringOperations;
END_VAR

hrStringConcat := fbStringOperations.StringConcat(
      bExecute     := bStringConcat, 
      ConnectionHandle  := depragSmartConnection.ConnectionHandle,
      StringOneToConcat  := 'StringOne\n',
      StringOneToConcatLength := SIZEOF('StringOne\n'),
      StringTwoToConcat  := 'StringTwo',
      StringTwoToConcatLength := SIZEOF('StringTwo'), 
      OutputData    => OutputDataStringConcat);
IF hrStringConcat <> S_FALSE THEN 
      bStringConcat := 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".