Jump to content

Fixed Date to Now() interval that totalizes hours when composite conditions are met


Recommended Posts

This may be very easy, but I cannot figure it out.   I have say 4 nested composite conditions to be met and the capsules are identified.  I want to totalize the capsules from a fixed date to now().  Basically since last maintenance was performed and want to totalize run hours determined by the intersecting composite conditions.  

I can only find relative time capsules or absolute, but cannot figure out how to use an absolute start date and a now() finish date.

Link to comment
Share on other sites

Hi Aaron,

you can use a formula for this. The following example calculates the total duration of all capsules of the operation condition since 06 Mar 2021 up to now. The result is a scalar.

$operation.aggregate(totalDuration('h'), capsule('2021-03-06T00:00:00Z', now()))

image.thumb.png.d98eaaf85745c2d0af4a848070302395.png

Another option would be creating a condition that can be used in the "Signal from Condition" tool. You have to select an appropriate maximum capsule duration for the condition:

 condition(30d, capsule('2021-03-06T00:00:00Z', now()))

image.thumb.png.3739c3fb5896d3f7f361cf9502255a67.png

A more dynamic way would be calculating the duration based on the last maintenance. The following formula creates a condition for the times your equipment is running, in case you only have the maintenance capsules. growEnd(30d) extends the capsules to 30 days so you can use it for the current time. As growEnd() extends the capsules to the beginning of the next capsule I use subtract() to remove the maintenance periods from it.

$maintenance.inverse().growend(30d).subtract($maintenance)

The resulting condition is used inside Signal from Condition Tool:
image.thumb.png.52f1dde816c56f3f1416269334e9d195.png

Will this work for you?

Regards,

Thorsten

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...