function [isVal] = invKin(H,posX,posY,posZ)

globalVar;

param1 = bitand(posX,MASK_HIGH) / 256;
param2 = bitand(posX,MASK_LOW);
param3 = bitand(posY,MASK_HIGH) / 256;
param4 = bitand(posY,MASK_LOW);
param5 = bitand(posZ,MASK_HIGH) / 256;
param6 = bitand(posZ,MASK_LOW);

sendServo(H,1,INV_KIN,param1,param2,param3,param4,param5,param6);            

disp('  RESULTS  ');
return1 = 0;
[command,return1,return2,return3] = readServo(H);
if(command ~= INV_KIN)
    disp('OPERATION FAILED: Testing Inverse Kinetic');
end
switch (return1)
    case 0
        disp('Fora dos Limites');
    case 1
        disp('Inverse Kinetic is working.');
    case 2
        disp('ERRO: OUT1 of WorkVolume');
    case 3
        disp('ERRO: OUT2 of WorkVolume');
    case 4
        disp('ERRO: OUT3 of WorkVolume');
    case 5
        disp('ERRO: OUT4 of WorkVolume');
end

isVal = return1;

end


