Seeq Team John Cox Posted June 28, 2019 Seeq Team Share Posted June 28, 2019 (edited) 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. Content Verified DEC2023 Edited December 1, 2023 by Chris Harp Content Verified DEC2023 Link to comment Share on other sites More sharing options...
Seeq Team Krista Novstrup Posted July 3, 2019 Seeq Team Share Posted July 3, 2019 (edited) 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. 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 July 3, 2019 by Krista Novstrup 1 Link to comment Share on other sites More sharing options...
Brian Hoyler Posted February 18, 2022 Share Posted February 18, 2022 When I try this syntax I get an error in the formula. I am at version R50.4.4 Formula max($p53h2,$p53h3,$p53h4) ⬆ No variant of function 'max' consumes the parameters (Signal, Signal, Signal) at 'max' Link to comment Share on other sites More sharing options...
Seeq Team John Cox Posted February 18, 2022 Author Seeq Team Share Posted February 18, 2022 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 2 Link to comment Share on other sites More sharing options...
Administrators Teddy Posted February 18, 2022 Administrators Share Posted February 18, 2022 Writing it like the following is only supported for scalars: max($a,$b,$c,$d) If you want to use signals you will need to write it this. $signalA.max($signalB).max($signalC).... Link to comment Share on other sites More sharing options...
Brian Hoyler Posted February 18, 2022 Share Posted February 18, 2022 This worked. thank you Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now