Jump to content

Comparing Strings


Engineer1

Recommended Posts

Hello,

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

-or-

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.

Questions:

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 

Bob

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.