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 012Go to page 2Go to page 2
Avatar
jjvelar
Posts: 47
Hi,
I'm using a couple daisy chained of these for my FLT and LAND ALT displays in my PMDG 737NGX at Prepar3D.
Everything is working fine but when I switch the plane off (engines, APU, ground power and battery off), the 7-segment led is still on.
I tried with a precondition and when I use the transform $*0 then all the digits but the last one get off, but I want also to get this off too.
I tried the transformation $="" but then MobiFlight refuses to run.
Any suggestion?
Thanks!

Jose
2017-04-09 18:43
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3302
Supporter
Youre on correct way..

The technic is to use "Space" for this....
Use simply so much space bar pushes as you got diggits they should be blank..... 5 diggit Display = 5 time Spacebar.

I don´t know if this workes in Transform field too ( You need to try out ) IF NOT
Use the Compare field...... Say IF Dollar = 1 THEN "5 times Spacebar" ELSE "5 time Spacebar" ........ So this Config always shows 5 Space ... So all 5 Diggits are blank.

REMEMBER... A Output ALWAYS need a active Config .... Get shure you got two Configs and work with two preconditions !! Config 1 Always work if Battery is on.... Config 2 (Blank Config) always work wehn Battery is OFF......
If you only use the Blank Config then the Active Config still like to show its value on the Display.... This Config must be Disabled aslong the Blank Config is working... And Backwards !
Good Luck !
2017-04-09 21:25
Avatar
jjvelar
Posts: 47
I tried this:
multiply $ by 0 if the no_batt condition is satisfied.
then apply in the precondition tab the space trick weather $ = 0 or not.
and... It is working!
Thanks.
2017-04-14 10:35
Avatar
pluckas
Posts: 80
Supporter
iconjjvelar:

I tried this:
multiply $ by 0 if the no_batt condition is satisfied.
then apply in the precondition tab the space trick weather $ = 0 or not.
and... It is working!
Thanks.



Could someone explain this a little more clearly (maybe with an example)?

Thank you.
2020-01-09 04:52
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3302
Supporter
Hi

Whatever this workes for jjvelar 2,5 years ago ... The "Multiply $ by 0" was simply unless and make no sense.

Basic logic for a battery Off Condition is TODAY possible via 2 system.....

1. The OLD Prconditon Logic.
Here each Display got two Configs.....
One Config show the current Value ( and is active when Battery Switch is ON)
The Other Config show Spaces (and is active when Battery Switch is OFF)
This second config not need a special Offset.... You can use 0x0000 ..... We just say in Compare Tab IF Value = 0 THEN "Spaces" ELSE "spaces" (Number of digits is number of spaces)
The Check of BatterySwitch is done her in Precondition Tab.
You create a Config ( without device) that Read the Battery Switch Position and you use THIS Config as Precondition Indicator.

2. The NEW Placeholder System.
Here we work with only one Config.... Whatever we already need a "indicator" Config that read the Battery Switch like in other System.
Here we decleare a Placeholder to the Battery Config and give him a Symbol... For example "a"
In Transform we say ... if(a=1,$,99999)
We Use here "99999" cause we can not write Characters like spaces in this Transform line. So we use a senseless Value like 99999 that can never happen in normal Condition.
In Compare Tab we say now ..... IF Value = 99999 THEN "Space Space Space Space Space" (Pressing Spacebar 5 times ) ELSE $

That means..... If BatteryConfig (a) = 1 (ON) THEN show original Offset Value .... ELSE ( When battery is OFF) show 99999
And in Compare we say IF Transformed Value is 99999 ( So it should be blank) Set it to Spaces (Blanked) ELSE ( If Real Value is used) show this Value.

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

Hopefully you understand it.
Good Luck !
2020-01-09 06:08
Avatar
pluckas
Posts: 80
Supporter
Thanks Pizman - I'd forgotten about the new logic (and I've just finished creating multiple configs). I'll revisit this now that I see what this new all means.
2020-01-09 07:19
Avatar
pluckas
Posts: 80
Supporter
Okay - some problems. It seems to work intermittently, but now mobiflight won't start with my configs selected.

I have an input that sends ON (1) and OFF (0) values to 66C0. I have an output called "batstate" that reads 66CO. I have my FLT ALT and LAND ALT segment displays set to use "batstate" as "a", with transform if(a=1,$,99999). I then have the compare = 99999 to be "5 x spaces", else $.

Mobiflight keeps collapsing. I've tried varying the on and off values, etc. without success.

Any thoughts?
2020-01-09 10:18
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3302
Supporter
What do you mean with "Collapsing" ??

Mobiflight hangs and must be restarted by Taskmanager ?
Mobiflight quit without error and must be restarted
Mobiflight RUN just change into STOP?
Is there a Error Warning ? Do you have for testing "Logging Mode Enable" and can you tell me the Error Message in that Debug String ?

******

Basicly the "logic" i tell you work fine ( in both ways) for hundrets of people. So i think you did a misstake somewhere..... Mostly in Transform Syntax or in Offset Setup.

Possible Spots....

1. Broke Config overall. Whatever happen not often. Sometimes you kill the config by a misstake while save it.
2. Wrong Syntax in Transform. Confirm you use decimals instead points here.... "if" must be written in small letters.... Brackets must be used correctly
3. Correct usage of Custom Offset. Typ is INT Size is 1 Byte ( Both in Input and Output)

To find the Issue spot you can do some testings....

A ) Confirm the Both Outputs work already fine without Precondition .

B ) Confirm your Precondition is fine if you NOT use your Custom Offset.
Use for "batstate" for example a other Offset like "VNAV Status LED" of MCP.
Then you controll the Displays by enable/disbale VNAV. This is just to check if issue is in the Custom Offset Input/Output OR in the Display Configs itself.
Good Luck !
2020-01-09 15:20
Avatar
pluckas
Posts: 80
Supporter
Thanks for taking the time to respond in detail. It's a strange issue. I can get the logic to work, but it will not work on first start of Mobiflight (log reports an "error parsing the value formula") . However, if I deactivate the config reference and transform, re-run without the logic (which works as normal), then stop, reactivate the logic and run it all works fine. In other words, the logic appears to be correct, but Mobiflight just doesn't like 'starting' in this configuration.
2020-01-09 15:37
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3302
Supporter
Thats strange. Maby a issue we not see already.

If you like you can do another short testing to confirm a problem or to confirm you have a problem in your config already....

If possible please rebuild this System "external" in a new file.

So Make a NEW Mcc file. ( You pretty sure can use the Arduinos already.... No Hardware Change must be done)
Create all needed Configs.
1. Output Landing ALT
2. Output FLT Alt
3. Output BatState
4. Input Bat State

Do the same like before and test.
If it work here then your main MCC File with thw whole project including a issue somewhere.
If Problem is still happen whatever in this rudimentary setup then we have a issue in Mobiflight OR you did a misstake again same way like before and we must find out What it is.
Good Luck !
2020-01-09 17:33
Avatar
pluckas
Posts: 80
Supporter
Tested with a fresh mcc file, with just the battery and segment logic, and it works on start up, (although it failed once - on the very first start). Several re-starts, and the fresh mcc file is fine.

Re-Trying the original mcc file after several tests with the fresh mcc file - no joy. However, if I disable the transform, run, stop, re-enable the transform and run, the original mcc file works fine. Or, if I start the sim with the transform disabled, and then stop mobiflight and renable the the transform, it works fine.

Very strange.

Not worth much more effort - the functionality is only minor and I can use the 'old logic' if I wish.

Thanks again.
[Last edited by pluckas, 2020-01-10 09:08]
2020-01-10 07:16
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3302
Supporter
Ok...
Thats strange....

May i got a idea .
If you use in transform a Variable ( Placeholder) this Variable must EXIST.....
In Your example Mobiflight try to check the Display Config and like to get Information from Config "Bat-state" to define if it should be show Value or Spaces.
So if This Data not exist it report an Error and Stop.

If you tell us, that it won´t work at first startup but it work if you not use the transform , Start and Stop, and then you use it and there is no issue......
That can be a indice that the "indicator" not exist at beginning but it exist in second try.

Simple Idea:
WHERE is the BatState Config in relation to the "Display Output" Configs ?
If you create the BatState "behind" the Outputs then at first Startup Mobiflight handle all configs ( from first to last) and when it reach the "Display" Config it try to read "BatState".... BUT BatState is not existing already cause it comes behind and would be read first time AFTER Mobiflight handle the Display Config.

So....
1. Please Confirm the BatState Config is BEHIND the Other 2 in the List
2. If YES ... Please delete all 3 Configs in your Main Project MCC File..... And Create it NEW with BatState Prior the other 2 Configs.

IMPORTANT: Please report experience. If this is true we must rework the system OR give a clear announcement how to handle Placeholders to other user !
Good Luck !
2020-01-11 15:28
Avatar
pluckas
Posts: 80
Supporter
Thanks Pizman - that fixed it. I recreated the segment configs BELOW the batstate config (there's no obvious way to 'move' them) and the issue is gone. Excellent troubleshooting by you. I had not seen any documentation on the 'ordering' of configs.

One last remaining thing - the segments default to "off" on start-up, requiring the battery switch to be cycled off and on. I think this will be some simple logic somewhere in the configuations but if you can suggest anything obvious feel free ;-)

Looking ahead, the PMDG 737 actually appears to have three states for the altitude segment displays. Completely off, "blank" with the battery switch in the off position, "-----" when the battery is on but no ground or other bus power, and digits with grd or bus power. I just need to create a "grdstate" config similar to "batstate" and incorporate it into a more complex transform. (I assume pre-conditions are not needed here).

Paul
[Last edited by pluckas, 2020-01-12 03:20]
2020-01-12 02:52
Avatar
pluckas
Posts: 80
Supporter
I just created a config for a fuel temp gauge to zero it when the battery switch is off. The fuel temp config is 'before' the batstate config, yet it appears to work fine. So, maybe the issue is not fully determined. Either way, both are now working perfectly.

Also - I solved the dual segment requirement for FLT ALT and LAND ALT displays (spaces and dashes, depending on the battery + electrical bus state). The transform and compare features are very powerful, I just discovered conditions can be set in the compare fields. Now when only the battery is on, the segments read "- - - - -". When the battery is off, the displays are blank.

Thanks Sebastian for these powerful features.
2020-01-12 14:12
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3302
Supporter
OK....
Multiple things i need to comment.... Lets sort them.

At first the Battery Switch....

A Custom Offset ( Like you did with Switch that write 66C0) is basicly always Zero on systemstart. So if you say "0 = ON then your Display is powerd at systemstart (Whatever your switch is ON or OFF) ..... If you say 0= OFF then your Disply is Blank at startup .... (Also whatever switch is ON or OFF) .
Simply cause Mobiflight will send a Input only if you move the switch.... it will not check Startup position !!!

Let me say here.... For "Batt State" i would recommend to use the "internal Offset" of PMDG instead of a Custom Offset. then you can be "unsync", too BUT in that case your Homecockpit will show always the same situation like the virtual Cockpit. So maby your switch is wrong..... But you 100% know that virtual System is Out of Power if your Displays are blanked.


To solve this completly you got just 3 possible ways.

1. Standard State
You use always the same "file" in sim for Startup ( For example Cold and Dark) and you must set ALL latching switches to this basic positions PRIOR every startup.... So your Homecockpit is exactly in same situation like the virtual Cockpit in that file. ( Most users have a checklist for this)

2. Live State
Here you "save" the current virtual Panel State on every Shoutdown of Simulator to a new file and you will load this file on next startup. That means if you not touch a switch after that shoutdown until next startup then all switches are sync.... Cause you load that file again that represent last situation 1:1

3. Mobiflight Autosync.
You use this Function of Mobiflight to "sync" every single input one time with the sim..... So at first startup maby some systems are unsync.... BUT after using this button and waiting 5-10 Seconds every single switch is set in Sim to same position like in Homecockpit.
For exmaple your Display is ON whatever Battery Switch is OFF..... After using SYNC Function it will get OFF, too cause now the virtual switch is set to OFF ( Like in Homecockpit) by Autosync!

I personaly recommend Way 1..... the most profitable and 100% correct working solution !

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

About The sequnece Problem.
Sorry About that.....
That was just a idea and was correct. Looks like nobody try to build this like you..... Till now everybody create the "indicators" prior the the IF Function Config.
Thats a "Bug" we would never explore without a user like you.
Whatever.... I Not know if this can be fixed or if we simply need to define clearly that a "placeholder" simply must be create before the IF Config.

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

About "------" Dashes
As you already find out..... This is just another Indicator..... so you need just a more complex Transfrom field or a "precondition" with a additional config.
Problem is again that "---" dashes can not be used in transform field itself cause its a string character and only INT numbers are allowed.

Solution is to define TWO Fake Values here.....
Like IF Battery is OFF then show 99999
If Battery is ON but BUS State is xxxx then show 88888
Else show Value
With "a" for Battery and "b" for Bus State you can say e.g. ..... if(a=0,99999,if(b=0,88888,$))
In Compare you say IF $=99999 ... THEN "5x Space Button" ELSE if($=88888,'-----',$)
NOTE: Text between these 'text' Symbols (German Keyboad left of return key) i used to define String Outputs ina IF Condition on Compare Tab

So..... The transform manage 99999 for Blank or 88888 for dashes or Value if it should show Value directly.
The Compare say If 99999 then 5 times spaces.... ELSEIF 88888 then dashes ELSE Value.

************
About the Fule Gauge

Also Gauges with Motors can be combined with Placehodlers to Battery State for example.

Lets say your Fuel Gauge read a Offset that show 0-100 ( Fuel Capacitiy or so) .... So it turn to Zero at Value 0 and turn too endstop at value 100

If you here set a Placehodler "a" as battery state ( 1=ON 0 = OFF) and you say in transform "if(a=0,0,$)" then the value is always Zero aslong Battery Switch si OFF..... And Value Zero means your Servo turn on "0" Position of the Gauge..... Only if Battery is ON then it will show real value and turn motor to "live" position.

***********


Sorry for long text..... But you request lots of stuff.

I hope i could awnser all your questions !
And thank you for finding out that issue. I will report to Sebastian next time !
Good Luck !
2020-01-13 00:48
Go to page 1Go to page 012Go to page 2Go to page 2