AW: Comedi command

Hello Anne,

I had a similar problem with the DAS16-driver. Not all reasonable
combinations are allowed, in case of doubt you probably need to have a
look into the driver sources. But were "my" driver would not work is :
Cmd.start_src = TRIG_EXT	-> try: Trig_now
Cmd.scan_begin_src=Trig_EXT	-> try: TRIG_FOLLOW
Cmd.convert.src = TRIG_NOW	-> try: TRIG_EXT

With this changes "my" driver would work, maybe yours too! :-)

Good luck

Jan

-----Ursprüngliche Nachricht-----
Von: comedi-admin_at_comedi.org [mailto:comedi-admin_at_comedi.org] Im Auftrag
von Anne Smorthit
Gesendet: Donnerstag, 5. Juni 2003 14:25
An: comedi_at_comedi.org
Betreff: Comedi command


In my application program I am trying to read analogue inputs and set up
the 
command structure as follows:

    for (i = 0; i < N_CHANS; i++)
        chanlist[i] = CR_PACK(i, range[i], ref);

    /* Fill in the command data structure: */
    cmd.subdev            = subdev;
    cmd.flags                = 0;
    cmd.start_src           = TRIG_EXT;          // Start acquisition on

external signal
    cmd.start_arg           = 0;                      // Front panel
gate 
input
    cmd.scan_begin_src = TRIG_EXT;         // Start scan on external
signal
    cmd.scan_begin_arg = 0;                     // Front panel clock
input
    cmd.convert_src       = TRIG_NOW;       // Simultaneous acquisition
    cmd.convert_arg       = 0;
    cmd.scan_end_src    = TRIG_COUNT;   // End scan after N_CHANS
channels
    cmd.scan_end_arg    = 8;
    cmd.stop_src            = TRIG_COUNT;   // End acquisition after
N_SCANS 
scans
    cmd.stop_arg            = N_SCANS;

    cmd.chanlist       = chanlist;
    cmd.chanlist_len   = N_CHANS;

    // Check the command
    ret = comedi_command_test(it, &cmd);
    if (ret < 0) {
	comedi_perror("comedi_command_test");
        printf("ret = %d\n", ret);
	if (errno == EIO) {
	    fprintf(stderr, "Ummm... this subdevice doesn't support
commands\n");
	}
	return (-1);
    }

When I run the program I get :

comedi_command_test: Invalid argument
ret = -1

Does anyone have any ideas which argument I have got wrong?

Anne Smorthit
RUAG Aerospace, Postfach 301, CH-6032 Emmen, Switzerland
Tel : +41 41 268 2355
Mail to: anne.smorthit_at_sfwte.ch

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail


_______________________________________________
comedi mailing list
comedi_at_comedi.org https://cvs.comedi.org/cgi-bin/mailman/listinfo/comedi

Received on 2003-06-05Z11:51:45