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.

Go to page 1Go to page 112Go to page 3Go to page 2
Avatar
Gemu
Posts: 101
About Mustang. I have the F1 Kingair and I think the Mustang is quite similar in aspects of programming. Offsets may work with a very view things, but most will not. But it´s possible to make macros in FSUIPC. I did this with autopilot knobs and encoders and some other stuff. But macros didn´t work in virtual cockpit, only in 2d-panels. The Mustang have more panels than the kingair, so may more things can do with macros in an easy way.
I don´t use Mobiflight for this button and encoder stuff, so I don´t know if it´s possible to trigger macros via Mobiflight.

Greetings
Gert
2020-04-05 20:06
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
@ Gert....

More important is the Output Side.... Normaly on Every AddOn Inputs can also be done with Keys, Joybuttons and so on..... But if there is no FSUIPC Support it is finaly not possible to readout LED, Displays and that stuff.

Maby you can also report your experience here.
Good Luck !
2020-04-05 23:53
Avatar
MustangMig
Posts: 32
Hi Pizman82.
I answer you after exhausting fights with translators and tests ...
You say "I hope I gave you some usefull information!". Without your learned explanations, I would have already given up (I have not found any tutorial on the net).

I set up the Encoder (HDG) as you said, that is:
OnLeft Value "if ($> 0, $ - 1,359)" and OnRight Value "if ($ <359, $ + 1,0)
But unfortunately the behavior worsens, i.e. turning to the left, the first impulse does not act and the second sends the bug to 0°, continuing to rotate it is inactive, turning to the right nothing happens.
I don't understand, the logic and syntax of "If, Then, Else" seems to me to be respected.
Then I went back to the old setting OnLeft Value "$ -182" and it practically works, albeit with the limits I have already described to you.
I am pretently stopped. What can you tell me?

I answer to your other observations:
- "Logging Mode" is disabled.
- "FSUIPC Polling Interval" is at the default value 200ms. I also tried 100ms and 500ms, but frankly I didn't notice any improvements. Do I leave it at 200ms?
- Toggle Switch works with OnPress Value "1" and OnRelease Value "0"
- PushButton works with OnPress Value "if ($ = 1,0,1)" (No OnRelease)
- Yes, the Mustang AddOn for P3D v.4 supports FSUIPC.

Thanks once again for what you tell me.
(My previous Cockpit is this https://www.youtube.com/watch?v=zbgtj7bT5xE).
2020-04-07 11:41
Avatar
MustangMig
Posts: 32
Hi Gert
Sorry I'm late, but I saw that the second page had been created for this post.
I thank you for the information.
I had the Mustang working with FSX, then after a format it stopped working (black screen). I'll have to get it back for 64-bit P3D.
I did many tests, and I verified that many commands worked with FSUIPC, others with Macros, others only with Key2mouse. I hope MobiFlight manages to simplify the life of the simmer ... The road is all uphill.
Hello.
2020-04-07 13:22
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
@ Mustang

At first... Sorry for your problems with delays

You pretty understand.... Its hard to solve things i can not see and also can not reproduce.
Whatever System is used and what AddOn aircraft the things looks different.... For example lots of "Jeehell FMGS" Users report a laggy and slow working FCU.... Simply cause the System Of Jeehell ( Datapipe) is verry unpracticable and here Encoders are verry slow.
On other side i got a report some time ago about "not acceptable delays" and after i check a Video via WhatsApp then i see that System works already faster then my testing ground ..... so the User thought he got delays whatever his system was pretty fast already.
Without know all details of system and make some testings on your computer i can not tell you if delays are "normal" for your system or if there is a bigger problem !



About "If Else"
Here i hope the quoted Parts are just written here in forum for better optics..... Cause that syntax is wrong.
NEVER use Spaces in a Formula (Expect to set a Display to Blank)

For example you wrote:
iconMustangMig:


OnLeft Value "if ($> 0, $ - 1,359)" and OnRight Value "if ($ <359, $ + 1,0)


It only work without Spaces !!! so its.... if($>0,$-1,359) and... if($<359,$+1,0)


About basic Logic.... If Else Then is the most needed and absolutly basic system in Programming and also in Cockpitbuilding.... Whatever you not like to hear this..... This little part is a MUST HAVE ! You need to learn this as soon as possible ..... Whatever i help you if you got questions ! Simply Ask !



About your Formula....
I wrote :
iconQuote:

If Value would be 0-359 the On Right would be something like if($<359,$+1,0) For on left if($>0,$-1,359)



I not said that is correct for heading Display of Standard Aircraft Autopilot. That statement was just a example !!!
For example Jeehell Airbus use 0-359 Here its fine.... I not work with Stock Aircrafts but as we talk above i think here its 0-65536 and +-182 .

If yes you can simply use the same logic but you need to rethink it.
On Value 0-359 with steps by "1" we say on Left : If Value is between 1 and 359 then always "$-1" If Value is 0 then set 359 instead of $-1 .... in code if($>0,$-1,359)
If you have NOW a Value from 0-65536 and a step from 182 the system is is the same jut with other values.... From 182-65536 always $-182 If value is below 182 ( so a another subtraction occure in a minus value) we say SET to 65536 ( The Highest Value that pretty sure represent 359 ° ) ..... In Code if($>181,$-182,65536) We can also use "Bigger or euqal" then it would be if($>=182,$-182,65536) Thats technical the same !



Summary.....
Sorry for Confusing. I just wondering you got already a nice cockpit but get in trouble in this easy IfElseThen stuff..... How do you programm your old cockpit by yourself ???
Good Luck !
2020-04-07 22:00
Avatar
MustangMig
Posts: 32
Dear Pizman82
Finally also the Encoder WORKS. I'll explain why it cost me so much time and effort.

I conducted all the tests of the Encoder with the HDG instrument, and since this goes from 0 ° to 360 °, I believed that the designer of the instrument of that plane, had adopted the same "logic" of the instrument, that is Value from 0 at 65535.
I refused to think that different logic had been used, and on the verge of giving up I tried to test what I thought was extremely unlikely.
And yes, the designer used Value from -32767 to 32585, as if the HDG moved from -128 ° to + 127 ° (instead of from 0 ° to + 360 °). Such a choice would have made sense with an instrument or command ranging from -X to + X such as the Rudder. A lot of lost time, patience.

This is the Code I used: OnLeft Value "if($>-32767,$-182,32585)". OnRight Value "if($<32585,$+182 -32767)".
I also used OnLeft(Fast) with "$-1820" and OnRight(Fast) with "$+1820". It doesn't work perfectly, it's slow and "lazy", but patience, better than nothing.

You asked me how I found it difficult in "if, then, else" if I was able to do a "nice Cockpit" (if the Translator translated you correctly!). As you can see I had some justification ...
And in any case there is no doubt that without the documentation, anyone needs the help of experts ...
About the spaces in Value, I tell you that I have never entered them, the Translator adds them.

In conclusion, I thank you deeply, without your help I would have had to give up.
Hello.
Giancarlo
[Last edited by MustangMig, 2020-04-10 19:42]
2020-04-10 19:33
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
No Problem my friend....

I not use the translator.... Whatever my english is not the best i feel better to write in english as writing in german and trust into a translator. Finaly it takes me more work to doubl-check if translation is OK instead of writing in english directly.

About your "special" Heading situation .
Here thats not directly the fault of the Designers.... Its a Problem of FSUIPC and also of Mobiflight.

If you like to understand i will explane:

A Signed / Unsigned Offset is technical the same..... Its a question how we write and read it.... But the raw Data is simmular. ( Thats in case of "Binary" Logic)

For example a 1 Byte INT Offset have a range of 0-255 unsigned OR -128-+127 signed
BUT!!! A Signed not go directly from -128-+127 .... It go from 0-127 and then from -128 back to -1 !

For example:
Lets check the number 127 ..... Thats "0111.1111" in binary.... This is same ( Whatever Signed or Unsigned)
Next Number in binary would be "1000.0000" But that number can be read in 2 Ways.... Signed it´s "-128 " unsigned its +128

Again next number would be "1000.0001" .... That can be signed -127 OR unsigned 129

To calculate and understand this..... See the Left bit as +128 in Unsigned or as -128 in Signed.... And simply add the right 7 Bits number to it.
In our example x000.0001 Right bits have value "1" so 128+1=129 (unsigned) OR -128+1= -127 (Signed)


This workes until "1111.1111" that is finaly signed -1 or unsigned 255
Same logic ... x111.1111 represent 127 .... 128+127=255 (unsigned) OR -128+127= -1 (Signed)


Summary.... Mobiflight read all Offsets same way.... Sebatian thought thats more easy for the users...... IN 98% of Offsets this is right..... But sometimes like here a Option would be cool..... But i agree with Sebastian. With that Option lots of other user get in trouble cause they use it wrong way!
Good Luck !
2020-04-10 22:43
Avatar
MustangMig
Posts: 32
Hi Pizman82
Very interesting, as always, your learned exposure, but you see it from the programmer's point of view, and you have your reasons.
Instead I see it from the user's point of view, and I too have my reasons. Let me explain.

In my case (the war with the Encoders), I think that few users would have had my tenacity in insisting, other users, in my opinion, would have given up on MobiFlight.
In fact, I believe that an "easy" AddOn can be more successful than a "complicated" AddOn, even if the latter is more complete.

Finally one more question, do all commands work with Value from -32767 to 32585? (I have not yet bought the Mustang and still cannot verify).

Thanks Giancarlo
2020-04-14 12:44
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
There is no wrong or correct point of view.... Your arguments are also correct same way as mine.

The Problem is..... Most user not read Manuals.... And also most users not like to invest 5 minutes to test this simple thing by themself.

Finaly maby only 10% of Users are motivated to realy study the System of Binary Logics.....
For example Stephan still write a guide in the Tutorial Section here on Mobiflight Webside.... And also a short View in Wikipedia is helpfull
https://en.wikipedia.org/wiki/Integer_(computer_science)

The final Problem..... I agree a Option in FSUIPC Tab to say "Use Signed OR use unsigned" would be nice.... But here also the user must know what Signed or Unsigned mean.
If your value not work fine and is wrong like in your example.... How a User without knowledge about the thematic should know he can solve the problem by activating that Option in Mobilflight.

*********
About your Question...... I don´t know if Mustang Users are here. I also not know if Mustang is basicly compatible with FSUIPC.
Here its much more logical to ask this question in the "Mustang Support Forum".
But.... to awnser... IF they support FSUIPC then the pretty sure not use those unlogical stuff like the example Value above. Mot AddOns with FSUIPC Support work clean !
Good Luck !
2020-04-14 16:33
Avatar
MustangMig
Posts: 32
Dear Pizman82
I tried to ask here about the Mustang, because at the Flight1 Mustang Forum you can only write AFTER purchasing the plane !!!

Allow me another question.
I noticed that with the Arduino and MF there are no conspicuous "Bounce Problems" that instead were with the Leo Bodnar cards. Could you briefly mention the reason?

Thanks for the umpteenth time ...
Giancarlo
2020-04-16 18:55
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Bounce Problem ??

Please give me a example. I not understand.... pretty sure i use another word for this !
Good Luck !
2020-04-16 19:30
Avatar
MustangMig
Posts: 32
Hi Pizman82.
In a ToggleSwitch (or PushButton or Encoder) there is always a steel spring that "pushes", and when you operate the Switch, the spring Bounces (Ooon Oooff, Oon Ooff, On Off). For this reason it may happen that after activating the ToggleSwitch of the Lights (for example), we will have the ToggleSwitch in On, BUT the Lights in Off!

Bouncing is a Cockpit Builder's worst enemy.

For Arduino there are various Anti Rebound sketches called "Debouncing", they transmit the signal with a delay of about 50 m/sec, ie after the Rebound has faded.

Given that I have not noticed any malfunctions with ToggleSwitch or PushButton, but only small malfunctions with Encoder.
I ask you: is the Polling Interval (200 m/sec) that transmits the signal with delay, that is, it activates the Anti Rebound?

Thank you.
Giancarlo

(Maybe we should move this topic to another tread?
2020-04-17 13:21
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
I not remember to bug reports about that thematic. I also not know that Sebastian include a code to protect us from that bouncing!


Whatever.... Where is the Problem ?

Latching switch ( ON OFF) can not Bounce.... Cause it have ony two latched Positions.... And Only Latching switches would be problematic if they get unsync.

A Monentary button not care about if function was send.... Cause after use it it have again the same physical basic status ( Off Position) .
So... If your Function in Sim is OFF and you press your Button.... and it toggle to ON but in case of bouncing it again set to OFF.... Thats finaly no Problem. You see in Status LED of the Button that the Function is OFF again. If this happen simply press the button (slowly) again until LED shows function is correctly ON.

Same logic for Encoders.... Who care about missing Inputs in a encoder.... Simply turn it aslong the value is correct.

iconMustangMig:


Given that I have not noticed any malfunctions with ToggleSwitch or PushButton, but only small malfunctions with Encoder.



You say it workes for you.... So not think about that.
Good Luck !
2020-04-17 18:28
Avatar
MustangMig
Posts: 32
Dear Pizman82.

Of course, of course you say well. But it would have been more "elegant" to correct even the small malfunctions of the Encoders, patience.
Thank you for your availability and patience.

Hello
Giancarlo
2020-04-18 19:06
Go to page 1Go to page 112Go to page 3Go to page 2