Jump to content
The simFlight Network Forums

pyuipc help needed : 32-bit float problem


Recommended Posts

Hello all, first post here.

 

I'm using pyuipc with a python script. I can read correctly pretty much all the offsets, except I ran into a problem with 0x2aac : "CDI needle deviation".

 

Docs say it is a 32-bit float, range -127 to +127. Problem is, pyuipc only gives me the option of reading 1, 2, 4 or 8-byte integers, or 8-byte double floats.

 

None of these options seem to yield usable values.

 

Have I missed something ? Can someone kindly point me in the right direction ?

 

with pyuipc I use:

 

pyuipc.read(0x2aac,"f")

 

Any help is appreciated.

 

Thanks to Pete and Istvan for such useful modules.

 

- Miguelito

 

 

Link to comment
Share on other sites

I ran into a problem with 0x2aac : "CDI needle deviation".

Docs say it is a 32-bit float, range -127 to +127. Problem is, pyuipc only gives me the option of reading 1, 2, 4 or 8-byte integers, or 8-byte double floats.

 

None of these options seem to yield usable values.

 

There are quite a lot of 32-bit floating point values in the interface, so I'm surprised that this "PYUIPC" program (which is new to me) hasn't encompassed those. The underlying Intel architecture supports both 32- and 64-bit floating point values directly, as do all of the Microsoft programming language family.

 

Anyway, there is a 64-bit version (relating to the HSI) at offset 2F88. I guess that should be the same value if VOR1 is selected -- you may need to check offset 2FAA as well, though, for validity.

 

If you don't need such accuracy (for instance, if it is only for display on a gauge) then the 8-bit (single byte) integer version at offset 0C48 should be used.

 

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.