Seeq Team Sean T Posted October 16, 2019 Seeq Team Share Posted October 16, 2019 As of Seeq R21.044 we have a couple interesting new ways to compare signals in formula! When creating a value based condition, the usual default is the value search tool, but it has always been possible using formula as well, however these functions have typically been limited to signal against scalar comparisons. As of R21.044 however, common math operators like <, <=, >, >=, == (is equal to), != (is not equal to), and && (logical and) are all available for use as signal against scalar, or signal against signal comparisons! Whenever the mathematical condition is met, a condition will be created just like a typical value search, however unlike value search the mathematical operators in formula will also work with two signals. For more information, search for "Comparison Functions for Signals" in your formula documentation. Here are a few examples of these operators in use: Signal and scalar comparison: Signal and scalar comparison with logical and: Signal against Signal: For a full list of whats new in R21.044 check out this KB article: https://seeq12.atlassian.net/wiki/spaces/KB/pages/571375775/What+s+New+in+R21.0.44 Link to comment Share on other sites More sharing options...
Seeq Team Ben Johnson Posted October 16, 2019 Seeq Team Share Posted October 16, 2019 In addition to the common math symbols, there are also some new concise ways to search for other signal states: $signal.isValid() - make a condition that enumerates when the signal has data $signal.isNotValid() - make a condition that enumerates the gaps in the signal $signal.isBetween(10, 20) - make a condition whenever the signal is between 10 and 20 $signal.isNotBetween(10, 20) - make a condition whenever the signal is outside the boundary of 10-20 Also for string signals, you can search for regular expressions or glob-like syntax: $signal ~= "*STAG*" - find whenever the state signal contains "STAG". $signal !~ "*STAG*" - find whenever the state signal does not contain "STAG". All of these things can be combined and given precedence with parenthesis. For example, to find "when is temp < 90 and either of humidity > 60 or compressor is off " $temp < 90 && ( $humidity > 60 || $compressor == 'OFF') 1 Link to comment Share on other sites More sharing options...
IsaacNZ Posted April 1, 2020 Share Posted April 1, 2020 Hello, Is there a way to compare signals (i.e. is greater than, is equal to etc.) prior to R21.044? Kind regards, Isaac Link to comment Share on other sites More sharing options...
Seeq Team Ben Johnson Posted April 1, 2020 Seeq Team Share Posted April 1, 2020 Comparing 2 signals in earlier versions requires a bit more slight of hand, comparing the difference between the two signals to 0. $s1 > $s2 is the same as ($s1-$s2).valueSearch(isGreaterThan(0)) This is 2 1 Link to comment Share on other sites More sharing options...
IsaacNZ Posted April 1, 2020 Share Posted April 1, 2020 Ah that's great, thanks Ben! 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