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
pilota57
From: Bolzano, Italy
Posts: 60
Supporter
Hi,
I'm in progress to simulate the "sleep state" for my cockpit panel when the battery is off by power off leds, 7 digit modules and LCD (obviously without remove power supplies).

Just estinguished the leds when Battery State is OFF (i.e. parking brake and landing gear down leds) via free offset to monitor Battery State and placeholder to assign the function if(a=1,$,0) in Transform fields for desired Led Outputs.

Now I'm not able to found a solution for max7219 modules in order to show blank digits (I know that is not possible to cutoff the 5V supply because they need to restart Mobiflight).

Same for LCD Display I dont found a way to power off the backlight.

Thanks in advance for Your suggestions.
Fuarce Friûl
2020-11-04 12:19
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi my friend !


1. 7SEG .

Here you use nearly the same logic like in LED.... With a little trick.

iconQuote:

via free offset to monitor Battery State and placeholder to assign the function if(a=1,$,0) in Transform fields for desired Led Outputs.



You stil use the same logic ...... A 7Seg will use the "Space Character" for a Blank .
So technical we woud say here : if(a=1,$,' ') BUT badly this work NOT in the Transform field..... Cause here Strings are permitted. So the Resut MUST be a Integer Value.
The Key is.... Using a FAKE Value that never can occure. In a Heading Display e.g. every value above 359 ( cause Heading is 0-359) For example "999"
So you use the Formula if(a=1,$,999) here in transform.
Finaly in COMPARE Tab you can work like in the XPDR solution..... You know. If Value is 999 (by the transform formula) this means Display must be blank.
So say.... IF Vaue = 999 THEN Some Spaces ( in number of digits) ELSE $
Result: If Battery Offset is 0 the Transform change Value to 999 .... The Compare Change 999 into Spaces ..... If Battery is ON the Vaue is simply the Offset and is shown.


2. LCD:
Here you need a Electrical Solution !
In Mobiflight you just can say all Diggits should be show nothing.... But the Backlight is STILL ON. To disable the Backlight you must CUT the Line from Controller to Backlight Pin ( i think 5v) by a Relais......
The Relais is used in Mobiflight like a LED.... And it use simply BAT Status. If BAT is ON the Offset is 1 so the Relais is powerd. Means the Line to Backlicht is close and it is light.
If Battery is OFF and Offset is "0" the Relais is disabled.... This CUT the Power line of the Backlicht and your LCD is dark !
Good Luck !
2020-11-05 19:21
Avatar
pilota57
From: Bolzano, Italy
Posts: 60
Supporter
iconpizman82:

Hi my friend !


1. 7SEG .

Here you use nearly the same logic like in LED.... With a little trick.

iconQuote:

via free offset to monitor Battery State and placeholder to assign the function if(a=1,$,0) in Transform fields for desired Led Outputs.



You stil use the same logic ...... A 7Seg will use the "Space Character" for a Blank .
So technical we woud say here : if(a=1,$,' ') BUT badly this work NOT in the Transform field..... Cause here Strings are permitted. So the Resut MUST be a Integer Value.
The Key is.... Using a FAKE Value that never can occure. In a Heading Display e.g. every value above 359 ( cause Heading is 0-359) For example "999"
So you use the Formula if(a=1,$,999) here in transform.
Finaly in COMPARE Tab you can work like in the XPDR solution..... You know. If Value is 999 (by the transform formula) this means Display must be blank.
So say.... IF Vaue = 999 THEN Some Spaces ( in number of digits) ELSE $
Result: If Battery Offset is 0 the Transform change Value to 999 .... The Compare Change 999 into Spaces ..... If Battery is ON the Vaue is simply the Offset and is shown.


2. LCD:
Here you need a Electrical Solution !
In Mobiflight you just can say all Diggits should be show nothing.... But the Backlight is STILL ON. To disable the Backlight you must CUT the Line from Controller to Backlight Pin ( i think 5v) by a Relais......
The Relais is used in Mobiflight like a LED.... And it use simply BAT Status. If BAT is ON the Offset is 1 so the Relais is powerd. Means the Line to Backlicht is close and it is light.
If Battery is OFF and Offset is "0" the Relais is disabled.... This CUT the Power line of the Backlicht and your LCD is dark !



Thanks Piz,
tomorrow i will implement an report You the results (sure will be working).
Bye
Fuarce Friûl
2020-11-05 19:34
Avatar
pilota57
From: Bolzano, Italy
Posts: 60
Supporter
Hi Piz,
I confirm that Your solution for "Power off" the 7 segments displays is just what I wanted.

I just put 999999 in place of Your 999 "Fake" suggested value in order to have the same effect for Speed altitude, V/S, engine temperatures u.s.w..

Next Tuesday I will receive the 5V relais and procced with LCD Display power off.

Thanks again
Fuarce Friûl
2020-11-06 09:40
Avatar
pilota57
From: Bolzano, Italy
Posts: 60
Supporter
Hi Piz,
as per my previous replay the "Display's OFF" suggestion is working well except for Heading Display because in that Output Settings is just the Compare option in use in order to avoid the HDG Negative Value.
The Comparison is:
If $ < 0
Then $ + 360
Else $


It is possible to put another Comparison in the same Output ?
This Comparison shold be:
If r = 999999
Then $ = ' '
Else $

(where r is the placeholdee for battery state and ' ' the three spaces).

(ElseIf needed ?)

Thanks
[Last edited by pilota57, 2020-11-06 14:01]
Fuarce Friûl
2020-11-06 13:36
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Yes this is possibe.... And Yes. It can be done in Transform or Compare... Whatever you like. Finay your also right..... The Key is a ELSEIF !

Only GLOBAL Rule: You can use Srings ( whatever as indication or result) ONLY in Compare Tab..... NEVER in transform !!!


Lots of possible ways.....


Solution via Transform:
Include the needed calculation you done currenty in Compare tab simply into the transform.
For example : "r" is the battery .... And currently comapre is IF Vaue <0 Then $+360 Else $
Use Transform: if(r=1,999999,if($<0,$+360,$))
Finaly in Compare you say now IF Vaue = 999999 THEN "x time Spaces" ELSE $
( The Calculation If $<0 is already done now in Transform and no longer needed in Compare! )

****

Solution Via Compare and Transform
Use in transform just the Battery Function : if(r=1,999999,$)
In Compare you say.... IF Value = 999999 THEN "x time Spaces" ELSE : if($<0,$+360,$)
(Here the Function if Battery is ON is done in Transform ! ....The Logic to Show spaces is done in the THEN of Compare (cause its a String) .... The Calculation <0 is done as a ELSEIF (Formula) in the ELSE of the Compare)

****

Solution in Compare Only: ( Cause you can use Placeholders also in Compare)
IF Value is less < 0 .... THEN if(r=999999,' ',$+360) ELSE if(r=999999,' ',$)
(Here all is done in compare..... We just "incude" the Battery Function 2 times.... So whatever the THEN or the ELSE occure in case of If $<0 Situation.... Both use also the Battery System same time additionaly)
*********
You see.... All is posible.... You just need to understand the code. Basicy you should choose the shortest and most easy way ! In that case Way 1.
[Last edited by pizman82, 2020-11-06 23:37]
Good Luck !
2020-11-06 23:30
Avatar
pilota57
From: Bolzano, Italy
Posts: 60
Supporter
iconpizman82:

Yes this is possibe.... And Yes. It can be done in Transform or Compare... Whatever you like. Finay your also right..... The Key is a ELSEIF !

Only GLOBAL Rule: You can use Srings ( whatever as indication or result) ONLY in Compare Tab..... NEVER in transform !!!


Lots of possible ways.....


Solution via Transform:
Include the needed calculation you done currenty in Compare tab simply into the transform.
For example : "r" is the battery .... And currently comapre is IF Vaue <0 Then $+360 Else $
Use Transform: if(r=1,999999,if($<0,$+360,$))
Finaly in Compare you say now IF Vaue = 999999 THEN "x time Spaces" ELSE $
( The Calculation If $<0 is already done now in Transform and no longer needed in Compare! )

****

Solution Via Compare and Transform
Use in transform just the Battery Function : if(r=1,999999,$)
In Compare you say.... IF Value = 999999 THEN "x time Spaces" ELSE : if($<0,$+360,$)
(Here the Function if Battery is ON is done in Transform ! ....The Logic to Show spaces is done in the THEN of Compare (cause its a String) .... The Calculation <0 is done as a ELSEIF (Formula) in the ELSE of the Compare)

****

Solution in Compare Only: ( Cause you can use Placeholders also in Compare)
IF Value is less < 0 .... THEN if(r=999999,' ',$+360) ELSE if(r=999999,' ',$)
(Here all is done in compare..... We just "incude" the Battery Function 2 times.... So whatever the THEN or the ELSE occure in case of If $<0 Situation.... Both use also the Battery System same time additionaly)
*********
You see.... All is posible.... You just need to understand the code. Basicy you should choose the shortest and most easy way ! In that case Way 1.


HI Mr. Pizman and Thanks for suggestions that send me in the right way.

At the end, following Your indications, I will post the applied (and working) solution in case other MF users need it:

To achieve the result to "Power Off" the HDG Display where MF shows the actual heading I proceed as follow:

In Output HDG_DISPLAY
FSUIPC Tab >> Offset: 0580 (Int - 4 Bytes)
Transform: if(r=0,999999,$*0.0000000838190317)
where r is the BATTERY_STATUS placeholder
999999 is the fake value sent to $ if the battery switch is OFF and is used to show the Spaces as void digits on the 7219 Display to simulate the Battery Switch OFF condition.
0.0000000838190317 is the result of the HDG Offset value re-calculation (360/65536)/65536. If I use (360/65536)/65536 in formula the Debug log show me formula-errors (probably because I misuse the Round Brackets).

In Compare Tab >> Comparison Settings
if $=999999
then ' '
else if($<0,$+360,$)

where ' ' (three spaces) shows nothing on HDG Display
and finally the elseif that add 360 if the HDG Offset calculated value is negative.

Thanks again Piz

P.S. It seems to me that every time I change something in more one output settings tab and go to SAVE only the last changed modified tab is saved;
I.E.: first I change something in FSUIPC tab, immediatelly I change something in Compare tab >>> Ok and SAVE; only the Compare modification is saved.

In any case Mobiflight is a great piece of sotware.

Bye
[Last edited by pilota57, 2020-11-07 17:43]
Fuarce Friûl
2020-11-07 12:14
icon