Forum Migration Notice
We're transitioning to a more modern community platform by the end of this year. Learn about the upcoming changes and what to expect.
How to fix the problem in filtering the signals in PC SDK application?
Answers
-
SignalCollection Signals = MainController.IOSystem.GetSignals(IOFilterTypes.Digital).Where(o => o.Type == SignalType.DigitalInput) as SignalCollection;
Should be able to use linq to filter these out. Not sure if it works with a collection, you may have to parse through signals individually. Alternatively use the code below.SignalCollection Signals = MainController.IOSystem.GetSignals(IOFilterTypes.All); foreach(Signal signal in Signals) { if (signal.Type == SignalType.DigitalInput) { // Do something here to inputs } }
0 -
Hello,
I think you have to use a binary OR (|) instead of a binary AND (&) to be able to use several filter settings.var Signals = <span>MainController.</span>IOSystem.GetSignals(<b>IOFilterTypes.Digital | IOFilterTypes.Input</b>);
Best regards
Micly0
Categories
- All Categories
- 5.6K RobotStudio
- 401 UpFeed
- 21 Tutorials
- 15 RobotApps
- 306 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.9K Robot Controller
- 365 IRC5
- 84 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 854 RAPID Programming
- 37 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 110 Collaborative Robots
- 5 Job listings

