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
kfoisy
Posts: 15
Hi,
I have tested this a number of times (thinking maybe I made some mistake), but always same result.

I have an Annunciator test button. It needs to override the other configs and set all lights on.
When button is not pressed, it is trying to set all lights off, causing flickering for any light that is on.
Solution:
INPUT - create a VAR when button pressed =1, 0 when release
OUTPUT - Use var as pre-condition on Annunciator Test Config. Only active when button pressed.

Bug #1 - Precondition never met. I have verified VAR and it is correct, but precondition not working correctly.
Bug #2 - Precondition setting not persisted correctly. When editing, it always defaults back to some other value.

This is blocking. Unable to move forward unless someone has another suggestion.

Thanks!
Kevin
2023-01-17 03:23
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

You little missunderstand the base logic.....


At first.....
Its high recommend to check if the Sim Aircraft already include the logic itself....
E.g. the new PMDG B737 do this on most spots.
So e.g. the Gear Down Green LED is no longer show the current gear status itself.... It show the stauts of the virtual LED in the Virtual Cockpit.
Means ..... If Battery is OFF (Virtual LED is OFF) then the Value is 0 (Whatever gear is down)
Reversed... If Virtual Light test is in use, then all Values are 1 ( whatever they are on or not)...
Cause here the Variable for the Outputs simply show the status that currently is shown in Sim.

So.... At first check if the used LED Variables already include the logic by fire the virtual "Lighttest" if existing.

**************
If a Lighttest logic is not included and/or you will build a fully external logic.... Then your on the right way.... But you missunderstand some details.

Step 1 is right.
You need a Input Config that controll a Mobiflight Variable and set it to "1" (Lighttest in Progress) or "0" ( No lighttest active)

Step 2 is Read the Variable in a Output Config to make it useable later.
NOTE: This step is needed all the years till todays live version. In the next release we plan for a posibility to use a MF Variable directly as a Indication without read it by a own Output Config (In Beta this is partly already included).
Whatever i will explane the old way now....
So.... Create a Output Config that use as data source the MF Variable.
Not make any Preconditions, Calculations or use not a device like a LED.... We use this config just to READ the Variable and make it useable on other Spots later.
Example: Input Config write MF Variable "Lighttest" ...... Output Config read the MF Variable "Lighttest" and itself its named "Lighttest-Status".


Step 3
Here we got 2 Ways..... Precondition Logic OR Refference Placeholder Logic.

Way1 : Precondition:
This means each single Output Config (for each LED) must have 2 duplicated Entrys.
A Precondition means.... "Only work if Condition si True"
So in your case you would need e.g. 2 Configs for each System!
Lets expect we talk about the Gear Down LED.
Config 1 show the variable value of the Gear.... 1 if Down, 0 if Up .... And it got Condition " Only work if Config "Lighttest-Status" = 0
Config 2 show "1" all time (Transform field: 1) Precondition "Inly work if Config "Lighttest-Status" = 1

In easy words..... Precondition Means we "disable" a Config temporary, aslong the condition is not true.
But this means.... We need anther Config that work in that moment ( So with inverted condition) cause the LED only is controlled if a Config is active!

Way 2: Config Refference/Placeholder
Here we "pull" a other Value into a Config.
In pour example we would create a Config for a LED and enable the "Config Refference" Option in the Variables Tab.
There you choose for a Source.... In Our Case the Config "Lighttest-Status" and you define a symbol .... Lets say "a"

Now you can say e.g. in transform : $+a
"a" is the Value of Lighttest!
So if Lighttest is ON then we add +1 to our current Value.
If LED is OFF then its 0+1=1
If LED is ON its 1+1=2
In Both Ways the LED will light.
If Lighttest is OFF then 0+0=0 1+0=1 .... Means the LED work Normal.

******************

Summary.... There are many ways....
Your idea with Precondition is not wrong. But you need multiple configs if you go this way !
Good Luck !
2023-01-18 01:21
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Just to avoid confusion....

For sure with Placeholder/Refference we could also use other math logics.
For example a IF Condition.

Lets say "a" is again the status of Light test ....
We can say : if(a=1,1,$)
Means IF Lighttest (a) is active (1) THEN show "1" (LED On) . ELSE (So if Lighttest is not 1 and is 0 Off) show Value of Sim LED ($)

But the first idea with $+a is way more easy and logical.

*******

Interesting if you like to include other things like "All LED should be OFF aslong Master Batery Switch is in OFF Position for Cold and Dark state"

Lets expect "a" is still the Lighttest and now we also use a second Refference "b" for Batery Switch (0 = Off 1 = On)
Now we would say : ($+a)*b

Means.... ($+a) do the same like above and show LED State or Hard ON if Lighttest is active. the " *b " Part multiplicate the Batery switch state.
If Batery is OFF (0) then whatever LED Value is 0,1 or 2 in case of lighttest .... 0*0=0....1*0=0.....2*0=0 So LED is OFF all time.
If Batery is ON then we multiply by 1 .... Means it remains like it is.

I hope i could show you the basics !
Good Luck !
2023-01-18 13:05
icon