I am using tag history bindings. Through a flex repeater(30 instances) to evaluate Duration On of a bool Expression tag(“Producing”). That is an expression of several OPC tags. That eventually compares against seconds in a shift or day.
Works great. But, consumes a ton of resources. When it polls.
I need to get a query tag that provides me a scalar value of Duration On of this “Producing” tag.
But I don’t know how to query the historian manually. Should it be a query tag or tag change script using system.tag.queryTagHistory - Ignition User Manual 8.0 - Ignition Documentation or what?
{
"type": "tag-history",
"config": {
"dateRange": {
"startDate": "{[default]SCADA/Time/shift.Timestamp}",
"endDate": "now(30000)"
},
"calculations": [
"DurationOn"
],
"tags": "{view.custom.hist}",
"returnFormat": "Calculations",
"valueFormat": "DOCUMENT",
"ignoreBadQuality": false,
"preventInterpolation": false,
"avoidScanClassValidation": true
}
}
view.custom.hist
[
{
"aggregate": "DurationOn",
"alias": "ava",
"path": "[default]D06/D06/Status/Producing"
}
]
Any guidance on how to wrap this all up in a tag to provide an int of seconds of duration on for [default]D06/D06/Status/Producing. So all the instances can just read a tag. Instead of individually querying
Would be much appreciated.