Deprecated tag read and write functions

I learned system.tag.read and write have been replaced by system.tag.readBlocking and writeBlocking. I am wondering if there is a version of Ignition where, if we upgrade to said version, we need to worry about instances of the deprecated functions breaking entirely and needing to be rewritten? We are on version 8.1.18.

IA tends to keep deprecated functions around for a really long time. They just don't get much love if bugs pop up, and they are deliberately removed from the documentation.

I'd not worry about old code. If you make sure new code or updated code uses the modern functions, the deprecated stuff will likely be gone before it matters.

2 Likes

We'll also never remove functionality (outside of critical security issues) in a "minor" version - as in, any 8.1 upgrade is absolutely going to be fine. We have no plans to remove these specific functions in 8.3, either, meaning you're set for at least the next several years.

3 Likes

Awesome, thank you for the quick answers.

I googled "how to read single tag after system.tag.read deprecation" and ended up here so I'll revive this year-old discussion. Since this function was deprecated my scripting for getting the value from a single tag has gone from

tagVal = system.tag.read(tagPath).value

to

tagVal = [v.value for v in system.tag.readBlocking([tagPath])][0]

Is that the accepted way moving forward, or is there something simpler I could use?

I use
tagVal = system.tag.readBlocking([tagPath])[0].value

1 Like
system.tag.readBlocking([tagPath])][0].value

While you could technically use:

system.tag.readBlocking(tagPath).value

if you learn to use the list forms, it will cover all your bases. :slight_smile:

4 Likes

Use the list comprehension like above when you want to read a handful of tags together, and stuff them into separate variables. Like so:

tagA, tagB, tagC = [v.value for v in system.tag.readBlocking([pathA, pathB, pathC])][0]
3 Likes

Hi pturmel.

I agree, I used list comprehension in my proposal because it scales better into using a handful of tags, which is also common. So for consistency I use list comprehension even when it's just 1 tag.