MID is a string function in the CODESYS Standard library that returns a specified number of characters from a string, starting from a given position. It is called as MID(STR, LEN, POS): take LEN characters from STR beginning with the character at position POS, and return the partial string. The function is declared as FUNCTION MID : STRING(255).
| Language | iec 61131 3 |
|---|---|
| Code | MID |
| Group | String Functions |
| Syntax | MID (STR, LEN, POS) |
| Dialect | CODESYS |
| Name | Data type | Description |
|---|---|---|
| STR | STRING(255) | String to be analyzed |
| LEN | INT | Number of characters, counted from the left |
| POS | INT | Start position for the partial string |