Sonar with APM 2.6

i’m using maxbotix MB 1200 EZ0 sonar with apm 2.6 and it is showing values in misssion planner but when i fly quadcopter it uses barometer instead of sonar… does anybody know the solution ?