Jump to content

Create a Signal which Is Max or Min of Multiple Signals


Recommended Posts

  • Seeq Team

There are various methods to do this. The easiest method is by using the max() or min() functions in the Formula Tool, which are available beginning in Seeq release R21.0.40.05. Here is an example for creating a new signal which is the maximum of 4 other signals:

$a.max($b).max($c).max($d)

You can also see additional information in this related forum post.

Link to comment
Share on other sites

  • Seeq Team

One limitation to the method mentioned above is if one of the signals doesn't have any values, then no answer is returned. If you still want the value even if one signal is missing than you can try the alternative formula described below. This method works for versions prior to R21.0.40.05.

image.png

 

Here is the formula for 2 signals as shown above:

$signal1.zipWith($signal2, ($s1, $s2) -> max($s1.getValue(), $s2.getValue()))

 

If you have more than 2 signals, then add additional zipWith() statements:

$signal1.zipWith($signal2, ($s1, $s2) -> max($s1.getValue(), $s2.getValue()))
        .zipWith($signal3, ($s1, $s3) -> max($s1.getValue(), $s3.getValue()))
        .zipWith($signal4, ($s1, $s4) -> max($s1.getValue(), $s4.getValue()))

 

Edited by Krista Novstrup
  • Like 1
Link to comment
Share on other sites

  • 7 months later...
  • Administrators

Prior to Seeq Version 21.0.43, if a user wanted to calculate the minimum or maximum of multiple signals, the following syntax was required in Formula:

$a.max($b).max($c).max($d)

However, for Seeq Versions 21.0.43 and more recent, the .min() and .max() operators now accept the following, simpler syntax.  

max($a,$b,$c,$d)

This improved syntax is also now supported with the .average() operator, as well.

Link to comment
Share on other sites

  • 1 year later...
  • Seeq Team

Hi Brian,

In more recent versions of Seeq, the max function used in that way (that specific syntax or form) only works with scalars.

For your case, try $p53h2.max($p53h3).max($p53h4)

That is the form needed with signals.

Hope this helps!

John

  • Like 2
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...