Change Tag quality in script

You actually can write the quality and timestamp to a tag using our system.tag.write functions. You just need to send in a qualified value. You can use BasicQualifiedValue for that:

from com.inductiveautomation.ignition.common.model.values import BasicQualifiedValue
from com.inductiveautomation.ignition.common.sqltags.model.types import TagQuality
bqv = BasicQualifiedValue(value, TagQuality.GOOD, timestamp)
system.tag.write(tagPath, bqv)

The timestamp would be a proper date object (use system.date functions).

4 Likes