Hello,
I’ve migrated a project from 7.9 to 8.0 for testing purposes. A template with a string “Path” property included this script in 7.9 that worked as intended as the UDT had a string property called “ControlScreen” containing the window path. A tag of the same name within the UDT points to this property.
window = system.tag.read(event.source.parent.Path + '/ControlScreen')
system.nav.swapTo(window.value)
Since system.tag.read does not exist in 8.0, I tried using readBlocking as below:
window = system.tag.readBlocking([event.source.parent.Path + '/ControlScreen'])
system.nav.swapTo(window[0].value)
And I get the following error:
Traceback (most recent call last):
File "<event:mousePressed>", line 14, in <module>
ValueError: Window {ControlScreen} does not exist.
I also tried readAsync as below but ended up with the same error as above:
def callback(result):
system.nav.swapTo(result[0].value)
tagPath = []
window = event.source.parent.Path + '/ControlScreen'
tagPath.append(window)
system.tag.readAsync(tagPath, callback)
It seems that in 8.0 the “event.source.parent.Path” as a string returns nothing. What would be the best way to replicate the script’s actions in this new version of Ignition?
Thanks.