CONCAT - Concatenate two or more strings

Introduction

Returns the concatenation of two or more strings.

Informal Syntax:

CONCAT( In0, In1, ..., InX )

Formal Syntax:

CONCAT( In0:=expression, In1:=expression, ..., InX:=expression )

Parameters

ParameterTypeDescription
In0ANY_STRINGThe first string.
In1ANY_CHARSThe second string.
.........
InXANY_CHARSThe Xth input string.

The function is overloaded and accepts a range of types for the In0 to InX parameters:

Return value

The returned string is the result of adding together (concatenate) all of the input parameters In0 to InX.

The type of the return value is determined by the type of the first parameter In0. All other inputs are converted to the same type as In0.

Examples

ExampleReturn Value
CONCAT('Abc', 'def')STRING#'Abcdef'
CONCAT("Abc", 'def')WSTRING#"Abcdef"
CONCAT("Abc", WCHAR#'Z')WSTRING#"AbcZ"
CONCAT('Value = ', '12', ' kg')STRING#'Value = 12 kg'

Standards Compliance

Table 29.5 - IEC 61131-3 2nd Edition.

Table 34.5 - IEC 61131-3 3rd Edition.

Note: The function allows different string types as parameters. The IEC 61131-3 3rd Edition standard states this should be an error.

Further Information

String Functions

To learn about other String Functions.

Common Elements

To learn about other IEC 61131-3 Common Elements.

Glossary

For definitions of the terms used in Fernhill SCADA.