Push Button On Template with Indirect Addressing Not Turning on in the PLC

Hi Experts,
I am hoping someone can help me. I have soured the forum, but I am unable to anything to help with my problem.
The site is using Ignition V7.9 connected to a AB CompactLogix 1769-L33ER at V32.
I have created a "popup" page with multiple parameters using indirect Tag Addressing which works perfectly. Depending on the button to call the popup, determines which parameter group is displayed.
I am now trying to add an "Auto" & "Off" Push Buttons onto the popup.
I have tried using a "1 Shot Button" and applied the indirect addressing, the same as the other parameters with no success. Is this a known issue with Ignition V7.9?
How do I apply the "Page Root Container PoolNumber" Variable as a substitute for POOL_1A?

event.source.parent.PoolNumber

value = 1
system.tag.write('Stage2_ValvePit/Pool_1A/TempSP/Auto/AutoPB', value)

Thank You
Woolie

Did you make the binding Bidirectional? If not then you aren't writing the new value anywhere.

tagName = 'Stage2_ValvePit/%s/TempSP/Auto/AutoPB' % event.source.parent.PoolNumber
value = 1
system.tag.write(tagName, value)

Thanks Ryan,
That piece of code is exactly what I was trying to write.
I can cope sort of with Cicode (Citect) and some other languages, but Python / Json seems to get me confused.

Again Thanks for your prompt reply and the solution.
Woolie

My example is technically worse, its Python with Java's string formatting syntax. Python uses {} in conjunction with .format(), Java uses %. Jython lets you do that. :person_shrugging:

https://docs.python.org/2.7/library/string.html#format-string-syntax

If you watch any of the basic python tutorials out there that will get you 80-90% of the way. Syntax is the main thing to nail down, after that it's learning to handle Ignition's specific data types and methods.

Edit: Fixed link to point to python 2.7

Thanks for the links. Looks like there is more learning to be done over the weekend. Good thing I don't have a life!

Thanks again
Woolie

Careful, 7.9 is still Python 2.5 which I don’t believe supports the .format() on strings. Pretty sure you still need to use the old style format parameters as you have shown in the script.

2 Likes

You really should not point at Python3 documentation for Ignition purposes. This is better:

https://docs.python.org/2.7/

Ignore the warning banner, it isn't applicable to Jython.

1 Like

Thanks to you both, Irose & pturmel, for you input and advice.
I'll will be looking at the link over the weekend.
Woolie