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
Marc1980
Posts: 12
Hello,
I have only been using this software for a couple of days and must say how great it is! I have come from using link2fs which I liked but this is sooo much easier.
I ham having some trouble with a couple of things. What I am trying to do is to create an annunciation panel. One of my lights is a stall warning which I have set up using airspeed and in the compare tab if my airspeed drops below 60 kts (7680) set it to 1 else set it to 0.
I do not want my stall warning going off whilst I am on the ground so I configured another output (aircraft on ground) 0x0366. I have configured aircraft on ground as G and in the transform box have used if(G=1,0,$) but it does not work, in theory the light should only come on if I am in the air and my speed drops below 60kts.

Also I have tried to set it up so that the annunciations are off when the battery is off. I have got this working with my gear led's but cant seem to get it working with the anunciators.
for example with the low fuel, in the compare tab if <11 (15%) set to 1 else set it to 0. This works but I created another output (Batt) and in the transform box if(B=0,0,$) but it does not work. The led's stay on even when the battery is off.
Any help would be great.
Thanks so much
Marc
2021-07-12 20:00
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi
Your on the right way and already understand the basic idea and syntax..... But you miss one important "main logic" how Mobiflight works !

The Value ($) is "looped" through the systems in a fixed way !

At beginning we READ a Value ( Whatever from a Offset via FSUIPC or from Simconnect in FS2020) .... This is the RAW Value ( That can be used in the TRANSFORM Field)
If you NOT use the "Transform" function then MF truncate the Value on that spot.... Means a FLOAT is going into a Integer ..... e.g. "1,987" is truncate to "1" .
If you use a Transform you can for example say "$+100" ..... Lets say Value is Raw currently 65 ..... Then 65+100 = 165 !!

NOW the important Part ..... BEHIND the Transform ( e.g. the final Output or also the Value you use in a Compare) is no longer the "raw" Value.... It´s the Result of the Transform ( or its the truncate raw value if you not use transform).

By the way...... SAME happen again behind the Compare ..... If you use the Interpolation System then the used Value is simply the Result of the Compare ( not the raw value) ..... Without a Compare it is the result of Transform ..... And again without transform also it is the truncate raw !

In easy words .... RAW Value ---> Transform/Truncate -----> Compare -----> Interpolation -----> Output

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

To explane your examples:

A ) Stall Warning:
You say in Transform .....if(G=1,0,$) G Represent the Ground Status.... (1 for on Ground 0 for in Air) .
Means..... If Aircraft is on Ground it change the Value to "0" ELSE ( If Aircraft is in Air) it uses the Raw Value of Airspeed !

Now your Compare say "If Value Less then 60 kts (<7680) THEN set to 1 ELSE set to 0 .

Do you already see the Problem ???
If Aircraft is Grounded we set Value to "0"by transform ..... BUT this "0" is NOW in the Compare also below 60 kts. Means the Compare must set to "1" in case Value is "0" (less then 7680)

B ) Low Fuel:
Same situation .... Transform say.... IF Battery is OFF then set to "0" .... Compare say "If less then 11 then set to 1. else to 0 .
If battery is OFF then Value is transformed to "0" ..... "0" now is less then 11 .... So LED is ON again.

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

Solution:
There are a lot of ways.... You can include this e.g. in the Transform completly.....
For example in Stall you could say .....
if(G=1,0,if($<7680,1,0)) (If G is 1 then always "0" .... Else ( so not on ground) if speed is below 60 then 1 ... Else ( Not Ground but Speed above 60) set to 0 .

Another way you can use the "OR - || command"
if(G=1||$>7680,0,1) ( If G=1 or if Value is above 60 kts then ALWAYS show "0" ... ELSE (In Air and below 60kts) show "1" .

Or you use your Compare Logic but a little different.....
Your compare say..... If below 60kts (7680) then "1" else "0" .
If Grounded you like "OFF / 0 " at all time ...... So say in transform if(G=1,7680,$)
Now we say something like "If Aircraft is Grounded then output a number that represent 60 kts" ..... So The Compare now means the Aircraft is faster then 60 kts that moment.
In case compare say 60 and above LED is OFF ...... We say simply " If Grounded then simulate a hypothetical speed of 60 to prevent the LED of going on"

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

NOTE: there are 1000+ ways to solve this situation..... Everybody use a different. Important is just it must work for you.
If you need help.... Tell me the situation, and i can build you a formula !
Good Luck !
2021-07-13 09:26
Avatar
Marc1980
Posts: 12
Thanks so much for taking the time to explain things so thoroughly. I really appreciate it. I now have most of my anunciators working. I still have a couple I need to figure out but will have a go first and if I get stuck I'll ask for help.
Thanks again
Marc :)
2021-07-13 21:24
Avatar
ehemad
Posts: 7
Hello
got stucked with the flaps lever behaviour
i am using an analog encoder
but i am not getting the rsult i need with it, when actioned it does not move to the place it has to
i am trying to setup the flaps movement for the cessna 172 using =0BDC offset (with increments of 5461 per notch)
what tansformation should i use to achieve this?, because if flaps up is 0 and if i do $+5461 it goes striaght to full flap.
what is the meaning of the @ in transformation? (setup values) if both are the same.?.. because if i type @1, the behaviour is quite decent, but not complete, i.e. it does not reach full flap ever, it does not do anything in notch 2 and goes to notch to if level set in full flap.(position 1 up and down does good, position 2 does nothing, position 3 goes to position n2 in the sim)

any idea welcome

thanks and regards
2022-10-10 19:39
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Multiple factors.... So lets split them up.....

1. The @

Here your idea "@1" make no sense.

Like i explane above the $ DOLLAR is the used symbol for the Target Value. So ( like explaned above) in Output Configs $ represent the raw value. ( Means the Value of the Offset or SimVar or Dataref we read from the Sim)
Input Configs work same way.... Here $ represent also the Value of the Sim we like to change.
E.g. if we like to increase the Heading by +1 we say $+1 ....
Lets expect HEading is a.t.m. 123 ..... $+1 means 123+1 .... Result is 124 .... So we Send at the end 124 to the sim.
In easy words.... We READ the current Value ( we also like to change/write) and we make a calculation with it like $+1.

The @ comes into MF with the Potentiometer Feature ( and is also used with the Config Item Inputs).
In the past MF only allow Inputs by Buttons and Encoders. Both have jsut two binary states..... A Button have ON or OFF .... A Encoder have LEFT or RIGHT.
A Potentiometer instead have 1024 different states.... and a Config Item can have endless different states.
So it was needed to define a "new" Symbol for that.
In easy words.... For those INputs ( e.g. Potentiometer) the "@" Symbol represent the Current State (Value) of that INPUT Device ( while $ already represent the Value of the Target same time).

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

2. Your Problem.
Is it a naming issue or do you really use a "Encoder" ???
Flaps are done in 3 ways....
Mostly we use a Potentiometer.
Some users work with switches for eatch detent.
And in rare cases we use really a Encoder.... But here we NOT work with physical nodges.

A Encoder have no physical postion.... It only know Left and Right.
If your Flaps Lever have Nodges and its position represent also the virtual Flaps State we need a SET System instead if a INC and DEC System.
Otherwise this occur in massive Sync Problems !

Please Confirm you use a Encoder..... or do you mean by fault with "Analog Encoder" in real a Potentiometer ?

****

3. Solution
If you know what device you really have then we can think about the right Config.
Also Aircraft is a factor.... this $+5461 can work but not have to.
Here we need to check out all facts and find the correct workflow!
Good Luck !
2022-10-10 23:46
Avatar
ehemad
Posts: 7
hi there
thanks for the answer
and you are right, i am calling the device wrongly
it is a linear potenciometer (analog) what is moving the flap lever (it is moving up and down)
lets see if with this you are able to help
thanks in advance and regards
2022-10-17 19:16
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconehemad:


lets see if with this you are able to help



simply check this Video.... It explane Step by Step to build and programm a Flaps Lever.

Link is beginning of the Setup if Input.
https://youtu.be/L5cjBkWiOKs?t=4824

If you still get in toruble simply ask again and tell me where you exactly stuck !
Good Luck !
2022-10-17 23:01
Avatar
ehemad
Posts: 7
HEY, that video looks very promissing
will test during the week and will let you know
from the video itself, i have got something clearly wrongly connected in the arduino, because servo does not move at all...

will start from scratch following the video and will report back

thanks again
2022-10-18 12:05
Avatar
ehemad
Posts: 7
Hi again
i followed instructions in the video
but i get a message saying No active simconnect conection
i am running mobiflight from a computer different of the one running the fs2020, although connected to the sim via widefs
i have read briefly about simconnect and arrived to a page in github explaining the python thing etc.
do i need to install that package into the sim computer?
2022-10-18 21:00
Avatar
ehemad
Posts: 7
i forgot to mention that the green clicks in the bottom left corner are both in green.... (modules and sim status)
2022-10-18 21:01
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
2022-10-18 21:16
Avatar
ehemad
Posts: 7
thanks again
will let you know how it goes after this
2022-10-19 10:22
Avatar
ehemad
Posts: 7
Hi again!
working!!
it took me a little bit of time but now it is nicely working...at least the lever... well the indicator is not, but i think it is something to do with either the servo or how i connected it to the arduino...
will work on that part now
thanks for your guidance
2022-10-20 08:23
Avatar
KevinBerlyn
Posts: 4
Marco.. I came across your post re the C172 presets. how did you go with the low fuel left and right. I am very new to mobiflight and flight sims . I have worked out most of the switches but I cannot work out how to get low Fuel left and right LEDS to work.
2023-07-18 10:14
icon