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
Sinver
Posts: 16
Hi all,

First of all, thanks very much for already having the beta for mobiflight to work with FS2020. Sure I know it is beta so might not be perfect yet but great start!

Using the preset offset value for Autopilot heading value, I send it to my 7 segment display. However, I am not able to grasp the necessary formula to have it display correctly.

Example, for heading 0 to 179, I used the formula ($*360)/65536, which works great. However, from 180 to 360 it returns a negative value. Any ideas how I can fix that?
2020-08-30 15:31
Avatar
Sinver
Posts: 16
Ok so I think I fixed it, not sure what you think. In the "compare" tabe I set a condition for if the value was negative to do the following "360=$". For example, at 358, the output was -2, so 360+ -2 made it 358.

However, the reason I haven't deleted the thread is first I don't know if the formulas used are correct, and also I have weird issue which I am hoping is just a beta thing.
Sometimes the value does not increase and is out by 1, so for example heading 12 on the sim will display as 11 on my output. Is this something to do with my formula or just a beta thing?
2020-08-30 15:47
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

At first split between the TWO different BETA´s .....

The Mobiflight Beta is just a testing if it can comunicate with the Sim..... Result is YES it can. So this will get into final Version 1:1 within the next days.
On that Point Mobiflight will not need anymore changes and is already fully compatible to FS2020 !

The Second BETA is FSUIPC7 .... As you know Mobiflight never talk to a Sim itself..... It always comunicate with FSUIPC.
For FS2020 there exist no final FSUIPC.... Only the v7 BETA. So if some systems will not work this means just they are not included in that V7 Beta already.
NOTE: Mobiflight is just the Software that controll your Megas. We not build the FSUIPC Stuff..... thats a commercial product of Pete and John Dowson !
So we can not change FSUIPC ourself..... We need to wait until the Dowsons give us a fully working Software !

**************
About your issues.
NO These is not BETA related.... These are working systems same way like they work in the past. In some Offsets FSUIPC use a strange logic. and we need to make some Compares and formulas to solve this "bad raw data"

For example the Heading:
This is a "Signed/Unsigned" Problem. Here FSUIPC send it´s data in a wrong format..... A Byte can have a value of 0 to 255 ...OR... -127 to +127.
So in the correct format Heading is 0-360 in the wrong format it is -180 to +179 and must be recalculated.
As you still found out we use here If Value is less then Zero <0 THEN $+360 ELSE $

Same problem ocures with your wrong values ( miss by 1) . This is a rounding Problem.
The official formula "($*360)/65536" result not in clear numbers like 124 Degrees. .... It result e.g. in 123,889 . FSUIPC want us to "round" it.
So 123,889 should be ( from point of view of FSUIPC) 124. BUT If we not tell Mobiflight it should round it it simply show 123 on your display and ignore the decimals.

If you use in transform Round(($*360)/65536,0) This command will round the result and the wrong +/-1 situation should be solved.
Good Luck !
2020-08-31 11:54
Avatar
Sinver
Posts: 16
Thanks as always for the help! I see now, and did suspect a rounding issue. I will try the solution and report back.

Thank you all for the amazing work you do!
2020-09-02 22:24
Avatar
missamo80
Posts: 32
For those who hit this same problem (like I just did) here's a summary of how to properly set up the auto-pilot heading output for FS2020 and FSUIPC7 using the above techniques:

FSUIPC > Use preset: Autopilot - AP Heading Value
FSUIPC > Transform: Round(($*360)/65536,0)
Compare > Apply comparison to modify the current value, if current value is < 0, set it to 360+$
2020-10-08 23:07
Avatar
ozguc.59@hotmail.com
From: yalova, Turkey
Posts: 6
Hello
I use fsx ,7 segment display.I have 7 segment display heading problem.
use display 6 7 8
use left paddin 0 ok
transform ($*360)/65536
offset 0x07CC

encoder turn right in fsx 0 between 359 no problem.turn left 359 between 0 no peoblem.
encoder turn right in 7 segment 0 between 359 no problem.
but;
encoder turn left in in 7 segment example: 359 I see in 7 segment 0-1
example :357 I see in 7 segment 0-3
example :320 I see in 7 segment -41
I need help.
2022-01-02 13:24
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Please not reopen old Topics.... specially if they are fully not related....
Topic title clearly say "FS2020" ..... Your question is related to FSX.... So thats the wrong place to ask !


About Problem:
Pretty sure your INPUT Configs are Wrong !
As you say if you turn in the Sim all is fine..... If you turn the real Encoder then you got a "Overflow" when you cross the 359-0 Border.

Pretty sure you use something like "$-1" or $-xxx" where xxx is a value for 1 degree.
So if your at "0" Degree and you say "$-1" then result is "-1" .

Solution:

1. USe EventID instead of a Offsert write Formula..... the event do the same like the Virtual Encoder. Means you not need to take care about anything else.

2. If you use Offset write then you need a IF Statement to handle the Border....
E.g. if($=0,359,$-1)
So it set the HDG always by -1 BUT if it is currently at "0" it not set -1 it directly set to 359.
For sure.... If you use the $-182 system then you need other Values....
Good Luck !
2022-01-02 15:34
Avatar
ozguc.59@hotmail.com
From: yalova, Turkey
Posts: 6
sorry ı have read and watched so much that ı did not know what to do.
I used +182 and -182 .ı did everything but this could not solve the problem.
age 62 meybe I shouldn't bother with these but I love aviation please help me to be happy
2022-01-02 18:19
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
No Prob.

As i said....

If you use "Event ID" instead of "FSUIPC Offset" for you input you not get in trouble......

A Offset Write must send the "new" value by calculation the current value with a formula ( like $+/-182)
A Event ID like ...
iconQuote:

HEADING BUG INC 65879
HEADING BUG DEC 65880


simply do the same like you will turn the virtual Encoder..... So you not need "calculations" you just say "If i turn my encoder then simulate a encoder turn in the sim"

****
If you still like to use the Offset System then you need to rethink the logic....
iconQuote:

07CC 2 Autopilot heading value, as degrees*65536/360



So the Offset goes from 0-65536 ...... 65536/360=182,044444 ~~ 182

You say +/- 182 for Left and Right.
Lets say Value is currently "0" ..... If you say $-182 result in 0-182=-182 ..... So your Display show "-1"
You need now a logic.....
359° is 359*182=65338 ..... 1° = 1*182=182
So for the "On Left" you need something like IF value is 0 ( below 1 means LESS then 182 ) THEN set to 359° (359=65338)
So formula for On Left : if($<182,65538,$-182) ........ Means the same like "If Value below 1 then set to 359 Else Set Current Value minus 1"
Good Luck !
2022-01-03 00:06
icon