comedilib/demo
2001-06-27 22:12:32 +00:00
..
antialias.c 5 new demos 2001-03-01 21:57:00 +00:00
ao_waveform.c made ao_waveform use same parse_options() as other demos 2001-06-27 19:51:11 +00:00
cmd.c Fix previous bugus check-ins. 2001-06-27 22:11:59 +00:00
dio.c 5 new demos 2001-03-01 21:57:00 +00:00
eeprom_dump.c 5 new demos 2001-03-01 21:57:00 +00:00
examples.h 5 new demos 2001-03-01 21:57:00 +00:00
info.c 5 new demos 2001-03-01 21:57:00 +00:00
inp.c 5 new demos 2001-03-01 21:57:00 +00:00
inpn.c 5 new demos 2001-03-01 21:57:00 +00:00
insn.c 5 new demos 2001-03-01 21:57:00 +00:00
ledclock.c Don't need fcntl(,F_SETSIG,) 2001-06-27 22:12:32 +00:00
main.c explicitly initialized value, subdevice, channel, aref and range in main.c 2001-05-14 00:04:08 +00:00
Makefile added poll example 2001-05-28 02:33:03 +00:00
mmap.c explicitly initialized value, subdevice, channel, aref and range in main.c 2001-05-14 00:04:08 +00:00
outp.c 5 new demos 2001-03-01 21:57:00 +00:00
poll.c added poll example 2001-05-28 02:33:03 +00:00
README update from wuttke joachim 2001-06-27 19:42:19 +00:00
receiver.c 5 new demos 2001-03-01 21:57:00 +00:00
select.c 5 new demos 2001-03-01 21:57:00 +00:00
sender.c 5 new demos 2001-03-01 21:57:00 +00:00
sigio.c 5 new demos 2001-03-01 21:57:00 +00:00
sv.c 5 new demos 2001-03-01 21:57:00 +00:00
tut1.c Cleanup of example programs 2000-10-19 06:28:27 +00:00
tut2.c random cleanup 2000-11-30 01:29:10 +00:00

GETTING STARTED:

After installing comedi and comedilib, cd to this directory (comedilib*/demo).

Use ./info for a very first test. If hardware and software are correctly
installed, the program prints a list of subdevices it recognises. If the
device is not /dev/comedi0, you can use the command-line option
'-f <device file>'.

Continue with ./inp -s <subdevice> -c <channel> to read individual samples,
or with ./outp -s <subdevice> -c <channel> <integer value> to set an
output value.


Examples


ao_waveform:
	You need a device (and driver) capable of streaming analog output,
	which currently is some of the members of the NI AT-MIO and PCI-MIO
	E series.  Creates a sine wave on an analog output channel.

cmd:
	An example for using Comedi commands.  Comedi commands
	are used for asynchronous acquisition, with the timing controlled
	by on-board timers or external events.

dio:
	Requirements:  A board with a digital I/O subdevice.  Not just
	a 'digital input' or 'digital output' subdevice, but one in
	which the channels can be configured between input and output.

eeprom_dump:
	Dumps the EEPROM of a card, if it has one.  Useful for debugging
	devices/drivers.

info:
	Displays some information that Comedi knows about a device.

inp:
	Simple input:  Reads one sample from one channel on one subdevice.

inpn:
	Slightly more complicated input demo.  (It has a for() loop.)
	Reads each channel on a subdevice, at every possible input
	range, and converts the data to a voltage.

insn:
	Example showing how to use instructions directly. Not
	recommended for beginners: use higher-level functions such
	as comedi_data_read(), comedi_data_write(), etc., as demonstrated
	in the inp, outp, and dio examples.

ledclock:
	Requirements:  A board with a digital I/O subdevice. Not just
	a 'digital input' or 'digital output' subdevice, but one in
	which the channels can be configured between input and output.

main:
	This is not a demo. The file main.c contains just an auxiliary
	function. See below.

mmap:
	Similar to the cmd demo, except the data is obtained through
	a memory mapping instead of doing read() on /dev/comediX.

outp:
	Write one <value> to one channel of one subdevice.

receiver:
	Requirements:  A board with a digital I/O subdevice.  Not just
	a 'digital input' or 'digital output' subdevice, but one in
	which the channels can be configured between input and output.

select:
	An example for using select() with asynchronous input.  This
	example requires an asynchronous input subdevice that can
	handle TRIG_TIMER as a scan_begin_src.

sender:
	Requirements:  A board with a digital I/O subdevice.  Not just
	a 'digital input' or 'digital output' subdevice, but one in
	which the channels can be configured between input and output.

sv:
	Similar to inp, but measures the input using the comedi_sv_*()
	functions, which average many samples to try to get a more accurate
	estimate of the actual input.

tut1:
tut2:
	Tutorial examples.


Many of these demos are linked with the file main.c, which parses
command line options.  Some options don't make sense with all programs.
The options are:


-a <aref>	uses analog reference <aref> (default: 0)
-c <chan>	uses channel <chan>
-s <subd>	uses subdevice <subd>
-r <range>	uses voltage range <range>
-f <file>	uses device file <file> (default: /dev/comedi0)
-v		verbose
-d		set analog reference to differential
-g		set analog reference to ground
-o		set analog reference to other
-m		set analog reference to common