Jump to content
The simFlight Network Forums

FsLook var names to offset values


Ed01

Recommended Posts

Hi,

In FsLook, there's a listing of a lot of various variables with there current values.

I've designed an application that uses FSUIPC and I wish to retrieve this variables thanks to there offsets. The problem is that I don't know how to get the offset of a variable (in which documentation can I find this mappings ?). In the documentation "FSIUPC for Programmers.doc", there's some of the offsets linked to some of these variables but not all the variables are listed !

For exemple, I'd like to retrieve the value of the variable called RADIO_HEIGHT in FSLook. At which offset must I query for it ?

thanks

Ed

Link to comment
Share on other sites

In FsLook, there's a listing of a lot of various variables with there current values.

They are Gauge variables, available to FS gauges.

I've designed an application that uses FSUIPC and I wish to retrieve this variables thanks to there offsets. The problem is that I don't know how to get the offset of a variable (in which documentation can I find this mappings ?). In the documentation "FSIUPC for Programmers.doc", there's some of the offsets linked to some of these variables but not all the variables are listed !

It is best not to actually use any of the values listed in the second table in that document. They are not guaranteed nor maintained. Please refer to the first, very long table. You should find everything you want somewhere in there. Just not by the Gauge token name, or in the same format.

For exemple, I'd like to retrieve the value of the variable called RADIO_HEIGHT in FSLook. At which offset must I query for it ?

That is a calculated value. It is not efficient for FSUIPC to keep calculating it just in case anyone may want it. To get this for yourself, simply read the Ground Altitude (offset 0020) and the aircraft altitude (offset 0570) and do a subtraction.

Regards,

Pete

Link to comment
Share on other sites

Thanks for your reply Pete...

The problem is that currently my software isn't able to add or substract variables. It provides an interface which allows the user to define a variable (specify a name, the offset, the format, a multiplier) and that's all. Then this variable is used to build ARINC429 frames and send them to an avionic device.

To allow the user to do this kind of things (add, substract and so on), I'll have to change a lot of things on my software and it will make it far more complex ! As the software will be used on different avionics devices, I can't "code in hard" that one specific variable is the sum or substraction of two others but I have to provide the user with an interface to do that (so develop a kind of scripting language that he will be able to use or something like that...).

That's why it would have been far easier for me to use directly an offset to access the RADIO_HEIGHT var for exemple. I don't know if such an offset exists or if you did the substraction in fslook...

Regards,

Ed

Link to comment
Share on other sites

That's why it would have been far easier for me to use directly an offset to access the RADIO_HEIGHT var for exemple. I don't know if such an offset exists or if you did the substraction in fslook...

No, the subtraction is done in FS when FSLook asks for that Gauge Token. It's a clunky inefficient interface which I made only to help original C programmed Gauge makers. The interface and method is not suitable for production programs.

I'm not sure I can offer an alternative to the subtraction at present. How are you handling conversion of all the other funny FS units, such as Latitude/Longitude, is any case? Or is it just that you don't allow values derived from more than one source?

Anyway, I'll check into it for you and see if I can find a way. If I have to calculate it this won't be done continuously, but probably once every few FS frames.

Regards,

Pete

Link to comment
Share on other sites

For variables such as Longitude or Latitude, the user can specify a constant that will multiply with the variable before sending it. So I use the method described in the doc :

If your compiler supports long long (64-bit) integers then use such a variable to simply copy this 64-bit value into a double floating point variable and multiply by 90.0/(10001750.0 * 65536.0 * 65536.0).

The attachment shows the interface provided to define variables...

post-5487-128688983696_thumb.jpg

Link to comment
Share on other sites

That's why it would have been far easier for me to use directly an offset to access the RADIO_HEIGHT var for exemple. I don't know if such an offset exists or if you did the substraction in fslook...

Okay, I've added it to FSUIPC. You'll be able to read the radio height in metres * 65536 in the 32-bit integer at offset 0x31E4. This is supported on all versions of FS from FSUIPC version 3.123 onwards.

Please note that the radio height when on the ground is not going to be zero. it is the height of something in your aircraft and will vary -- it's less than 2 metres in a Cessna 182 but a lot more in a 747, for example. If you want actual difference beteen being on the ground and airborne you'd need to do subtraction of a fixed constant, different for each aircraft, in any case.

I'll be releasing 3.123 within the next couple of days. I'm just waiting for some feedback from testers. It's mainly a quick 'fix' release for some odd problems in 3.12.

Regards,

Pete

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.