MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
ilsparamedic
From: Geneva, Switzerland
Posts: 13
Supporter
Hi everyone,

I would like my Fuel gauge to read 0 until the battery switch is ON. Can I set a pre-condition for this? If so could someone outline what needs to be done?

Cheers,
Stuart

The Fuel gauge reads a max of 100 US Gals and aircraft tank has a max capacity of 91 US Gals.
I use offset 0B74, 4 - Fuel: centre tank level, % * 128 * 65536 (I have added *0.91 to the transform line to compensate for the difference between tank capacity and gauge values)- everything reads okay withing the sim.
2020-09-08 23:04
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi Stuart,

it is relatively easy to show the fuel display only when the main battery switch is switched on.

Based on a standard aircraft in your simulator:

Go to the MF main window and click on the Output tab
At the end of this list you create an entry that only outputs the value of the battery switch.
The config is given the name: BAT_MS_SW
Now click on the 3 dots at the end of the line. The ConfigWizard opens.
Now click on the FSUIPC tab.
Now enter the offset for the battery switch in the basic settings:
Offset 0x281C Int 4 bytes

Leave the ConfigWizard with OK

Now you go to your config for the fuel display.
The ConfigWizard opens again.
Now click on the Precondition tab.
Check the box in the list of preconditions.
For the type of precondition, select Config entry
For the settings for the precondition, proceed as follows:
Select the config - in this case BAT_MS_SW
For If current value you set "=" and in the field next to it you enter the "1".
Now you click on "apply"

If the battery switch is switched to 1 (on) (BAT_MS_SW = 1), the fuel display should now also be shown.
If you switch the battery switch to 0 (off), the display should switch off again.

If you have an add-on airplane, you have to look for the corresponding values ​​from the appropriate lists. The principle is the same.
Please report whether it worked.
Grüße,
Stephan (Time: UTC+2)
2020-09-09 19:48
Avatar
ilsparamedic
From: Geneva, Switzerland
Posts: 13
Supporter
Thanks Stephan,

I'll give that a try and report back!

Cheers,
Stuart :)
2020-09-10 22:58
Avatar
ilsparamedic
From: Geneva, Switzerland
Posts: 13
Supporter
Hi again,

I've had a first look and have had partial success. The precondition works when bat is off to begin, but when turned off (Red precondition Exclamation shows Pre,con, not met on Mobiflight), but the gauge remains on.
I'll have another look at this today and report back.

Thanks again,
Stuart
2020-09-13 00:35
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Your right.

Stephans solution is just the "half of the sausage" ( as we say in germany)

For every Blank System (Whatever a LED should be blank, A Gauge should turn to zero or a Dispaly should show spaces) we got TWO different workarounds :
Precondition OR Placeholder.

Both Systems got one simular part.... Both need a "indicator".
In your case it´s the "BAT_MS_SW" Config..... That show us if Battery is on and if your Fuel Gauge/Display ( i not understand if you use a motor or a 7Seg) is ON of OFF.

Way 1 Precondition:
Here Stephans way is 100% correct..... But he miss a importantn part! The Precondition he explane disable your Config correctly in the moment when Battery is OFF.
BUT that means just this Config no longer send Data to the Output. It NOT mean it will blank the Display or set the Motor to Zero.
So in easy words..... if the Config get disabled by the Precondition THEN the Output will stay "forever" in its curent position. Only if this config or a other config ( and that the key) get controll to this Output it will change it status.

So Solution : You need a SECOND Config. This config also use the same Device ( Display/Motor) as the first one. In your case it should set the Display to Zero ( motor) or to Spaces (Display)
Here we not need to read the real Offset again.... Cause this config will always show the same if it´s active. So you use the preselected Offset 0000 with 1 Byte INT.
In Transform you say e.g. just zero 0 ..... So this Config is always Zero for a Motor. For a Display you also use Transform 0 and say in compare IF Value = Zero Then Spaces.... For 4 Digits use 4 Spacebuttons here.
Finaly the magic key..... You use a Precondition here that is the oposit of the other config. Here If Bat_MS_SW Config = 0

Summary; If Bat = 1 the real config work and show Value.... If Bat= 0 the second config work and show Zero or Spaces.

***
Way2 Placeholder.
Here you just need one Config. We use the Indicator here NOT as a precondition that disable the config.... Here we use it as a variable in the formula.
For example we use as Config Reference ( FSUIPC Tab) the Config Bat_MS_SW and define Symbol "a" .
In the formula we say for example.... if(a=1,$,0)
So IF Value of Bat Config (a) is 1 then show $ (current fuel data) .... ELSE ( So if Bat is not 1 means its zero) show "0" .
Perfect for a Motor.
For a Display we need spaces. This is more difficult cause in transform we can not use symbols like Space. Here we say e.g. if(a=1,$,9999)
9999 is here a senseless value that never can happen. In Compare we simply say.... If Value = 9999 then 4 Spaces Else $


****************
Summary: Both ways work. Placeholder looks more difficult but save a config for each output. If you use also Lighttest System it save 2 Configs each !
Good Luck !
2020-09-13 23:14
Avatar
ilsparamedic
From: Geneva, Switzerland
Posts: 13
Supporter
Thanks Pizman,

I give it a try and update on progress.

Cheers,
Stuart
2020-09-14 21:56
Avatar
aeromax
Posts: 252
Supporter
Running:

1.
FUEL Right Main Level
0x0894 Int 4
Trans: $*100/(128*65536)
Vergleichen: -
Display: Stepper
Precon: BAT_MS_SW = 1 (AND)

2.

FUEL Right Main Level
0x0894 Int 4
Trans: $*100/(128*65536)
Vergleichen: = 1 dann 0 sonst 1
Display: Stepper
Precon: BAT_MS_SW = 0 (AND)

3.

Master BAT Switch
0x281C Int 4
Trans: -
Vergleichen: -
Display: -
Precon: -
[Last edited by aeromax, 2021-02-14 08:44]
Life is Good When You Find What You are Looking For!
2021-01-03 19:16
icon