Jump to content

Comparing Strings


Recommended Posts


I am new to Unilogic, and I have been through many of the unilogic tutorials, but I can't seem to find much documentation on working with strings.

I want to write a program where the user types a string via the hmi and the logic of the program determines whether or not what was entered matches one of several options. 

For example, the options are 'red', 'yellow', 'blue'. The user types 'blue', and the program displays that they have selected blue (in a practical setting this could be linked to an action). Additionally, if the user makes and error and enters 'blur' instead of 'blue', the program shows an error. 

Link to comment
Share on other sites

Why not just use an option select with Text Labels


You could use a colored graphic button that processes the selection based on a button color w/text labels.

using a general text entry option where the user can type any and all variations of characters and words would be inefficient from a programming and a process stand point.

Link to comment
Share on other sites

'Why not just use an option select with Text Labels'

I know this can be done, however, I am trying to learn all aspects of the software. I am trying to transfer all my skills from other languages to this language just to see if it is possible to be done and not necessarily concerned with its efficiency at this point. Any knowledge learned from this inquiry can be applied to other situations in which I will need to use strings. 

Again, there is no documentation for how to use any of the ladder functions for strings. 

strings image.PNG

Link to comment
Share on other sites

Try not to think so much about the language.

Rather think function, a plc is primarily a digital machine, strings are not.

The ladder program is a digital expression.

Pushing the 'Blue' button should set a blue flag bit.

Multiple button choices set mutiple respective flags.

The program sums up the flags and will result in only one true result/action.

Grouping the buttons on screen will allow you to focus the operators attention.

The flag activates the button background color to indicate the one choosen.

Pull down list choices are not always easy to use on a small touch screen without a mouse.


Is your operator using gloves?

Is the on screen text in the operators first language?

Is the operator color blind?

Does the operator need glasses to read the text?

Pehaps an actual machine related graphic symbol would illustrate best.

Happy Programming 


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...