Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XML SET type variables

Featured Replies

  • Commercial Member

I'm trying to create a refueling system for my current project and thought I'd got it beaten by using the FUEL TANK XXXX variables as they are listed as settable. However, this doesn't work...execute_calculator_code("(A:FUEL TANK LEFT MAIN,Percent+requested_fuel)(>K:FUEL TANK LEFT MAIN)", NULL, &retval, NULL);where requested_fuel is also a percentage. It does absolutely nothing - it's got to be me at fault but where?-Dai

  • Commercial Member

Well... FUEL TANK LEFT MAIN isn't a keyboard event. It's just a read-only variable that returns how much fuel is in the left main tank. No more, no less.You didn't mention whether this is for FS9 or FSX... in FS9 there is exactly one event for refueling and I believe it's broken.In FSX I think SimConnect has a refuel capability... but I'm not 100% on that.

Ed Wilson

Mindstar Aviation
My Playland - I69

Hi Dai,Unfortunately it is not possible to add fuel to individual tanks using XML events AFAIK. However, you can indeed add fuel in general using ADD_FUEL_QUANTITY event, from 0 to 65535 (100%) like this:int iFuel=32767; //50% to addchar cCode[60];PCSTRINGZ szCode;sprintf_s(cCode,"%d%s",iFuel," (>K:ADD_FUEL_QUANTITY)");szCode=cCode;execute_calculator_code(szCode, NULL,NULL, NULL);This could be your start point to experiment with different values.Tom

  • Moderator

All of the token variables listed as "settable" may only be "set" via SimConnect. This of course is necessary in order to keep any shared cockpits synchronized.Unfortunately, unless your coding for FSX, that isn't terribly helpful... :-roll

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
  • Commercial Member

Thanks guys - I really, really wanted to be able to set the individual tank levels.... however...Bill - are you hinting that it's possible to SimConnect to yourself i.e. if I was coding for FSX, then I could use the SimConnect effectively as a gauge within the aircraft?-Dai

  • Moderator

Well, yes. It's a round about way to do it, but there's no reason why you cannot write a small .dll and have SimConnect do the 'work' for you.Please note that this is entirely theory for me, as I've not tried anything like this myself... ;)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Actually you can call SimConnect functions, which are asyncronious, within a custom DLL -not a common .gau but a .dll that instantiate Panel/Aircraft classes. There is a public function contained -Update() that executes on 18 HZ tick, so the calls can be put there. Currently I'm working on a similar stuff. You may want to see the "CabinComfort" example from FSX SDK to learn on how to program the dll.Tom

  • Moderator

It's worth pointing out that this is very similar to the way that you can retrieve data from the gps.dll using either XML or C code. ;)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.