Hello,
I won't be able to run your code immediately because you use the DAQ assistant which makes it hardware dependent - however if you can post the error message I will try to help you further. Also, you should definitely check out the shipping examples in the example finder, as you'll find filtering examples there to serve as an example for you!
Best Regards,
JLS