2 * INSN_CONFIG_FILTER example
5 * Copyright (c) 1999,2000 David A. Schleef <ds@schleef.org>
6 * Copyright (c) 2007 Frank Mori Hess <fmhess@users.sourceforge.net>
8 * This file may be freely modified, distributed, and combined with
9 * other software, as long as proper attribution is given in the
13 * Requirements: A board with a subdevice that supports
14 * INSN_CONFIG_FILTER, such as the PFI subdevice on an NI m-series
21 #include <comedilib.h>
34 int main(int argc, char *argv[])
37 lsampl_t filter_selection;
38 struct parsed_options options;
40 init_parsed_options(&options);
41 parse_options(&options, argc, argv);
43 device = comedi_open(options.filename);
45 comedi_perror(options.filename);
48 filter_selection = options.value;
49 printf("Selecting filter %d on subdevice %d channel %d.\n", filter_selection, options.subdevice, options.channel);
51 retval = comedi_set_filter(device, options.subdevice, options.channel, filter_selection);
52 if(retval < 0) comedi_perror("comedi_do_insn");