Attach multiple registers to one button

Have a momentary button on my Navigation screen that I would like to use to reset alarms on multiple PLC’s.
In the PLC’s I have latching circuits that require a boolean to go high to unlatch the circuit.
I would like to energize these booleans by using my momentary button.
I dont care that it writes to each individual PLC even if there isnt an alarm, just keeping it simple.

Question: How do i attach multiple registers to one Momentary button?

I tried a simple script like the following:

control = event.source.controlValue
value = event.source.controlValue

if control ==1:
tagpath = “Bit 2”

elif control == 0:
tagpath = “Bit 2”

system.tag.write(tagpath,value)

And it works on that particular bit, but I cant figure out how to do multiple bits. Do I create multiple tagpaths? I tried to AND them together but got an error. Pretty new to scripting, I’m sure it’s something simple.

Also is there any other way to do this other than scripting?

You would use the mousePressed to write the on values

tags = ["yourTag1", "yourTag2", "yourTag3"] values = [1, 1, 1] system.tag.writeAll(tags, values)
And mouseReleased to write the off values

tags = ["yourTag1", "yourTag2", "yourTag3"] values = [0, 0, 0] system.tag.writeAll(tags, values)

Keep in mind, you should have logic in your PLC program to reset the bits if they are on for too long in case there is an issue with Ignition writing the off values back to the PLC. This is a good practice for any bits that are momentary in a PLC program.

Thanks pat, that worked great.

“Keep in mind, you should have logic in your PLC program to reset the bits if they are on for too long in case there is an issue with Ignition writing the off values back to the PLC. This is a good practice for any bits that are momentary in a PLC program.”

Yeah thats a very good point, I will be sure to add a timer in to reset if bit does stay on to long.

In my PLC programs, I OR all my momentary buttons to a bit that I call HmiButtonActive. Then whenever the HmiButtonActive bit is on for more than 30 seconds I reset all the momentary buttons. This puts all the momentary buttons status and reset logic in one location and I also bring the HmiButtonActive status back into Ignition as a double check.