LEN
Function Name |
LEN |
---|---|
Description |
Outputs the total number of characters in the input string. |
Arguments |
Input 1 {STRING} The input is a string input. For more information on the data types for the inputs and outputs, see Data Type Hierarchy. |
Returns |
Output {DINT} The output is the total number of characters in the Input 1 string. |
Example:
Function Block Diagram - LEN:
In this example, the input is 'PIPELINE STRUCTURE FAILURE' and so the LEN output is 26 (there are 26 characters in the input string).
ST Program - LEN:
To use a LEN function in an ST program, you need to use this syntax:
- Output := LEN ('Input 1');
Where Output and Input 1 are defined as variables earlier in the ST program.