plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.

In the upcoming flighting, we've changed the behaviour of the content.xml file. If your addon uses this file, please read this article!

Please take a moment to read the platform’s guidelines before you get started!


question

Abtzero avatar image
Abtzero asked B21 answered

How to use simvar values for actual Heading and Altitude

When I read with javascript:
var alt = SimVar.GetSimVarValue("K:INDICATED ALTITUDE", "feet");

I get an exponential expression. Maybe it is the wrong variable.

Also with

HDG = SimVar.GetSimVarValue("AUTOPILOT HEADING LOCK DIR", "degrees");

LT = SimVar.GetSimVarValue("AUTOPILOT ALTITUDE LOCK VAR", "feet");
VS = SimVar.GetSimVarValue("AUTOPILOT VERTICAL HOLD VAR", "feet/minute");


I want to get the actual values for aircraft heading, altitude and vertical speed in number that I can work with.

EDIT: Now I got the right simvars, In general: These are aircraft variables and so they must start with A:

Those work:

"A:PLANE HEADING DEGREES TRUE", "degrees"

"A:PLANE ALTITUDE", "feet"

"A:VERTICAL SPEED", "feet/second" (* 60 gives feet/minute)

html
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

1 Answer

·
B21 avatar image
B21 answered

good job posting the correct answer to your own question - this forum really seems to be off the radar for most developers which is a shame.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.