Re: continous triggered acquisition with pci-das4020/12

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 08 August 2003 09:53 am, Patryk M. Gutowski wrote:
> I'm trying to make the pci-das4020/12 card to acquire data under
> following conditions:
> after the trigger, card should read an event of over 1500 samples from
> each channel with frequency of 10MHz. Trigger comes with an analog BNC
> input.
> I figure out that I should use comedi_command(), and use the following:
> cmd->start_src = TRIG_NOW;
> cmd->start_arg = 0;
> cmd->scan_begin_src = TRIG_EXT;
> cmd->scan_begin_arg = 1000;
> cmd->convert_src = TRIG_TIMER;
> cmd->convert_arg = 100;
> cmd->scan_end_src = TRIG_COUNT;
> cmd->scan_end_arg = n_chan;
> cmd->stop_src = TRIG_NONE;

The closest you could do would be something like

cmd->start_src = TRIG_EXT;
cmd->start_arg = 1000;
cmd->scan_begin_src = TRIG_TIMER;
cmd->scan_begin_arg = 100;
cmd->convert_src = TRIG_NOW;
cmd->convert_arg = 0;
cmd->scan_end_src = TRIG_COUNT;
cmd->scan_end_arg = n_chan;
cmd->stop_src = 1500;

and you'll have to start a new command after each 1500 samples is 
triggered.

>
> I receive some data in the program, but when i try to launch it for a
> second time computer hangs.

Well, there's clearly a driver bug if your computer is crashing.  The 
TRIG_EXT stuff isn't tested that well, but it's odd considering you 
weren't even using it (see below).

> I included some test code below...modified versions of some of the
> examples.
> I'm using comedi and comedi libs from cvs, debian testing, kernel 2.4.21
>
>
> What am I doing wrong?
> Thanks
>

You've got the wrong function commented out:

> 	/* prepare_cmd_lib() uses a Comedilib routine to find a
> 	 * good command for the device.  prepare_cmd() explicitly
> 	 * creates a command, which may not work for your device. */
> 	prepare_cmd_lib(dev,subdevice,cmd);
> 	//prepare_cmd(dev,subdevice,cmd);
>

- -- 
Frank

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/M+E55vihyNWuA4URAlhbAJ49oyZyR/xfEfPtbl5hOztnT7T3LQCeKlY3
kINVi9L+EvnyR0KfMBDj4vk=
=qtCt
-----END PGP SIGNATURE-----

Received on 2003-08-08Z16:43:18