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
simpilot365
Posts: 7
HI, is it possible on MSFS + Mobiflight to set a precondition on the INPUT?

I would like the FBW Baro "PULL STD" to display STD on the 7 segment. I think it will only be possible if i map it to a INPUT and set the preconditions to work only when the SWITCH is pulled.
2022-01-24 03:41
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

What you expect is possible....

PRECONDITION is a tool in Mobiflight to enable or disable a Config temporary in case of a True Condition
For example you can say " Only work if Autopilot is ON"
Basic Rules:
1. The Indication is always a OUTPUT Config! So wo not say "Check the Autopilot State" .... We say "Check the Output Config xxx" and with that Config we read the AP itself.
2. Mostly for Preconditions we work with 2 Configs.... Cause the Precon only Disable/Enable a Config.... But not Handle a other Situation while its e.g. disabled.

Example:
With Preconditions in your Case you will make 2 Configs for the Same Display....
Config 1 show the QNH from the Sim .... It got Precondition " Only work if "PullStd" Config is currently "0"
Config 2 show hardcoded the word STD ..... It got the inverted Precondition " Only work if "PullStd" Config is currently "1"


So in theory this work.... But its a little uncomfortable to build 2 Configs here ..... If you also Include e.g. Battery OFF Blank situation and "8888" for a Lighttest , then you need up to 4 Configs and a much more complex Precondition with AND/OR conditions.



Solution:
Normaly we use here COMPARE and/or TRANSFORM ..... Or best way you got a Aircraft in the Sim that already work logical and include the needed Informations within the Variable itself ( Or by a good "Custom Variable" that make the needed calculations already within the WASM Module.... So MF receive the final Value already perfectly)

Target is.... We do this in One Config to make it more efficent and easy.

In your case....

Step 1... You read the Value/Indication of the STD Switch in a Output Config.... e.g. Call it "STD-Info" and lets say it´s "0" for showing QNH and "1" for showing STD.
Step 2.... You build a Config that Read QNH and set it to the needed Display.
Step 3.... You Enable a Config Refference in that Config (Sim Variable Tool in lower section) and you choose there for config "STD-Info" and use the symbol "a" for it.

NOW we can use the other Value within our calculations in that Config!
Normaly we now will say "IF the other Config is 0, THEN show QNH Value ELSE show "STD"
Badly here we got a little Problem cause MF not allow us ( till now) in a Transform Line to handle "Strings" .... So we can only use numbers and not text !
But there is a workaround!

Step 4 In Transform line we will say : if(a=0,$,4444)
Why we do this ??? .... We say "IF the Value of "a" ( STD Situation) = 0 (Means QNH should be shown) THEN show $ ( Its own value that represent the QNH from Sim)
ELSE ( So if "a" is not 0 and is 1 for STD) show 4444 instead.
We use 4444 here cause a QNH can NEVER be 4444 ..... Lets say we would use "999" Then we get in trouble if QNH would be by circumstance also 999.

Step 5 .... Now we got a Logic.... But we want STD instead of 4444!
Here we use COMPARE Tab.... We say There If Value = 4444 ( Set Operator = and write 4444 in the field) in THEN you write STD in ELSE you write $
That means.... IF Value is currently 4444 ( Done by our Transform logic) Show instead the Text "STD" .... ELSE ( So Value is the QNH) show $ ( Value itself).
we do this HERE, cause the Compare is the Only place ( for now) we can add a String like "STD" .

***********

Sounds difficult.... But thats in case we talk about a 7Seg with Text.
If we only talk about NUmbers ( e.g. a LED ) then all is done in the Transform.
For example complex things like "If Battery is Off, then LED must be Off.... If Lighttest in Progress it must be ON all time and else it must show the Value.
Instead of using 3 Configs for that with PReconditions here a formula like "($+a)*b" do all the work in only one config line !

LAST NOTE:
Please watch this Video..... https://www.youtube.com/watch?v=DZuVu4qU9Uc
It include also verry good examples for what you need!
Good Luck !
2022-01-24 09:20
icon