Re: instruction list problem

On 17/08/07, Dimitris Xydas <dxydas_at_yahoo.com> wrote:
> Hi,
>
> I have some questions regarding the use of
> instructions.
> Using the instruction demo (insn) example seems to
> read fine from my das1200 subdevice 1 (analog o/p).
> But trying to send a list of instructions including a
> write  command does not seem to work. For example
> replacing read with write (using
> insn[1].insn=INSN_WRITE;) in this demo and setting up
> a test set of samples to write:
> data[0] = 1000;
> data[1] = 1000;
> data[2] = 0;
> data[3] = 0;
> data[4] = 1000;
> data[5] = 1000;
> data[6] = 1000;
> data[7] = 0;
> data[8] = 0;
> data[9] = 0;
> I run the prog but only data[0] seems to be applied to
> the o/p, which I can see through the
> ComediClientServer application. Shouldn't all 10 data
> samples be written to the o/p sequentially?

  Checking the driver for the DAS1200, it only writes the first sample
(data[0]) on the output, no matter how big array you pass on with the
instruction. So, this way you cannot output more than one sample with
the instruction.

  Also, probably it would be better to use  comedi_data_write() for
your program, if you just want to output the values. Place it in a for
loop for the multiple data points. You might have to do some pacing of
the output if you want reliable update rate, but that is a completely
different story....

     Best wishes,
           Greg

Received on 2007-08-17Z11:10:38