Tag Value Derived From Historian

I’m trying to figure out the best way to access tag history in a derived/reference/expression tag. For example, say tagA is an opc tag and it’s storing history. I want the value of tagB to be calculated from tagA’s history (tagB might be the average of tagA over 1 week, the exact value of tagA 24 hrs ago, etc.).

The only way I can think of accomplishing this is to make tagB an expression tag that uses the Advanced/RunScript function that runs a jython script that uses the system.tag.queryTagHistory function. I’m worried this method will be too inefficient to use on a large scale (say 1000’s of tagB’s).

Does anyone have a recommendation?

Thanks,
Levi

What are you going to attach to tagB? Offhand, I can’t think of an application that wouldn’t be better to query the

or whatever else right where you want to use it.

1 Like