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.

Posts: 14
Hi folks, I have an 8-position switch in my hardware (Airbus FCU, EFIS range knob), but the software (FSLabs A320) can only process an increase or decrease (= encoder turning left or right). So I am trying to emulate an encoder (left/right) with the 8-position switch.

8-position switch means 8 buttons. I want to assign a value between 1 - 8 to each button. This value will be sent to an offset in a Lua script. The script then compares the actual position to the previous position and knows the direction of turn.

The InputConfigWizard, Action Type: FSUIPC - Lua Macro, has a field "Value".

However, whatever value I insert, "Value" will always revert to zero.

How can this be changed? What am I doing wrong?

Best regards
2023-09-01 17:55
From: Hungary
Posts: 65
I've done similar in Xplane/Zibo 737.
The good news is that without any LUA script.
I needed a readonly value from the sim showing the actual position + 2 command for increase / decrease the position,
With this using preconditions and several inputs I can make the movement.
The logic is as follows:

moving from 0 to 1
precondition: current value 0
command for switch#1 increase

moving from 1 to 2
precondition: current value 1
command for switch#2 increase

moving from 1 to 0
precondition: current value 1
command for switch #0 decrease

moving from 2 to 1
precondition: current value 2
command for switch #1 decrease
Maybe this helps,
Do you know that you can simplify: if($=1,0,1) ?
Use simply: 1-$ :)
2023-09-01 23:03
Posts: 14
Thank you for your advice, Roberto. Unfortunately, the add on I am using (FSLabs A320) does not provide output values, so the position of the switch cannot be read.
2023-09-02 09:49