3 Replies Latest reply on May 29, 2018 11:45 AM by rschmitz

# Performance Equation for time between two tags

Hello all!

So what I'm looking for is a performance equation that will give me the time between two tag events.

1. Example: I have tags that are going through sequential numbered phases (phases 1 through 6).  "Tag101 = phase 1" for x-amount of time, "Tag101= phase 2" for x-amount of time all the way through Tag101=6 for X-amount of time. So my event would be when Tag101 = phase 6, what's the time difference from when Tag101 = phase 1? Basically, how long did Tag101 take to get from Phase 1 to Phase 6.

2. Second question related to the one above, which performance equation would I need to track how long Tag101  was equal to phase 6?

I've tried a few performance equations but I seem to be missing something. Any help would be appreciated

• ###### Re: Performance Equation for time between two tags

Alex,

So there's definitely a number of ways to do this. I would recommend using the Analysis Service over Performance Equations if at all possible as they're more robust and offer the same

So for first requirement, I made quick Analysis using the FindEq Function, which returns the first time in a range when an attribute is equal to a particular value. There's two tricky things with using this, which are that you need to know roughly how long it takes for your process to get from Phase1 to Phase6. Also you need to put in the Digital state integer rather than the corresponding string. The raw data for comparison: The second requirement I believe you're looking for TimeEq function.

Cheers,

Rob

2 of 2 people found this helpful
• ###### Re: Performance Equation for time between two tags

Thanks for your response Robert. By Analysis Service do you mean using FindEq through Excel or is that a specific tool? When I'm running Performance Equations, I'm usually using the Excel plugin for PI (or the PI System Management Tool). If the Analysis Service is a tool, I'm unfamiliar with it. Can you elaborate? Thanks.

• ###### Re: Performance Equation for time between two tags

Alex,

The analytics I'm using in the above are part of PI Asset Framework. You could do the same thing with Performance Equations as I'm doing with AF Analytics, however you would need to write everything in a single line for the Performance equation, i.e.:

FindEq('BA:Phase','*-2h','*',0) - FindEq('BA:Phase','*-1h','*',6)

--Rob

1 of 1 people found this helpful