Not really related to your issue, but why are you using system.tag.writeBlocking() to backfill tag history? Wouldn’t system.tag.storeTagHistory() be better suited?
I don’t have to extract the tagpath to get the provider, tag, and historian provider.
The trick is to get the qualityValue object from a readBlock.
Plus it feels more natively supported…
qvs = system.tag.readBlock(['%s' % (tagPath) for tagPath in tagPaths])
values = [...]
timestamps = [...]
for i, qv in enumerable(qvs):
if qv.quality <> 'Not Found'....
for j, ts in enumerable(timestamps):
values.append(getQualityValue(qv, values[j], ts))
system.tag.writeBlock(....)
def getQualityValue(qualityValue, value, date)
qv = qualityValue.clone()
qv.value = value
qv.timestamp = date
qv.quality = qv.quality.Good
return qv
There is discrepancies with the quality code on Ignition and the historian.
On Vision, I see data quality = -2,147,483,136.
On historian, the same data on the same timestamp, I see data quality = 0.