- From: David Schleef <ds_at_schleef.org>
- Date: Fri, 20 Sep 2002 13:52:28 -0700
On Fri, Sep 20, 2002 at 03:17:38PM -0500, Tim Holy wrote:
> Hello,
>
> Would it be worthwhile adding an n_channels parameter to the end of the call
> for comedi_get_cmd_generic_timed? I notice that if I set up a timed analog
> input command, then fill in a channel list with 6 channels, then pass it
> through comedi_command_test, the scan rate is 1/6 of what I meant it to be.
> This occurs because scan_begin_arg and convert_arg get set by
> comedi_get_cmd_generic_timed to the same value, and command_test believes
> convert_arg rather than scan_begin_arg when it detects a conflict.
comedi_get_cmd_generic_timed() is only really useful in the 1-channel
case.
If you want to use it for multichannel, you need to fix up the
command using:
if(cmd->scan_begin_src==TRIG_NEXT){
cmd->convert_arg /= n_channels;
}else{
cmd->convert_arg = 1;
}
Naturally, this bit of code should probably be made into a Comedilib
function. comedi_get_cmd_generic_timed() was _supposed_ to do
multichannel, but I made some obvious logic mistakes, and now it's
part of the API.
dave...
Received on 2002-09-20Z19:52:28