Jump to content

Converting a Condition to a Signal


Recommended Posts

  • Seeq Team

A common analytics need is to create a signal with numerical values that are based on an existing condition. Users often want to translate a condition (on/off, good data/bad data, running/down, etc.) to a numerical value to be used in calculations. For example, a user may want to multiply a process signal by a 0/1 value based on when the process is down/running. This technique can also be used to replicate "if" logic or "if / else" logic, where different values are returned depending on if the condition is true/false. 

Converting a condition to a signal value can be easily accomplished in Seeq using the Formula Tool and the splice function. Here is an example where we convert a condition to a signal of 0s and 1s:

 

1. Use the Value Search Tool to create a HOT condition for time periods when the Temperature signal is > 90 degrees F:

HOTCond1.JPG

 

2. Use the Formula Tool to convert the HOT condition to a 1 (when condition is true) and a 0 (when condition is false):

SpliceFormula1.JPG

 

3. View the results in the trend. The new signal in lane 2 has a value of 1 when the HOT condition is true. Otherwise the signal is 0.

Trend1.JPG

 

Additional Information

Using Conditions and the Splice Function to Replace If Statements

 

 

Edited by John Cox
minor formatting issue
  • Like 1
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...