Perspective Tag History binding - collecting Duration On , on conditions of two Tags

We've done a lot of tag history binding, collecting time duration, historical mode (8 hour shift) of single boolean tag conditions.

I have the need to do so on a specific condition of two (Boolean) tags - AUTO = True And ACTIVE = False. A waiting state and we want to return the duration of that. I'm not finding quite the right combination. Per the screen shot, I'm trying the Expression mode, but I've been using the Direct mode with single Tags, using a Calculation of DurationOn (or Off). I must be close, or what's the best way to capture this? Thanks!

I suppose I could create a new tag that is an expression tag that is the evaluation of those two in that state, and then collect duration on that as I've done the others. That would solve the problem. It would still be nice to see how it could be done here :).

1 Like

I believe the equals comparison in expression language is just the single = instead of ==
Also worth noting that that expression could probably be simplified, as right now it essentially reads "If argument, then true, else false", and could probably be replaced with just the argument, something like {[PLR_Tags]AUTO} && !{[PLR_Tags]PULLER_ACTIVE}

1 Like

The historian is not designed to do any such analysis across multiple tags, whether booleans or not. The expression tag is the right answer for simple cases. For more complex cases, you almost certainly need wide tables (SQL Bridge or manually scripted) with triggering logic.

In addition to all these other things, expression mode in a tag history binding doesn't work the way you're attempting to. The expression you author needs to return a well-formatted array of objects that describe the tags you want to return history for.

See the first bullet here:

Thanks all. Now I have a better understanding and will know how to handle in the future, for this one (expression tag).