Hi I’m trying to get all signals belonging to a specific unit, but it returns all signals in the system.
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.
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.
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
IOFilterTypes aSigFilter = IOFilterTypes.Digital | IOFilterTypes.Unit;
foreach (Signal sig in unit.Controller.IOSystem.GetSignals(aSigFilter, unit.Name))
{
Console.WriteLine(sig.Name + " = " + sig.Value);
}