Today's Production Time %
I have a Boolean tag that represents a machine's productive state, 1 = Productive, 0 = Not Productive. I would like to display in an Axiom application value box, the percentage of today the state is productive. My first stab at it was to use these settings.... AggregateInterval: D, AggregateKind: DurationInStateNonZero, AggregateStartTime: D. With a value transform of: (value/1000/60)/1440*100. I get a value but then I started thinking about my logic and I think I am wrong. I want to know my productive time today, thus far, so my denominator shouldn't be total minutes in a day but, how many have passed up to right now. Is there a way to do this, where essentially the minute denominator is dynamic based on the minutes elapsed so far today, not the total minutes in a day. Thank you in advanced for any time pondering this.
Regards,
Tim
1 reply
-
Hi ,
I have a simpler solution for you. Since you are using a Boolean tag, if you take the average value of the tag across an interval, that same average value would also be the percentage the state was set to 1 (productive). For instance, if over an hour the tag was returning a value of 1 for 40 minutes and returning 0 for 20 minutes, the average value over that hour would work out to 0.667, or 66.7% productive over that hour.
AggregateInterval: D
AggregateKind: TimeAverage2
AggregateStartTime: D
ValueFormat: {Value:P0}
Converts the decimal value to a percentage.When utilizing "D" for both the Interval and StartTime, this would return the average value across the current day so far.
Regards,
Ethan
