# Condition based on multiple signals

## Recommended Posts

Hi, I have 50 signals. I want to check if any of the signal has value 1.

How can create new signal (or capsule) based on this check condition?

##### Share on other sites
• Seeq Team

Hi Prachi,

A couple different options for you:

Option 1

You're probably familiar that you can use Formula (or Value Search) with the following to create a capsule for when one signal is equal to 1:

`\$signal==1`

Therefore, one option is to combine this search together for each signal using the combinewith function:

`combinewith(\$signal1==1, \$signal2==1, ... , \$signal50==1)`

This will create a capsule for each signal equal to 1, which would result in multiple overlapped capsules if more than one signal was equal to 1. If you'd like to reduce that to create a capsule if "any" signal was 1, you could merge those together:

`combinewith(\$signal1==1, \$signal2==1, ... , \$signal50==1).merge()`

Alternately, if you want to know how many signals are equal to 1 at any point in time, you can use countoverlaps:

`combinewith(\$signal1==1, \$signal2==1, ... , \$signal50==1).countoverlaps()`

Option 2

Typically when counting 1 values, the signals are a 0/1 signal where it is 0 when inactive and 1 when active. If this is the case in your use case, an alternate approach could be to sum the signals and find when it is greater than or equal to 1:

`sum(\$signal1, \$signal2, ... , \$signal50) >= 1`

• 2

## Create an account

Register a new account