How to make an HOA Pop UP


We our still getting to know ignition and one of the big things we want to be able to do before we purchase it is know if we can make a HOA (Hand, Off, Auto) Pop Up for multiple buttons?

So i was able to make a pop u screen with my HOA button on and also change the name of the pop up screen if i click a different button. However I can’t seem to figure out how to change the Tags that the HOA has to adress after clicking on a different button. Can anyone explain this to me please?

Pass in the tag path(s) (right-click on tag in tag browser and copy tag path) that need to be read/written for HOA control as parameters to the pop-up window and then use system.tag.write or system.tag.writeAll (for more than one tag) to write to the tag(s) when a button is pressed. For reading, use indirect tag binding to utilized the tag path(s) you passed in as parameters on the window.

1 Like

Thanks for the quick response! I’ve watched these video’s but it still doesn’t seem to work here. in our PLC program we have 3 tags. Stat.2 for Hand, Stat.3 for Off and Stat.4 for auto so if I link each of them to a button and toggle the button i see the bits change on my plc and visa versa. So that’s kind of where I’m stuck is to do it for 3 tags at the same time…

I recommend using a single tag for HOA (for example, I’d use 0 = off, 1 = maintenance mode, 2 = hand, 3 = auto) as it ensures you can’t have two states at once. That said, if you don’t have that option, you can put script like this on a button to write all three at once:

# List tags to write (could be a comma seperated list of tag paths, but I like list comprehensions).
tags = ['Stat.%i' %i for i in range(2,5)]
# Turn mode hand on and other modes off.
values = [True, False, False]
# Write tags.
system.tag.writeAll(tags, values)

For other buttons, just change the order of True and False in the values.

I’m not sure what component you’re using for buttons. I don’t usually use the built-in ones, preferring to draw what I want (as a template) and add the scripting for actions. Done this way, the hand “button” (actually a rectangle) would have this code in it (right-click on it and choose scripting to get this window):

When button is tapped with mouse, it’ll turn on Stat.2 and turn Stat.3 and Stat.4 off.

Why don’t you use indirect tag addresses?
Bind the buttons to indirect tags and pass the tag paths as parameters.

I’d bind the buttons’ status to the indirect tags as @MMaynard suggests, and use scripting to write all three tags at once.

where exactly do i have to write the scripting then?

And making the UDT tags, do i make a UDT for Stat.2 and just change the pump name for them and a separate one for Stat.3 and a separate one for Stat.4 then?

On the component that should write the three tags when it is tapped/clicked as shown in screenshot in post above. Without more info, I’ll make some assumptions:

  1. Your popup window has a custom property rootTagPath.
  2. You pass in the path to the desired HOA tag, but exclude the bit number and preceding period (so something like ‘Pump1/Stat’, not ‘Pump1/Stat.2’. This is based on the assumption that you use this same structure for all HOA tags.
  3. Your HAND button is a rectangle in root container.

In this case, the script would go on the HAND button rectangle as shown in screenshot in my previous post and would utilize the tag path you’ve passed in like below. Note the change to the beginning of the list comprehension that creates the tags list; it now refers to the custom property on the popup window instead of a hard-coded tag path:

# List tags to write (could be a comma seperated list of tag paths, but I like list comprehensions).
tags = [event.source.parent.rootTagPath + '.%i' %i for i in range(2,5)]
# Turn mode hand on and other modes off.
values = [True, False, False]
# Write tags.
system.tag.writeAll(tags, values)

I’m not sure I understand the question. I’d expect a UDT structure something like:

Pump2 would then look like:
Pump2/HOA/Stat.2, etc.

Okay, so if I get this right I should make an Indirect tag in Pump1 called HOA wit Stat 1-3 in it and an indirect tag for pump 2 as well. Do i have to put the 3 buttons in a template or can i just have them on my popup window and add the indirects and scripting in the popup it self? and by doing it this way, and opening the same popup how does the HOA trigger the other pump now?

There’s no such thing as an ‘Indirect Tag’. There is an ‘Indirect Tag Binding’, used in components and gui containers to select one of many possible tags given a path or partial path in a string. Indirect bindings make it simple to design reusable popups and templates, especially if the tags in question have a straightforward common pattern. Like you get with the names in a UDT, though it doesn’t have to be a UDT.
For your popup, you’d pass a string to the popup’s root container supplying a path to the specific HOA button you want the user to see/use. The indirect bindings in the popup combine that string with a static suffix for the particular boolean tag needed for each part.

1 Like



The popup window’s rootTagPath property you pass in when you open it is used in all scripting (like the example I gave above) as well as in indirect bindings to link the popup to the tags for whichever pump opened it.

You don’t have to put your tags in UDTs, though it makes maintenance easier if you do. For the code example I gave, all that matters is that the HOA tags all end in “.2”, “.3”, and “.4” and that those suffixes mean the same thing in all cases. (And of course what comes before that suffix must be the same for one device (Pump 1) and different for the next.) Whatever comes before the suffix in tag path is to be passed as a parameter to the popup window’s rootTagPath property and will be used from there by scripting and indirect bindings to display status.