Hi

So let me summarise:
- With rtcansend/rtcanrecv and without your application the communication with
the node is perfect (overflows?)
No more overflows. Nowhere. Have the debug messaging back on,
everything is quiet. Especially witht he blocking mode construction
overflowing should (and is) be impossible.

- With your application running you state that the real-time behaviour of the
system is bad. How do you detect this?
I measure the period times. Here is the snippet


void cyclicloop(void *arg)
{
        RTIME now, previous;

        /*
         * Arguments: &task (NULL=self),
         *            start time,
         *            period (here: 1 ms=1000000)
         */
        rt_task_set_periodic(NULL, TM_NOW, TASK_PERIOD);
        previous = rt_timer_read();

        while (!TasksHalt) {
                rt_task_wait_period(NULL);
                now = rt_timer_read();
                //Read inputs here
                atm60_configure(can_device);    
                //Set analog output here
                //Do controller calculations here
                

                
                
                //Get time period
                double TimeVarTemp=(double)(now - previous);
                Task1Period=TimeVarTemp/ 1000000;
                //printf("Time since last turn: %f ms\n",Task1Period);
                previous = now;

                /*
                 * NOTE: printf may have unexpected impact on the timing of
                 *       your program. It is used here in the critical loop
                 *       only for demonstration purposes.
                */
                
        }
}//cyclicloop

void catch_signal(int sig)
{
}


void task1(void)
{
        signal(SIGTERM, catch_signal);
        signal(SIGINT, catch_signal);

        // Avoids memory swapping for this program
        //Not necessary here because QTThread must take care of this.Only
needed once inthe entire program (multithread) Jan Kizka email
        //Apparently IS necessary application otherwise seems to crash.
placed in main()
        //mlockall(MCL_CURRENT|MCL_FUTURE);

        //
         // Arguments: &task,
         //            name,  [Name must be unique for each task]
         //            stack size (0=default),
         //            priority,
         //            mode (FPU, start suspended, ...)
         //
        rt_task_create(&rt_task_1, "rt_task1", 0, 99, 0);

        //
         // Arguments: &task,
         //            task function,
         //            function argument
         //
        rt_task_start(&rt_task_1, &cyclicloop, NULL);

        //if(!Task1Halt)
        //      pause();

        //rt_task_delete(&rt_task_1);

}

its actually straight from the trivial task example. The TaskPeriod1
is a global variable which is displayed in another thread every 0.5
seconds.

Roland



--
Sebastian


_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to