Jump to content

Compare Signals in Formula


Sean T

Recommended Posts

  • Seeq Team

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:

hightemp.png

Signal and scalar comparison with logical and:

highttempstage1.png

Signal against Signal:

image.png

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

Link to comment
Share on other sites

  • Kelly Kolotka changed the title to Compare Signals in Formula

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...