Jump to content
The simFlight Network Forums

Can we load fuel into PMDG 737NGX?


Recommended Posts

I apologize for this basic post but I searched this forum and found no threads on this topic.

 

When I googled it, I found some old posts that talked about PMDG's SDK having the offsets to support being able to set their tank levels and then some folks said the offsets were read-only, etc. Quite confusing, thus my post here.

 

Using Paul Hently's .NET .DLL and FSUIPC I wrote a small utility that works setting the fuel levels on the default FSX 737NGX and on the CS 777.

 

When I try to set the fuel levels on the PMDG 737NGX, the quantities (the fuel digits) flash then return to their prior levels as if the PMDG is constantly resetting them.

 

So, I'm wondering if I'm using the wrong offsets or if PMDG just doesn't allow us to change their fuel tank values?

 

Thanks...

 

Link to comment
Share on other sites

I apologize for this basic post but I searched this forum and found no threads on this topic.

 

When I googled it, I found some old posts that talked about PMDG's SDK having the offsets to support being able to set their tank levels and then some folks said the offsets were read-only, etc. Quite confusing, thus my post here.

 

Using Paul Hently's .NET .DLL and FSUIPC I wrote a small utility that works setting the fuel levels on the default FSX 737NGX and on the CS 777.

 

When I try to set the fuel levels on the PMDG 737NGX, the quantities (the fuel digits) flash then return to their prior levels as if the PMDG is constantly resetting them.

 

So, I'm wondering if I'm using the wrong offsets or if PMDG just doesn't allow us to change their fuel tank values?

 

The PMDG 737NGX data mapped into FSUIPC offsets is just that. Data supplied by an interface provided by the 737NGX, which initially gets read en bloc and dumped into fSUIPC memory space for reading (only) by applications. Updates are then notified via a SimConnect mechanism. It's a type of memory sharing system.

 

PMDG have not provided any means to write to any of those data items. It's purely data provided for reading.

 

The only concession there is to control, and maybe setting data, is the list of additional FS-type control numbers. You'll need to refer to the header (.h) file supplied in the 737NGX SDK for that. I no longer have any PMDG aircraft so I can't check, but I doubt that there will be controls to set fuel levels. BUT you never know, it would be worth checking.

 

If you need to send controls through FSUIPC offsets you use offsets 3110 (control number) and 3114 (data), setting the data first.

 

The only other way I know of setting fuel levels (and payload for that matter) is to edit the Aircraft.CFG file directly, in situ, then send the FS control to reload the aircraft. However, I'm rather doubtful even that would work properly with PMDG aircraft.

 

Regards

Pete

Link to comment
Share on other sites

Thanks Pete for that answer.

 

I looked in the PMDG .h file and on line 402 there is this block:

 
// Additional variables: used by FS2Crew
bool ENG_StartValve[2]; // true: valve open
float AIR_DuctPress[2]; // PSI
unsigned char   COMM_Attend_PressCount; // incremented with each button press
unsigned char   COMM_GrdCall_PressCount; // incremented with each button press
unsigned char   COMM_SelectedMic[3]; // array: 0=capt, 1=F/O, 2=observer.
// values: 0=VHF1  1=VHF2  2=VHF3  3=HF1  4=HF2  5=FLT  6=SVC  7=PA
float FUEL_QtyCenter; // LBS
float FUEL_QtyLeft; // LBS
float FUEL_QtyRight; // LBS
 
So there are the defines for the three fuel tanks, as floats. And that looks like the only ones as all other FUEL constants are boolean or char types.
 
However, I don't know what the comment means for non-FS2Crew apps like mine.
 
I suppose I could just try it but I'm not sure how to map those .h header defines to FSUIPC? and I surely don't know if (probably not) Paul's .DLL Class handles these.
 
If I could get some guidance on how to try these out, I'll report back on my results.
 
Thanks...
Link to comment
Share on other sites

Hi,

 

I think you could try creating a LUA with the commands ipc.writeLVar to set the variables you mention in your post.

 

I will try too.

 

At the moment I have solved the problem dinamically creating, after to have calculated the fuel needed for the flight I want to do, a LUA that automatically execute the sequence of commands that you should do to load the fuel through the FMC.

 

Kind regards

 

Joe

Link to comment
Share on other sites

 

Thanks Pete for that answer.

 

I looked in the PMDG .h file and on line 402 there is this block:

 
// Additional variables: used by FS2Crew
bool ENG_StartValve[2]; // true: valve open
float AIR_DuctPress[2]; // PSI
unsigned char   COMM_Attend_PressCount; // incremented with each button press
unsigned char   COMM_GrdCall_PressCount; // incremented with each button press
unsigned char   COMM_SelectedMic[3]; // array: 0=capt, 1=F/O, 2=observer.
// values: 0=VHF1  1=VHF2  2=VHF3  3=HF1  4=HF2  5=FLT  6=SVC  7=PA
float FUEL_QtyCenter; // LBS
float FUEL_QtyLeft; // LBS
float FUEL_QtyRight; // LBS
 
So there are the defines for the three fuel tanks, as floats. And that looks like the only ones as all other FUEL constants are boolean or char types.
 
However, I don't know what the comment means for non-FS2Crew apps like mine.
 
I suppose I could just try it but I'm not sure how to map those .h header defines to FSUIPC? and I surely don't know if (probably not) Paul's .DLL Class handles these.
 
If I could get some guidance on how to try these out, I'll report back on my results.

 

You are just looking at the definition of the READ ONLY data which is mapped into FSUIPC offsets! The part you quote is mapped at offsets 65D5 to 65F0 -- surely you looked in the "Offset Mapping for PMDG 737NGX" document I supply? Else what did you try before?

 

The only part of that header file relevant ot inputs TO the 737NGX is the list of control numbers which appears AFTER all of the data output definitions.

 

Pete

Link to comment
Share on other sites

Pete:

 

Yes I did look at your Offset Mapping for the 737NGX .PDF document...that's where I saw the Fuel offserts but they are mostly Booleans so I knew they wouldn't be able to set any fuel values.

 

I got this email early this morning from PMDG (Ryan) regarding this issue:

 

"Ralph

This will not work, our fuel systems are completely custom coded to get around issues with the way FSX handles fuel consumption for jet engines by default. There's no way to externally load fuel, you have to use the FMC's MENU/FS ACTIONS/FUEL page."

 

So, it looks like Joe was on the right track!

Link to comment
Share on other sites

Pete,

 

I'm afraid I've gotten a little lost in all of this FSUIPC and LUA stuff. FSUIPC is used primarily to setup my FSX keys to control various things within FSX. My controls are setup and working fine, so I don't think I need to re-program them all over again using FSUIPC (although from what I've read, that may not be a bad idea, but that is not my main focus at this time).

 

Where I'm lost is that I want to send keys to the 737NGX CDU (now that I know from PMDG I can't mess with the tanks directly themselves) from my windows application. Joe has suggested that I use LUA for this, but am I not able to do this just with using FSUIPC itself? And if so, how do I make these key calls in my .NET C# code?

Link to comment
Share on other sites

Where I'm lost is that I want to send keys to the 737NGX CDU (now that I know from PMDG I can't mess with the tanks directly themselves) from my windows application. Joe has suggested that I use LUA for this, but am I not able to do this just with using FSUIPC itself? And if so, how do I make these key calls in my .NET C# code?

 

Doesn't the PMDG.h file you mentioned list the controls to be used to send keys to its CDU? If PMDG provide no mechanism I don't know how it would be done. Emulate mouse and keyboard? Ugh. Messy.

 

Programming in Lua is just programming as you are doing in C#, so I don't know why that's an alternative you would be interested in. And doing it with "just FSUIPC itself" doesn't make sense to me ... do you mean program one button to send loads of data to the CDU? It would be a mighty big macro -- maybe that's why Lua was suggested, if you wanted to keep it all in FSUIPC and not use your C# program.

 

Pete

Link to comment
Share on other sites

My understanding is that while I cannot directly access the fuel tank levels of the 737NGX, I can access the MENU->FS ACTIONS->FUEL screen inside the FMS/CDU and send key strokes to that device to get the fuel load into the tanks. It's sort of like a 'back door' approach to doing the same thing.

 

My C# app has a fuel planning window that will calculate the fuel load for a given trip and I'd like to send those fuel tank values to the CDU, as described above, to set the fuel tank values. I'm not clear, from an application point of view, if I can use FSUIPC to do that or if using LUA is a better way to do it. Thanks 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.