User Defined Variables


I’m a relatively new user to Opto gear and PAC Display. I’m working on making my HMI screen, and I have a question.

I would like my user to be able to Click a command button to populate some information about the equipment we are monitoring, then have it display in the appropriate text box on the display. I have the command button setup as a user input, but I’m having issues having it set the text correctly.

Any help would be greatly appreciated! Thank you!

Hi ASoder,

Welcome to the forums!

I think one of the reasons you might be a little confused is that there seems to be different types of data in your screen shot.
The Conveyor number is probably an integer, the model is a string with both numbers and letters in it, lastly, the install date is probably also a string as it may have / or - in the date… (Note, this is a guess on my behalf, please feel free to correct any assumptions on my side of things).

So, we have a button ‘Enter unit info’ and it needs to be just an integer, that is, which conveyor number you want the extra info for.
That button needs to be hooked to some code running in the PAC. The chart will be looping around looking at that number and filling out the string values that match that conveyor number.
Yeah, if the number is the same, the same string data gets added to the string variables, but that’s not a big deal in my mind (OptoMary would probably add some code to check the conveyor number, and if its unchanged, skip the ‘move string’ instructions).

Does that make sense?

The chart is what moves the Model and install date into those strings when the conveyor number changes, not PAC Display.

Feel free to ask any questions or provide some extra info if I am off the mark.


OptoMary is confused and would also like more info on what we’re trying to do here.

And, since you’re building an HMI, be sure to check out this page, especially the White Paper, on developing high-performance HMIs.

I have questions like: Is there more than one conveyor? (If so, how many?) Is the data stored in tables in the strategy? If so, have you considered using the table Tool for this? Might save some programming.

Here’s what I’m talking about in PAC Display config:

And in PAC Display Runtime:

But I hope you’ll tell us more about what you’re doing there… and have you thought of using groov for that HMI?

Do share!


Thank you for the info! I’ll try to clarify what I’ll be working with…

The Conveyor number would be in this format, XX-1 or XX-Y-1, so it would be a combination of letters and numbers. Your model number and installed date assumptions are spot on.

The gist of what I’m creating is a demo of what the capabilities are with using this software for a Condition monitoring system for our products. I would like to show how once we create the monitor screen, the end user can then enter information so they know what specific unit is being monitored, because we wouldn’t know that information when we supply this system.

I was able to use the command button to input the information, and set the install date as a Variable in the control engine, but it doesn’t reset, the variable stays as originally entered the last time the screen was viewed in the Runtime.

Groov is on my radar, and I’ll be setting that up in the future to show as part of our demo.
Hope this helps some!

I’m still confused, how was that variable [I]supposed [/I]to get cleared? (Do you have logic for that?) A variable will remain unchanged unless you do something to change it. Maybe you’ll have a “save” button will set some flag for your logic that, when set, will:

  1. move the values hooked to the screen to an appropriate element in a table (Perhaps where the element number is the same as the conveyor number?)
  2. clear the values hooked to the screen, including the flag attached to the "save" button.
[/INDENT] How is/will this data you're entering getting used/saved after you enter it?

Ah I think I see what your getting at… Right now, I have nothing in the logic regarding the user input, except a String Variable. Its not even linked to the logic checking the status of the unit, based on the sensor input.

As for the data once its entered, I would just want it to populate the text on the display screen. So here’s how I picture it working, this may not be the best way, but its what I was thinking…

Strategy is Started - Display Runtime is viewed (all “user defined” text fields are empty), user clicks command button, enters the information, that info is populated into the display screen.

It is strictly for the user to know what unit is being monitored, upon installing the equipment.