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
bob755
Posts: 24
I'm pleased to say that I have all buttons, switches, encoders and leds working on my experimental PMDG MCP with Mobiflight.
I'm really enjoying using Mobiflight. It's a really cool piece of software and easy to use.

I have a question about the preconditions on inputs. If i want to program a precondition, I choose Config item as the type but the dropdown list of configs only contains outputs.
Is it possible to use another existing input state such as a toggle switch position as a condition?

Thanks
2018-09-03 12:05
Avatar
Otacon
Posts: 22
I don't thinks it is possible like that.

But you can use the Event ID that you change with the switch for an output.
You just have to create a new output with the event ID without choosing an actual output device.

Now you can use this configuration entry as a precondition.

I hope this was understandable :D
Greetings,
Maik
2018-09-03 14:36
Avatar
bob755
Posts: 24
I'm not sure I understand.
How does one create an output with an Event ID of the switch?

Of course, if there is an FSUIPC offset that gives the state of the switch, I could use that as a precondition.
2018-09-03 14:55
Avatar
Otacon
Posts: 22
What I mean is that if you have an offset connected to the switch position you can use this offset as an output.
For example:

Input
Switch1 up --> Taxi light value = 1
Switch2 down --> Taxi light value = 0

Output
Taxi light value (without actual device attached)
Greetings,
Maik
2018-09-03 15:18
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Right idea.... Not correct way !


1. Using state of your Real Switch (In Homecockpit ) for precondition is NOT possible a.t.m.
You can NOT use a Input Config as indicator for preconditions.

2. Using "EventID" as indicator is also not Possible.... Cause a EventID itself can not be readed directly.
So you can NOT make a OUTPUT Config and use there as TYP the EventID as adress ( like Otacon say)
(( But if there exist a event... Then in 99% there is also a Offset we can readout for this stuff ..... Stats what he mean)


3. Solutions:

Otacon basicly is right ... The trick is to "know" the current switch position. ( But this can not be done via EventID)

A ) Mostly we do this with a custom Offset! Our Switch controll the function in Simulator AND write a free Offset to a number..... for example a 3 Position switch write this offset to 1,2,3 whatever position it got..... Then we can READ this offset and "know" now in what position the switch is. ( And this Output can be used for precondition)

B ) Other way is to use a resulting Situation for this.... Thats what Otacon explane in last reply..... If your switch controll for example the Taxilight ( With a Event) then you need to know the "OFFSET" of the Taxilight .... If you Readout this offset you can combine in what position your switch is .... If Taxilight is ON then your switch must be also in the ON Position.

C ) Specialy PMDG give us here a additional way ( other Addons do not)
In PMDG exist for most multiposition switches a own Offset that will show the current position of the SWITCH !
So you not need to read a function ( like the real Taxi light in example) You can simply read the Position of the switch directly !

*******
Please try out your project with this information. If not work as you like please explane me WHAT exact you like to do.... Then i can give you a example solution !
Good Luck !
2018-09-03 15:55
Avatar
bob755
Posts: 24
I think the solution I found is similar to what you are saying. It does solve my problem.

I can read the current state of the toggle switch from the FSUIPC offset.
I created two inputs for the switch:

SW_ON input:
On Press sends EventID 70012 and Parameter 536870912 (left mouse down) to toggle the switch
On Release: none
PreCondition: SW_STATE = 0

SW_OFF input:
On Press sends 0 for EventID and 0 for Parameter
On Release: sends EventID 70012 and Parameter 536870912 (left mouse down) to toggle the switch
PreCondition: SW_STATE = 1

This prevents the switch getting out of synch with the actual state. Of course if the switch is in the wrong position at startup, I just need to toggle it to sycnh.

I hope my explanation is clear.
2018-09-03 16:18
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Basicly Yes...

But normaly that is not need for those situations !

I´m not on my Sim PC a.t.m. to test this....
Here the Standard technic normaly should work, too.

On Press you activate the AT Arm switch.... On Release you deactivate it.

If your switch in Cockpit is for example OFF but in Sim its allready ON ...... When you turn your Real switch to ON then nothing happend ! You try to set it ON but it is still ON in the System.... Thats basicly no problem and not must prevent by 2 Configs .... Setting to X when Sim-switch is already X will simply do nothing !

Maby we can talk about that in the future so you can explane me more detailed WHY you do that.... But on first view i would say that make no sense.
Good Luck !
2018-09-03 16:47
Avatar
bob755
Posts: 24
I'm a beginner with Mobiflight so I'm ready to admit that my method is not the best so advice is welcome.

The PMDG 737 autothrottle A/T is a toggle switch with an indictator light. In the simulator clicking either mouse button toggles the A/T each time.
The EventID for AutoThrottle A/T is 70012. So the event and parameter are the same for both activation and deactivation of the A/T.

If I only configure one input for my physical toggle switch with the same event for Press and Release then there is a problem if the state in the simulator is not the same as the physical switch. Changing the position of the physical switch changes the A/T state each time so it will never get back in synch. They wil always be opposite states.

It is possible to know the position of the A/T in the simulator by reading the offset 653A which is the A/T indicator light

If I create two inputs and use the indicator light state as a PreCondition, I may still have to move the switch once to synch them but after, both the physical and the sim switch will remain in synch.

Looking forward to your comments.
2018-09-03 20:49
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
ahh. Ok,. I understand.

I need to check this on my flight sim PC. May it take some time.... remeber me if i forget.

Basicly this is a PMDG problem finaly..... With Offsetcontroll we can say " If Switch is currently 1 then do xxx else do yyyy" ... There it will be easy.
But with a EVENTID (And PMDG allow input ONLY by this) there is no way to read a current value and to calculate the Command in case of this value.

So Your right.... Here 2 Inputs with Precondition are the only way at the moment !

BUT.... I will check it. Maby we can write the switch directly (not via Mouse klick toggle ) ... or maby Mousewheel also workes... So WheelUP will set to ON... Wheel Down set to OFF.
You can test it too.... Try to write 1 and 0 instead of parameter left click.... try to use Wheel Down Wheel Up Parameters.

Report expereience !
Good Luck !
2018-09-03 20:56
Avatar
bob755
Posts: 24
Surprise..!! . Writing 1 and 0 does operate the switches as you suggested. This simplifies things and avoids using preconditions
0 = On
1 = Off

Thanks for the suggestion.
2018-09-05 10:13
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Nice if it work....

But please Test this double !!!

In some PMDG Situations i remember the 1/0 System not work correctly. Here it look like it work but finaly it was just a happenstance and in other situations (like Button is Off in Sim and On in Homecockpit the 1/0 bring wrong result. ( Look like 0/1 just send also Mousecommands but not the correct ones there)
If Possible please test this config in all FOUR possible situations ( OFF in Sim ON in Homecockpit---- ON in Sim OFF in Homecockpit ---- ON-ON and OFF OFF )
Just confirm this is working fine here !


Summary....
I think "most" of the 2 Way switches ( Latching ON OFF Switches) in PMDG have a real 1 = PosA and 0 = PosB logic. ( 3 or more Position Switches work wit 0-1-2-3-4-5- and so on)
But Note.... There are "some" switches they work different..... So please Test every Input in all possible Situations before you say "it work fine" .
Good Luck !
2018-09-05 13:57
Avatar
shearder
Posts: 11
Hey guys,

I am dumb, so, I am battling to get multiple preconditions to work.

I want a rotary switch to switch between com1 com2 nav1 nav2 ADFS and then push button to toggle mhz/kHz as necessary.

I have spend days and just end up deleting everything.

Is there a thread for this or have you guys done this?
2020-11-25 07:59
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

This is explaned in 10+ Topics pretty sure
Whatever there is not explaned in a combination...... If you understand the System ( Using a Custom Offset to check the Switch Position or to generate a Toggle) you can do all this stuff.


A good hint..... Check that Videos..... This guy do all you need and explane it wonderfull !
https://www.youtube.com/watch?v=qlxT3i1fvN0&list=PLyC6aoYnRBZYsC3b92-dXXPuegigJHVpj&index=39

NOTE: I just link one Video..... I think thats the MhzKhz System. Just check the other videos . May he also explane already the Multiswitch,
If not maybe you still understand the system to build yourself. If you not be able to do.... Ask again then i can guide you !
Good Luck !
2020-11-26 16:56
icon