# GetSignal filter by unit not working

**URL:** <https://tech-community.robotics.abb.com/t/getsignal-filter-by-unit-not-working/10247>\
**Category:** Developer Tools\
**Created:** [June 9, 2021, 2:10pm UTC](https://tech-community.robotics.abb.com/t/getsignal-filter-by-unit-not-working/10247 "2021-06-09T14:10:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tompanhuhu](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/tompanhuhu/32/3366_2.png) [@Tompanhuhu](https://tech-community.robotics.abb.com/u/Tompanhuhu)\
**Post date:** [June 9, 2021, 2:10pm UTC](https://tech-community.robotics.abb.com/t/getsignal-filter-by-unit-not-working/10247/1 "2021-06-09T14:10:37Z")

</div>

Hi I’m trying to get all signals belonging to a specific unit, but it returns all signals in the system.

```auto
            IOFilterTypes aSigFilter = IOFilterTypes.Digital & IOFilterTypes.Unit;
            foreach (Signal sig in unit.Controller.IOSystem.GetSignals(aSigFilter, unit.Name))
            {
                    Console.WriteLine(sig.Name + " = " + sig.Value);
            }

```

Am I doing something wrong?  
Latest RW and PCSDK.

---

<div class="post-metadata">

**Author:** ![Tompanhuhu](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/tompanhuhu/32/3366_2.png) [@Tompanhuhu](https://tech-community.robotics.abb.com/u/Tompanhuhu)\
**Post date:** [March 10, 2022, 7:04am UTC](https://tech-community.robotics.abb.com/t/getsignal-filter-by-unit-not-working/10247/2 "2022-03-10T07:04:28Z")

</div>

Hi, this filtering feature still dosent work.  
It feel’s like the performance would have been alot better in my app if I didn’t get all the signals in the system.

---

<div class="post-metadata">

**Author:** ![Markus\_Naslund](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@Markus\_Naslund](https://tech-community.robotics.abb.com/u/Markus_Naslund)\
**Post date:** [March 13, 2022, 7:14am UTC](https://tech-community.robotics.abb.com/t/getsignal-filter-by-unit-not-working/10247/3 "2022-03-13T07:14:57Z")

</div>

Hi,

When adding two filters together, you should use the bitwise or flag (|).  
If you use bitwise and (&) it will in this case result in 0, which I suppose means no filter, and that is why you get all signals.

Try this instead

```auto
            IOFilterTypes aSigFilter = IOFilterTypes.Digital | IOFilterTypes.Unit;
            foreach (Signal sig in unit.Controller.IOSystem.GetSignals(aSigFilter, unit.Name))
            {
                    Console.WriteLine(sig.Name + " = " + sig.Value);
            }

```
