Re: nervous about command timing

Hi!

I do this usually with two comedi commands. One to aquire the data and 
one which sends out the stuff. Under 2.6 with the preemptive option I 
get 1kHz realtime I/O with just a "while (1)"-loop. My colleague Tao is 
controlling a walking robot in that way. I've copied the mail to him.

/Bernd

www:    http://www.berndporr.me.uk/
         http://www.linux-usb-daq.co.uk/
Mobile: +44 (0)7840 340069
Work:   +44 (0)141 330 5237
         University of Glasgow
         Department of Electronics & Electrical Engineering
         Room 519, Rankine Building, Oakfield Avenue,
         Glasgow, G12 8LT


Nils Juergens wrote:
> On Fri, 01.10.04, Michael Thomas <Michael.Thomas_at_dynetics.com> wrote:
> 
> 
>>trigger?  That still wouldn't help my user code stay synced up.  It just
>>seems there should be a better way.
> 
> 
> If it's a real time problem (it smells like one :-)) ) you need a real time
> system, e.g. RTAI.
> 
> It might work like this:
> 
> * create an RTAI task
> * make task periodic
> 
> in the task (via kcomedilib)
> * read samples (comedi_do_insn())
> * do stuff (calculations etc.)
> * write samples (comedi_do_insn())
> 
> I think it's also possible to combine this method and comedi_command (for
> increased performance and decreased jitter in the sampling periode).
> 
> hth,
> Nils
> 

Received on 2004-10-04Z12:56:20