Hello, I have wrote a program according to Igh user examples and it run well now in controlling my servo motor. I tried to get time spent of the cyclic_task() function and found it would be more than 40 us for several times while others are almost less than 30 us. In the cyclic_task() function, there are just some domain receive and send work. Does these long times are occurred because of the AL state was changing before the servo run into op state?
Below are my get time code to find the maximum time the cyclic_task() function will cost in loop while: pause(); struct timeval t1,t2; uint32_t delta1; static uint32_t delta2=0; gettimeofday(&t1, NULL); printf("%u.%06u cyclic start\n", t1.tv_sec, t1.tv_usec); cyclic_task(); gettimeofday(&t2, NULL); printf("%u.%06u cyclic end\n", t2.tv_sec, t2.tv_usec); delta1 = (t2.tv_sec - t1.tv_sec)*1000000 + (t2.tv_usec-t1.tv_usec); if(delta2 < delta1) { delta2 = delta1; printf("delta2 %d\n", delta2); } The output results were a lot, but like this: test1: Configuring PDOs... Activating master... Starting timer... Started. 1458617764.700566 cyclic start 1458617764.700588 cyclic end delta2 22 ... 1458617764.714150 cyclic start 1458617764.714155 cyclic end 1458617764.714251 cyclic start 1458617764.714294 cyclic end delta2 43 1458617764.714351 cyclic start 1458617764.714357 cyclic end ... 1458617764.720957 cyclic start 1458617764.720972 cyclic end 1458617764.721057 cyclic start 1458617764.721106 cyclic end delta2 49 1458617764.721158 cyclic start 1458617764.721170 cyclic end 1458617764.721256 cyclic start 1458617764.721267 cyclic end 1458617764.721357 cyclic start 1458617764.721371 cyclic end ... test2: Configuring PDOs... Activating master... Starting timer... Started. 1458618364.657068 cyclic start 1458618364.657090 cyclic end delta2 22 1458618364.657146 cyclic start 1458618364.657153 cyclic end ... 1458618364.677251 cyclic start 1458618364.677262 cyclic end 1458618364.677351 cyclic start 1458618364.677399 cyclic end delta2 48 1458618364.677462 cyclic start 1458618364.677474 cyclic end ... 1458618364.704543 cyclic start 1458618364.704548 cyclic end 1458618364.704643 cyclic start 1458618364.704713 cyclic end delta2 70 1458618364.704747 cyclic start 1458618364.704752 cyclic end 1458618364.704843 cyclic start 1458618364.704849 cyclic end ... Thanks for attention! -- -------------------end--------------------- --Yin(^-^)
_______________________________________________ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users