String instructions
265
Part II IEC Instructions
In this example the input variables (input_string and character_number) have been declared.
Instead, you may enter the string ('Ideas for life') and the number of characters to be delivered
directly into the function. The string has to be put in inverted commas, both in the POU header and
in the function.
Body
Starting from the left, character_number (5) of input_string (‘Ideas for life’) is copied to
output_string (‘Ideas’).
LD
ST
When programming with structured text, enter the following:
output_string:=LEFT(IN:=input_string, L:=character_number);