Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi all,

This may have been answered here but if so I didn't find it in a search for any of the keywords I could think of :)

My program (FSCaptain) auto-loads the fuel and payload into the aircraft. In FSX this works fine, and in FS9 it appears to work but in fact it never changes the gross weight of the airplane (offset 0x30C0.) The result is that difference between the gross weight and the sum of the weights loaded in the fuel tanks and payload stations is considered "Ice Weight" and shows up as ice on the wings in the ice warning gauge supplied with FSCaptain (that most people never seem to use and few have noticed in the year it's been out!)

My question is, why doesn't a write to 0x30C0 and 0x30C8 with the correct numbers solve this problem? Am I doing something silly or missing a magic incantation?

Here's the code:

			FSUIPC_Write( 0x13FC, 4, &stncnt, &dwResult);	// station count
			FSUIPC_Write( 0x1400, sizeof(loadstn) * stncnt, &LoadStation, &dwResult);
			FSUIPC_Process(&dwResult);
			// FS9 does not recalculate aircraft weights, we will do it here and load them
			if (SimVersion == 9) {
				GetFuel();
				GetPayload();
				flt64 = ACEmptyWgt + TotalFuelPounds + TotalPayload;
				FSUIPC_Write(0x30C0, 8, &flt64, &dwResult);
				FSUIPC_Process(&dwResult);
				flt64 *= 32.174049;
				FSUIPC_Write(0x30C8, 8, &flt64, &dwResult);
				FSUIPC_Process(&dwResult);
				zfw = ACEmptyWgt + Payload;
				FSUIPC_Write(0x3BFC, 4, &flt64, &dwResult);
				FSUIPC_Process(&dwResult);
			}

Now the payload stations get written just fine. I've checked and rechecked this in the debugger and the writes get executed and the correct numbers are in the variables. But the gross weight read back from 0x30C0 or from the sim variables reporting the same number never changes until I bring up the payload dialog from the FS menu and close it -- then FS9 recalculates things properly.

Thanks for any pointers.

Slightly frustrated,

Dutch

PS. A word of appreciation for FSUIPC without which so much wouldn't have been possible in the FS world! We'd all still be marveling at what SimConnect could do for us...and FSUIPC still does so much more!

Posted

My program (FSCaptain) auto-loads the fuel and payload into the aircraft. In FSX this works fine, and in FS9 it appears to work but in fact it never changes the gross weight of the airplane (offset 0x30C0.)

I thought the fuel loading did, but, yes, certainly not the payload. This is why the offsets for payload in the FSUIPC offsets list is annotated thus:

These loadings can be changed, and this does have some effect, but such changes are not being promulgated to the overall weights (offsets 30C0, 30C8, 3BFC) nor balance (2EF8), and it looks like they have to refreshed, as FS overrides them from time to time. It has also been reported that FS can crash if a lot of changes are made here, so care and full testing is needed.

Perhaps you missed reading this? Don't you use the documents provided in the FSUIPC SDK?

The only way to force the issue is to enter the payload menu and okay back out. The values ARE there, they just don't promulgate. I never managed to narrow down the internal FS code sufficiently to identify what could be done automatically.

Regards

Pete

Posted

The fuel loading works fine, sorry I wasn't clear on that. The payload works fine too, just not hitting the gross weight as we know.

This was certainly not a criticism of FSUIPC, just a request for help if possible.

I did read that paragraph but I misunderstood it to mean that I was the one that needed to do the refreshing by rewriting the values, which I did after every station load and again at the end of the process.

Now I understand that to mean we can only count on the values if they are refreshed by opening the payload menu and closing it. That's fine, I'll just document that and live with the FS9 restriction. It's a small thing anyway.

Thanks for the quick reply,

Dutch

I thought the fuel loading did, but, yes, certainly not the payload. This is why the offsets for payload in the FSUIPC offsets list is annotated thus:

Perhaps you missed reading this? Don't you use the documents provided in the FSUIPC SDK?

The only way to force the issue is to enter the payload menu and okay back out. The values ARE there, they just don't promulgate. I never managed to narrow down the internal FS code sufficiently to identify what could be done automatically.

Regards

Pete

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.