This code keeps throwing an “illegal character” exception on the addTag() line. The provider name is correct and the Advantech UDT is in the [KRN2.0] provider. Can anyone assist?
ip = event.source.parent.getComponent('IPField').text
conn_name = event.source.parent.getComponent('NameField').text
try:
system.device.addDevice("modbus", conn_name, hostname=ip)
except:
system.gui.warningBox("Device connection already exists!")
system.tag.addTag(parentPath="[KRN2.0]AdvantechDiagnostics", name=conn_name, tagType="UDT_INST", attributes={"UDTParentType":"Advantech"})
system.nav.closeParentWindow(event)
[code]Traceback (most recent call last):
File “event:actionPerformed”, line 7, in
com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.google.common.collect.ComputationException: com.inductiveautomation.ignition.common.sqltags.parser.TagPathFormatException: Illegal character ‘[’ (Line 1 , Char 1)
caused by GatewayException: com.google.common.collect.ComputationException: com.inductiveautomation.ignition.common.sqltags.parser.TagPathFormatException: Illegal character '[' (Line 1 , Char 1)
caused by UncheckedExecutionException: com.google.common.collect.ComputationException: com.inductiveautomation.ignition.common.sqltags.parser.TagPathFormatException: Illegal character '[' (Line 1 , Char 1)
Ignition v7.7.5 (b2015071516)
Java: Oracle Corporation 1.8.0_91
[/code]