Jump to content

Trying to only display MAX Value within a condition


Go to solution Solved by John Brezovec,

Recommended Posts

I am trying to only show values of the maximum difference between my temperature setpoint and PV ($hssp) within a certain period ($hrs).

I used the below to set up my capsule (hopefully using the right notation) but am getting all the values during my condition range ($hrs which I identified which steps of the process to consider). 

$hssp.within($hrs).toCondition('Heater_Sag')

image.png.487cfd683d6ad694bf11774507ed233d.png

 

I will like to ONLY show the maximum value seen during this condition range. I tried the following below but got an error message as it seems that I am not using the proper notation:

$hssp.maxValue($hssp.within($hrs).toCondition('Heater_Sag'))

No variant of function 'maxValue' consumes the parameters (Signal, Condition) at 'maxValue', line=1, column=7

 

I then tried the below and received another error message:

$hd.aggregate(maxValue(), $hsis)
 
⬆ No variant of function 'aggregate' consumes the parameters (Signal, Stat:Sample:Scalar, Condition) at 'aggregate', line=1, column=5
Edited by Michelle
Link to comment
Share on other sites

  • Seeq Team
  • Solution

Your last formula is pretty close! You also need to include where you want to place the result of the aggregation - do you want it to display for the duration of the capsule, or maybe put it at the start or the end?

$signal.aggregate(maxValue(), $condition, startKey()) // could replace startKey() with endKey(), middleKey(), durationKey(), maxKey() or minKey()

This aggregation could also be performed using the Signal from Condition tool, which will let you pick your inputs in a point-and-click UI

Link to comment
Share on other sites

Posted (edited)

Hi John, 

Thank you it worked! Had to set a maximum duration, is there a way where I can use the duration of my capsule instead of a fixate number? 

$hssp.aggregate(maxValue(), $hs.setMaximumDuration(40h), durationKey(), 0s)
Edited by Michelle
New question
Link to comment
Share on other sites

  • Seeq Team

The max duration always has to be specified as a scalar (fixed number) -- you should try to pick the shortest max duration you're comfortable with for performance reasons, but if your use case requires a super long max duration then that's what your use case requires!

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...