Can anyone help me with the correct way to ensure the correct parameter name (with period “.”) is passed/parsed through a system.tag.readBlocking /.writeBlocking command so I can update the parameter individually?
Background…
I inherited an Ignition 8.1 Perspective-based system where the UDT parameter names include a period (“.”) character of the format “Z.9 Some Name”. I need to update a particular parameter for several UDT instances and had been unsuccessful implementing system.tag.readBlocking and .writeBlocking. I implemented system.tag.getConfiguration and system.tag.configure successfully in a script however as @nminchin wrote here, this is A Bad Idea (confirmed) as it has decoupled all those instances’ parameters (all 33 of them, when I only want 1 to change) from the UDT parameters.
The issue I was having with path (copied from the parameter in the tag browser by right-clicking and selecting “Copy Path”) is that the period (“.”) acts as a property delimiter and I get complaints about having more than one…
(note these are running in the Designer Script Console scope)
system.tag.readBlocking("[default]someTag/Parameters.Z.9 Some Name")
Traceback (most recent call last):
File "<input>", line 1, in <module>
ValueError: Invalid path element '[default]someTag/Parameters.Z.9 Some Name': Token PROPERTY_SEPARATOR found after property name.
Trying to escape the second period with a backslash (“\”) results in complaints about out-of-place path elements. I’ve tried various iterations of escaping and also in various quote configurations…
system.tag.readBlocking("[default]someTag/Parameters.Z\.9 Some Name")
Traceback (most recent call last):
File "<input>", line 1, in <module>
ValueError: Invalid path element '[default]someTag/Parameters.A\.4 Some Name': Token PATH_SEPARATOR found after property name.
The couple of solutions I have are:
- Redefine all the UDT parameters without special characters. I don’t wish to do this as that will break (I have 33 Parameters to rename for that UDT) a whole lot of things I will then have to unbreak.
- Roll back (yay for backups
) and work out how to use system.tag.readBlocking and .writeBlocking so as to only disturb the 1 parameter I need.
So as stated at the top, it would be much appreciated if someone could assist with the correct configuration of the system.tag.readBlocking / .writeBlocking command format to cope with the period (“.”) in the name.
Thanks in advance,
Patrick.
P. S. and if it’s some absurdly simple solution staring me in the face that I should have seen, I also apologise in advance for missing it!