
i=0;
while(1)
        
    [rx1,err1,es1]=applyjoint(h,1,0,[0 0 0]);
    %rx1
    if (err1)
        break;
    end
    
    [s2,st,rx2,err2,es2]=readjoint(h,1,0);
    %rx2
    if (err2)
        break;
    end
    
    [rx3,err3,es3]=applyjoint(h,3,0,[0 0 0]);
    %rx3
    if (err3)
        break;
    end

    [s4,st,rx4,err4,es4]=readjoint(h,3,0);
    %rx4
    if (err4)
        break;
    end

    if (mod(i,100)==0),  fprintf('i=%d\n',i); end
    
    i=i+1;
end

disp 'Erro'
err1
err2
err3
err4