Jump to content

Some New Ways to Compare Signals in Formula


Sean T

Recommended Posts

  • Seeq Team

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:

hightemp.png

Signal and scalar comparison with logical and:

highttempstage1.png

Signal against Signal:

image.png

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

  • Seeq Team

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')

 

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

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