function [command,return1,return2,return3]=readSensor(H)

globalVar;

rxmsg = fread(H,MSG_LENGTH,'uint8');

select = rxmsg(1);
if(select == SENSOR_SEL)
    command = rxmsg(2);
    return1 = rxmsg(3);
    return2 = rxmsg(4);
    return3 = rxmsg(5);
else
    disp('OPERATION FAILED: select ~= SENSOR_SEL');
end

end