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! 

Go to page 1Go to page 112Go to page 3Go to page 2
Avatar
Renato
Posts: 10
I am trying to config the Offset 6475 ELEC_BatSelector.
2019-07-23 02:02
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3038
Supporter
Again my friend.... I can not understand the Problem !

Basic workflow :

Normaly you have a single config that show the Status of a Function to a LED ..... If Function is ON then Offset (Boolean) is 1 and your LED light..... If Function is OFF then Offset is 0 and LED not light.

Your Problem is......
The Offset show the Status of a function but NOT the status of the LED in the Simulator..... So for example the Offset for Gear Down lights (Green) will simply check the Gear Status.... If Gear is Down then it is "1" ..... Whatever the Electrical Power is ON or OFF ( Cause the gear is still down when your Master Battery Switch is OFF) .
So in Sim the Virtual LED is OFF..... But your Mobiflight Config simply show the Offset Status.... So its ON that time.

To solve this we need a Precondition basicly.... We like to say " LED should show the Offset Status from it´s functuion BUT it should be always OFF when Battery Switch is OFF.

The first idea (you pretty sure try) would be to simply make a output Config ( without device) that read the Battery Switch . And then you say in your LED Config " Only work if taht Output Config of Batteryswitch is NOT Zero (ON) .
BUT This will not work !!!

I explaned it in the other Topic you already read and reply today . https://www.mobiflight.com/forum/topic/530.html

In Simple words....
With this precondition you "Disable" the Config correctly .... BUT As i said this will not Disable the LED same time. If you Stop the config with the precondition then the LED stay in the last status, it was set before the config get disabled..... Without a active config on a device it simply stay in last status "forever".
Just when the Config get back ( or a other config start working on that LED) then the status get "updatet" and it is controlled again.

***********
Solutions:

Working with 2 ( or more ) Configs for every LED Output.

The most easy way with 2 Configs....
At first you need a "global" Config that read the MAster Battery Switch . No Device is needed. This is just a indicator for all other preconditions of hundrets of LED´s

LED Config 1 work like standard.... It Read the Offset of the Function and controll the LED ..... Precondition is " Only work aslong Battery Config is bigger then zero >0 ". so Masterswitch is ON

LED Config 2 is to simulate the Always OFF Status. Offset is not important ( You can use 0000 or every other) In TRANSFORM you say "0" ( Alternate is Compare Tab : If Value = 0 THEN 0 ESLE 0 for example ) Important is that value is finaly ZERO at all time. This Config must controll the SAME Led like Config 1
Precondition here is now " Only work alsong Battery Config = 0"

Summary: If Battery is ON then Config 1 is working and show Status of your function to the LED . If Battery is OFF then Config 2 work and "ignore" the current status of function and set LED to OFF.

******************
For more advanced Systems ( if you need also Light Test) we work with 3 Configs for each LED Output.
Here the Status of Function ( Offset) is basicly also just a indicator for preconditioning. You read the Offset in a Config that NOT have a device.
Finaly you build for every LED TWO Configs ( And the Indicator Config i explane before) .
Here Config 1 ( Offset not important, 0000 is OK) use transform "1" so it light always.
Config 2 also use a fake offset like 0000 and hafe transform "0" so it is always OFF . BOTH use same LED.
Finaly here you build a preconditions for ON and OFF that include Batterystatus, Lighteststatus and Function Status same time. This is advanced yause you need a row of AND/OR Operators.


****************************************
Last Note:
I hope Sebastian give us a tool i have build to make this more easy. If this come into Mobiflight then all this stuff can be done with only one simple code line you can copy and paste from a tutorial and this will work for ALL Led in your System. Then only one Config is need for each LED and you have included Lighttest and Battery Switch !
Good Luck !
2019-07-23 08:07
Avatar
Renato
Posts: 10
Hi, thanks for answering me!

I'm setting up the way you explained it to me, but I think I'm doing something wrong. I took some pictures for you to correct my mistake. So far I could not make the LED turn off when I turn off the Master Switch.

Do you have an email that I can send to the photos?

Thank you for your help!!!
2019-07-24 17:42
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3038
Supporter
pizman@freenet.de

Please stay patient..... Have a lot of personal requests a.t.m. and my time is limitted. Please assume a reply time of some days up to a week.
If you get no awnser in that periode of time please write me another mail to remember me.

Looking forward to your pictures.
Have a nice day.
Good Luck !
2019-07-25 00:51
Avatar
Renato
Posts: 10
hello my friend!

I got it!!!! :D :D :D

I was able to set the LEDs off with the Master Switch. Thank you so much for your help and pacient with me.:) :) :)

But now, I didn't understand how to set up Lights Test as you explained to me. I don't understand ( Offset not important, 0000 is OK )

"For more advanced Systems ( if you need also Light Test) we work with 3 Configs for each LED Output.
Here the Status of Function ( Offset) is basicly also just a indicator for preconditioning. You read the Offset in a Config that NOT have a device.
Finaly you build for every LED TWO Configs ( And the Indicator Config i explane before) .
Here Config 1 ( Offset not important, 0000 is OK) use transform "1" so it light always.
Config 2 also use a fake offset like 0000 and hafe transform "0" so it is always OFF . BOTH use same LED.
Finaly here you build a preconditions for ON and OFF that include Batterystatus, Lighteststatus and Function Status same time. This is advanced yause you need a row of AND/OR Operators."

May you give me an example? I am using a PMDG 737.

Thank for all!!!
2019-07-25 06:25
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3038
Supporter
Here the Problem is the same.... Just the result is inverted !

If you press the Lighttest Button then ALL Led´s in Cockpit should light up.....
But in same kind like in the "Battery Off" Situation we got the same Problem..... With only ONE Config that reads the Status of Function (Offset) we just show the current state of this function.
In Example again the Gear ..... Lets talk now about the RED Lights for Gear in transit. If you on Ground at the gate and make the Lighttest like requested by Checklist then your Red Gear-Transit Led´s should light (like all other LED in your cockpit) BUT The Gear isn´t in transit at this moment.... So the Offset is still "0" and LED stay dark.

To make Lighttest Only the technic is the same like above..... Just with 2 little differences....
The Global Config NOW Read Lighttest Status instead of Battery Switch.
The Config 1 of your LED read again your function (Offset) and have Precondition " Only work when Lighttest is OFF (0)
The Config 2 (Same LED) NOW must have Value "1" to let the LED light up aslong lighttest is in progress. Like above you can use Transform "1" or Compare "If 1 Then 1 Else 1"
Important is that value is always 1 here..... And Precondition say " Only work when Lighttest is ON (1)

Result: Without Lighttest the LED show status of Function by Config 1 ..... When Lighttest get ON then Config 1 Stop working and Config 2 get allive and set the LED to ON aslong the Lighttest is in progress.

**********************
PROBLEM (advanced stuff) is when you like to build BOTH things sama time ..... Lighttest and Battery Off Situation !
Until now we use one "FAKE" Config that have a fixed Value ( 1 Lighttest or 0 Battery Off ) and another that simply read the real Offset Status of the function. But for both things there can more then 2 states happen.

Situation 1: Battery OFF - Function OFF - No Lighttest (LED must be OFF)
Situation 2 Battery OFF - Function OFF - Active Lighttest ( LED must be OFF)
Situation 3 Battery OFF - Function ON - No Lighttest (LED must be OFF)
Situation 4 Battery OFF - Funtion ON - Active Lighttest ( LED must be OFF)
Situation 5: Battery ON - Function OFF - No Lighttest (LED must be OFF)
Situation 6 Battery ON - Function OFF - Active Lighttest ( LED must be ON)
Situation 7 Battery ON - Function ON - No Lighttest (LED must be ON)
Situation 8 Battery ON - Funtion ON - Active Lighttest ( LED must be ON)

You see. This can not be done with only 2 Configs. To prevent us to make 8 Configs Finaly we use a little trick and make it with THREE Configs after all.

At first We need 2 Global Configs we can define the Lighttest Status and the Battery Status.
Then we need for EACH Function one Config that read the Status of the Function itself ( But this time we not use the LED here.... This is also just a "indicator"
Finaly we need 2 Configs for each Annunciator that controll our LED.
Now BOTH are "fake" Configs that not need a real Offset ( Thats why i said you can use 0000 ) Cause we compare both to be always the same Value.
Config 1 get transform "1" to be always ON ( Call it for exmple Gear Light ON)
Config 2 get transform "0" to be always OFF ( Call it Gear light OFF to get a tidy system and know what config is for)

The tricky part NOW is to build preconditions that include ALL 8 Sitautuons in a correct way. Also you must understand the Logic how Mobiflight (Expression Plug In for C++) handle the AND/ OR Parameters .

For the OFF Config you say.... Only work if Lighttest is off AND Function is off OR Battery is off
For the ON Config you say .... Only work if Lighttest is on OR funtion is on AND Battery is on


Not feel scarred.:scared: ... This is simple Math and Operator Logic. Think about then you understand the logic behind the code.

***********
Summary... Now the both Configs that controll LED have itself no direct indication to a Offset.... they ase Both just "Fake" Configs witha fixed Value BUT They work in case of Preconditions in exact the right situations.

And AGAIN: All this stuff is gone if we get the new tool ( realy hope Sebastian implement this within 2019. ) Then all is done in one Config .
Good Luck !
2019-07-25 10:15
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3038
Supporter
OK.... Now i must say sorry !

Not want to edit the other topic cause it include a lot of information that is maby usefull for other users....

But after read this again and think about there is a more easy way that prevent you of the difficult 3 way precondition:

Again 2 Global Configs for Lighttest and Battery.

Then 3 Configs for each LED: ( All 3 Configs are now set to the LED )

Config 1 Read the Function Offset .... Precondition Only work if Batter = ON AND Lighttest = OFF ( Situation 5,7 from last example)
Config 2 have Fake Offset and Compare to "0" for OFF ..... Precondition Only work if Battery = OFF (Situation 1,2,3,4 from last example)
Config 3 have Fake Offset and Compare to "1" for ON ....... Precondition Only work if Battery = ON AND Lighttest = ON (Situation 6,8 from last example)

*******************
Sometimes we think to difficult. Maby i also got a msitake now..... But after another rethink i would say this should work.
:confused: I Realy wonder why i did this so difficult all the years !
Good Luck !
2019-07-25 10:29
Avatar
Renato
Posts: 10
Hello man,

I got it to do all the setup that you explaned me!

Thanks you
2019-08-09 18:13
Go to page 1Go to page 112Go to page 3Go to page 2