# CODESYS RIGHT

Instructions · `RIGHT` · verification: source checked

RIGHT is a string function that returns a specified number of characters from the right side of an input string. RIGHT(STR, SIZE) returns the first SIZE characters from the right in STR. Its return type is STRING(255), and it is used in structured text programs.

## Specification

| Property | Value |
|---|---|
| Language | structured text |
| Code | RIGHT |
| Group | String Functions |
| Syntax | RIGHT (STR, SIZE) |
| Dialect | CODESYS |

### Parameters

| Name | Data type | Description |
|---|---|---|
| STR | STRING(255) | String to be analyzed |
| SIZE | INT | Number of characters |

## Study notes

- RIGHT (STR, SIZE) returns the first SIZE characters from the right in string STR.
- The example RIGHT('SUSI',3) returns 'USI'.
- The function return type is STRING(255).

## Sources

1. [Beckhoff Information System](https://infosys.beckhoff.com/content/1033/tcplclib_tc2_standard/74423307.html) (accessed 2026-10-26)
2. [CODESYS Group](https://content.helpme-codesys.com/en/libs/Standard/Current/String-Functions/RIGHT.html) (accessed 2026-10-26)

---

Source page: https://machineschema.com/instruction/iec-right  
JSON: https://machineschema.com/instruction/iec-right.json  
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite Machine Schema and the original sources.
