CONCAT (String Concatenation)
Joins two or more strings into a single combined string.
The CONCAT function joins two or more strings together into a single string. It is the primary string-building operation in IEC 61131-3, used for constructing display messages, log entries, communication frames, and formatted output. CONCAT appends the second string to the end of the first string and returns the combined result.
Parameters
Inputs
| Name | Type | Description |
|---|---|---|
| IN1 | STRING | First string |
| IN2 | STRING | Second string to append |
Outputs
| Name | Type | Description |
|---|---|---|
| OUT | STRING | Concatenated result (IN1 + IN2) |
Structured Text Example
// Build alarm message
Alarm_Msg := CONCAT('ALARM: ', Alarm_Description);
// Build log entry with multiple parts
Log_Entry := CONCAT(CONCAT(Date_Str, ' - '), Event_Description);
// Build communication frame
Telegram := CONCAT(CONCAT(Header, Data_Payload), Checksum_Str);20 Production-Ready Ladder Logic Templates
Stop writing the same rungs from scratch. Get copy-paste-ready templates for motor control, PID loops, safety interlocks, conveyors, and more.
Platform-Specific Implementation
Siemens (TIA Portal)
Use CONCAT instruction in TIA Portal. Max string length is 254 characters.
Allen-Bradley (Studio 5000)
Use CONCAT instruction in Studio 5000. STRING data type max 82 characters default.
CODESYS
Use CONCAT() function in ST. String length depends on declaration.
Common Applications
- Alarm message construction
- Log entry formatting
- Communication frame building
- HMI display text
- Report generation
Frequently Asked Questions
What is CONCAT (String Concatenation) in PLC programming?
Joins two or more strings into a single combined string. The CONCAT function joins two or more strings together into a single string. It is the primary string-building operation in IEC 61131-3, used for constructing display messages, log entries, communication frames, and formatted output.
What are common applications of CONCAT (String Concatenation)?
CONCAT (String Concatenation) is commonly used for: Alarm message construction, Log entry formatting, Communication frame building, HMI display text, Report generation.
How do I use CONCAT (String Concatenation) in different PLC platforms?
Siemens: Use CONCAT instruction in TIA Portal. Max string length is 254 characters. Allen-Bradley: Use CONCAT instruction in Studio 5000. STRING data type max 82 characters default. CODESYS: Use CONCAT() function in ST. String length depends on declaration.
Related Function Blocks
LEFT (Left String Extract)
Extracts a specified number of characters from the beginning of a string.
View Reference →RIGHT (Right String Extract)
Extracts a specified number of characters from the end of a string.
View Reference →FIND (String Search)
Finds position of a substring within a string; returns 0 if not found.
View Reference →Stop Writing Ladder Logic From Scratch
Get 20 production-ready ladder logic templates for $29 -- download instantly and use them on your next project today.
Instant download - 30-day money-back guarantee - Use on unlimited projects