Thanks for the answer,

I now can't get the process to runn periodic.
I try folloing calls inside the process wich is started whith
rt_task_resume after initialisation.
  start_time =  msec2start * 1000 * 1000;       //start in X nanosec
  rt_sleep( nano2count( start_time ) );

  rt_set_periodic_mode();
  rtl_printf ( KERN_DEBUG
                           "RTAI dmm16: going to make reading thread periodic.\n" );
  if ( rt_task_make_periodic_relative_ns( rt_whoami(),
                                          1000000,
                                          period ) != 0 ){
    rtl_printf( KERN_ERR "RTAI dmm16: error making reading thread
periodic\n");
    return;                               
  }

  do {
        rt_task_wait_period( );
        ...

  }while(1)
 
I set the period to 500000 ns maybe this is to less. I greped my mail
folder, and found a message where someone wrote that the period has to
be between 1ms and 10ms. Values greater 10ms are set to 10ms but what
about values less 1ms?
After the above call .._periodic_.. the task seems never to be waked up.

Paolo Mantegazza wrote:
> 
> Vasili Goutas wrote:
> >
> > Hi
> > I'm using rtai-1.4 with linux-2.2.16.
> > I have a problem using the function nano2count.
> >
> > rt_printk ( KERN_DEBUG
> >            "RTAI dmm16: going to make reading thread periodic. period = %lu,
> > nano2count(period) = %lu\n", period, nano2count(period) );
> >
> > gives me the following output:
> >
> > <7>RTAI dmm16: going to make reading thread periodic. period =
> > 500000000, nano2count(period) = 0
> 
> Above you try to write an %llu with just %lu. What you get is
> unpredictable.
> Note that you cannot use %llu within the kernel. You should be enough
> with:
> rt_printk ( KERN_DEBUG "RTAI dmm16: going to make reading thread
> periodic. period = %lu, nano2count(period) = %lu\n", (usigned
> long)period, (unsigned long) nano2count(period) );
> 
> > After the call of
> > rt_task_make_periodic_relative_ns( &thread[DMM16_THREAD_READING],
> >                                    nano2count( start_time ),
> >                                    nano2count( period ) ) != 0 )
> >
> > the system freezes because of the task code wich will than runn
> > permanent.
> 
> The above is used incorrectly, see the new PDF manual at:
> 
> http://www.aero.polimi.it/projects/rtai/.
> 
Someone should add the newest documentation to the rtai-1.4 package.

> Assuming delay_from_now and period are in nanoseconds it goes as:
> 
> rt_task_make_periodic_relative_ns(&thread[DMM16_THREAD_READING],
> delay_from_now, period);
> 
> Even if you have no manual, rgrep the wealth of available examples and
> you'll immediately get how it is used.
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to