4 After installing comedi and comedilib, cd to this directory (comedilib*/demo).
6 Use ./info for a very first test. If hardware and software are correctly
7 installed, the program prints a list of subdevices it recognises. If the
8 device is not /dev/comedi0, use here and in the following the command-line
11 Continue with ./inp -s <subdevice> -c <channel> to read individual samples,
12 and with ./outp -s <subdevice> -c <channel> <integer value> to set an
13 output value. Other beginning demos are: cmd, dio, inpn, tut1, tut2.
14 You should understand how these work before trying to understand the
17 The perl subdirectory contains a few examples for the perl wrapper.
23 You need a device (and driver) capable of streaming analog output,
24 which currently is some of the members of the NI AT-MIO and PCI-MIO
25 E series. Creates a sine wave on an analog output channel.
28 This is not an example. The file common.c just contains some code
29 that is common to many of the examples.
32 An example for directly using Comedi commands. Comedi commands
33 are used for asynchronous acquisition, with the timing controlled
34 by on-board timers or external events.
37 Requirements: A board with a digital I/O subdevice. Not just
38 a 'digital input' or 'digital output' subdevice, but one in
39 which the channels can be configured between input and output.
42 Dumps the EEPROM of a card, if it has one. Useful for debugging
46 Displays some information that Comedi knows about a device.
49 Simple input: Reads one sample from one channel on one subdevice.
52 Slightly more complicated input demo. (It has a for() loop.)
53 Reads each channel on a subdevice, at every possible input
54 range, and converts the data to a voltage.
57 Example showing how to use instructions directly. Not
58 recommended for beginners: use higher-level functions such
59 as comedi_data_read(), comedi_data_write(), etc., as demonstrated
60 in the inp, outp, and dio examples.
63 This demo requires a Fantazein clock modified to be directly
64 controlled by the parallel port on a computer. The original
65 demo used a real-time task and controlled the parallel port
66 directly. This version is not complete.
69 This example shows how to map the internal Comedi buffer
70 and directly access samples instead of using read() and
74 Write one <value> to one channel of one subdevice. Requires
75 a digital or analog output subdevice.
78 This demo is meant to be used in conjunction with the sender
79 demo. Receiver requires a digital input subdevice, and sender
80 requires a digital output subdevice. When the clock and data
81 pins are connected between the sending and receiving devices,
82 one should be able to send bits over the link.
85 An example for using select() with asynchronous input. This
86 example requires an asynchronous input subdevice that can
87 handle TRIG_TIMER as a scan_begin_src.
93 Similar to the cmd demo. This demo sets up a signal handler
94 for SIGIO, which is called whenever data is ready to be read
98 Similar to inp, but measures the input using the comedi_sv_*()
99 functions, which average many samples to try to get a more accurate
100 estimate of the actual input.
104 Tutorial examples. See the Comedilib documentation.
107 COMMAND-LINE OPTIONS:
109 Many of these demos are linked with the file common.c, which parses
110 command line options. Some options don't make sense with all programs.
113 -a <aref> use analog reference <aref> (default: 0 == ground)
114 -c <chan> use channel <chan> (default: 0)
115 -s <subd> use subdevice <subd> (default: 0)
116 -r <index> use voltage range <index> (default: 0)
117 -f <file> use device file <file> (default: /dev/comedi0)
118 -n <value> use <value> for the number of channels in a scan
119 -N <value> use <value> for the number of scans
120 -F <freq> use <freq> as the scan frequency
122 -d set analog reference to differential
123 -g set analog reference to ground
124 -o set analog reference to other
125 -m set analog reference to common