Sorting Text In A PLC Program

Modified on Thu, 2 Oct, 2025 at 11:50 AM

Introduction
Task: Sort a table of names alphabetically.

(A name can contain up to 39 (28) characters and occupies 20 words)

The table now has 6 entries = 6 * 20 = 120 words.

In Power-LAD before then:
Arrays
Loop Commands
Word commands

Of course, the example has a small error:
Lower case letters have a higher ASCII code, so comes a little behind a large Z and
also the blank field are not sorted correctly. So best to write everything with no field left blank.

For OMRON LD and ST are equivalent.
It is not restricted to a particular language.
 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article