TurbofanDude Posted December 27, 2012 Report Share Posted December 27, 2012 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. Link to comment Share on other sites More sharing options...
mgh Posted December 28, 2012 Report Share Posted December 28, 2012 What values are returned for TWEIGHT, ZFW, zero_fw, and fuel_w? Link to comment Share on other sites More sharing options...
TurbofanDude Posted December 28, 2012 Author Report Share Posted December 28, 2012 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. Link to comment Share on other sites More sharing options...
mgh Posted December 28, 2012 Report Share Posted December 28, 2012 What is zero? Link to comment Share on other sites More sharing options...
TurbofanDude Posted December 30, 2012 Author Report Share Posted December 30, 2012 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now