Jump to content
The simFlight Network Forums

PMDG 737 Altitude setting above 32700 gives negative value.


Recommended Posts

Hello all,

Apologies in advance if this is an old question, I've had a good hunt around and haven't come across the question or the solution.

I am a newby at putting together external flightsim controls and have some switches, LED's and Encoders set up on a breadboard.  Using FSUIPC4 with Mobiflight V7.7.0. I have had a lot of success using inputs and outputs into a PMDG B737 running on MS FSX.  The problems have come with  7 segment LED Displays.  I have set up a display to show the altitude setting on the MCP.  This works fine until I try to set an altitude above 32700 at which point instead of displaying 32800 I get -32736, if I continue to rotate the encoder clockwise the value reduces in steps of -100 so always retaining the 32 at the end of the value.

This value appears to be coming in from FSUIPC as the Output tab in MobiFlight has 2 columns showing the FSUIPC Value and the Output Value, both of which show -32736.  I am using offset 652E with an Int value type and a Byte size of 2.  I know from my forays into programming that a Signed Int value has a range of -32768 to 32767 and with a value of 32,768 bit 15 is 1 and so as this is a signed Int value all values after this point will be negative, maybe the signed Int is the issue.  I'm guessing that this isn't a new issue and that that there is probably a setting in an ini file some where to resolve it, so apologies again if this is a simple setting that I have missed but with little experience I have run out  of ideas.

As said above I'm Using FSUIPC4 with Mobiflight V7.7.0, PMDG B737NGX in FSX, with all patches and updates applied.

I appreciate any assistance.

Regards

 

Bill.

Link to comment
Share on other sites

2 hours ago, bill1798 said:

I have set up a display to show the altitude setting on the MCP.  This works fine until I try to set an altitude above 32700 at which point instead of displaying 32800 I get -32736,

You need to treat it as unsigned int, not int, though an int is usually 4 bytes (32 bits). You should declare it as an unsigned short, or whatever your software understands. I know 16-bit values as WORD (Windows programming definition0.

2 hours ago, bill1798 said:

This value appears to be coming in from FSUIPC as the Output tab in MobiFlight has 2 columns showing the FSUIPC Value and the Output Value, both of which show -32736.  I am using offset 652E with an Int value type and a Byte size of 2.

An unsigned short int has a range of 0 to 65535.

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.