Seeq Team Sean T Posted October 16, 2019 Seeq Team Share Posted October 16, 2019 (edited) Can I compare signals in Formula to create conditions rather than doing a Value Search? Edited December 1, 2023 by Kelly Kolotka Link to comment Share on other sites More sharing options...
Seeq Team Solution Ben Johnson Posted October 16, 2019 Seeq Team Solution Share Posted October 16, 2019 (edited) When creating a value based condition, the usual default is the Identify -> Value Search tool, but it is also possible using Formula with common math operators like <, <=, >, >=, == (is equal to), != (is not equal to), and && (logical and) 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. For more information, search for "Comparisons" 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: 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') Content Verified DEC2023 Edited December 1, 2023 by Kelly Kolotka 1 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