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
magicnorm
Posts: 7
I have a rotary switch that sets the value of a Mobiflight variable to the position of the switch. 1 for 1, 2 for 2 and so on. I then read the value of the variable and use a precondition to define what my encoder will do (e.g. 1=HDG, 2=ALT, 3=V/S, 4=COM, 5=NAV)
My problem is when I start Mobiflight the value of the variable is always 0 and the rotary switch could be on any position (e.g. 2=ALT). So, if I turn the encoder nothing happens until I move the rotary switch to set the variable to the value of the position (because the variable in only modified “on Press”).
Is there solution to this? Is there a way to know the current position of the rotary switch?

Thanks
2021-09-06 13:31
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Yes and No.

At first.... This is not a Problem of MF Variables in the new Version. Your explaned problem is a basic feature of Mobiflight since many years !.
MF never "know" the state of a Input Pin itself..... It just detect a "Change" of a Input device in the moment when it happen.

So..... This occure also in every other "latching" switch. For example a simple 1/0 latching switch.
At Startup MF not know if switch is ON or OFF..... So maybe its ON but in the Sim the Aircraft Function is currently OFF. Only if you use the switch one time then its sync.

*************
Solution:

Most people work with a "Standard Startup State" . Means you will shout down your Aircraft after every flight in the 100% same way.
In your example..... Turn the Switch back to the Position, that represent the Value "0". Means at next Startup it is also "0" .... AND ..... In the used Sim Situation ( e.g. a B737 in Cold and Dark) you must get sure the Virtual switch is ALSO in this position.

Alternate:
Make a list of all Switches that have this behavor ( all latchings and roatrys) and use them 1 time all in a row at systemstart to sync them
OR
Use the Mobiflight SYNC Function !
Here you define a FAKE Button to start this feature..... Then Mobiflight will fire every single Input "virtual" one time and also do the same like above.... It sync every single funtion one time.
Good Luck !
2021-09-08 19:25
icon