Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello,

I recently realized that I was using an FSX only value to calculate fuel in my ACARS, which obviously was creating issues with FS9 users. I've adjusted the code to use FS9 capable variables, and calculate the fuel by subtracting the zero fuel weight from the total weight.

I'm fairly confident that my code is correct, seeing as though it does indeed record the appropriate value in FSX, however, is still doesn't record from FS9. Is there something else I'm missing?

The relevant code is below:


DWORD result;
FSUIPC_Open(SIM_ANY, &result) //I'm using this as my connection open code

//The actual code does indeed have more error checking than this, I just chose to copy it this way for simplicity.
int ZFW;
long long TWEIGHT;
unsigned long result;

FSUIPC_Read(0x3BFC,4,&ZFW,&result);
FSUIPC_Read(0x30C0,8,&TWEIGHT,&result);

double zero_fw = ZFW / 256;
double fuel_w = TWEIGHT - zero_fw;
p.fuelquantity = (int)fuel_w;
[/CODE]

I appreciate any assistance in advance.

Posted

When using FSX, the direct output of total weight, direct output of zero fuel weight, calculated zero fuel weight, and the weight of the fuel, respectively. In FS9 something is zero somewhere, as the fuel always ends up zero.

Posted

I figured it out - I don't know how it worked at all, honestly. I had to change the ZFW variable to

unsigned int ZFW[/CODE]

and the TWEIGHT variable to

[CODE]double TWEIGHT[/CODE]

. It's correct now. Thanks for the reply.

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.