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 folks, apologies for the potentially silly issue but I’m going mad!

I am trying to setup my mini home mcp panel, specifically for the Dreamliner in fs2020.

Using the fsuipc presets (via running the fsuipc 7) I have successfully managed to get it to display the outputs for autopilot speed setting, autopilot heading, and autopilot altitude.

Now I’m attempting to setup the encoders associated to those so I am able to adjust them. I have successfully assigned them pins on the Arduino, and have tried using the fsuipc presets but am having very strange results.

For heading, I have set the following:
(On left)
Preset - Autopilot Heading Value

Base settings:
Offset - 0x07CC
Value type - Int
Size in bytes - 2
Mask value with - 0xFFFF

Set value -1

The “on right” is the same, with the exception the “set value” is 1, not negative.

However when I try it, turn left or right just resets it to zero.

Any ideas why?
2020-09-21 11:50
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconSinver:


Any ideas why?



YES :thumbup: Cause you did a mistake ! :P

1. Try EventID !
I know some Events are already working.... others won´t work in current BETA FSUIPC. You should try out cause using events is much more comfortable and not need a formula !
Use the "old" List for EventID from P3D..... As i know there exist no list until now for FS2020 but the still working Events mostly have the same ID like in the past !

2. Via Offset
Your VALUE is wrong.....

iconSinver:


Set value -1
The “on right” is the same, with the exception the “set value” is 1, not negative.



You miss "$" .... if you write -1 or 1 this simply SET the Offset to that value ..... So whatever your offset is currently e.g. 240° You will write it to 1 or -1 in that case.

So basicly we like to say here " Use current value.... Add ( or subtract) e.g. 1 from it and write the result back to the Offset"
The Value must be always something like $-1 or $+1 ...... BUT also whis will not work cause those Offsets not show degrees in a clear way.
For exampel AP Heading:
iconQuote:

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


So a single degree means a value of 1*65536/360 = 182.04444444 So roundabout 182 . Offset inc/dec by 182 if you change Heading by 1°
So your formula must use $-182 LEFT and $+182 RIGHT.
Hopefully this work and do the override ( 359-->0 and 0--->359 ) If NOT we also must include this part in the formula ....
Like on left if($<182,65536,$-182) ..... On right if($>65354,0,$+182) ( Maby not 100 correct. We must try out if this work or if we need to adjust the values.)
Good Luck !
2020-09-21 14:20
Avatar
Sinver
Posts: 16
As always thanks pizman, not just for the answer but explaining too. I’m here to learn after all!

I tried you $-182 and $+182 and it works well, except one very strange thing.

Turning left reduces each degree by 1 as expected, but when it gets to 180 it will not decrease anymore. Same as if I turn right it increases as expected, but when I get to 179 it will not go further. Very strange!

I’ll play with the formula and preconditions a bit, but if I could trouble you for 2 things? One, why this happens, and secondly you mention using event id’s. I toyed with this too, but couldn’t find a list of the event id’s. I apologise if it’s right in front of me and I’m being blind but would appreciate it if you could point it out!
2020-09-21 17:56
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi again.
I´m sorry i not include this situation in my thinking!

1. EventID.
The List is include in the older FSUIPC Versions. I can send it to you via Discord or Email if needed or you simply install a old version and get it yourself.
e.g. for AP Heading....
iconQuote:

65879 HEADING_BUG_INC
65880 HEADING_BUG_DEC




2. Offset Problem

Looks like FSUIPC7 work a little different here. As i remeber this not happen in P3D
Why this happen..... Cause we got a Signed/Unsigned Problem here. Check this.... https://en.wikipedia.org/wiki/Integer_(computer_science)

A Offset can be SIGNED or UNSIGNED..... For example a 1 Byte Offset got a range from 0-255. Thats "unsigned"
The same byte also can be "signed" ..... Then it got a range of -128 to +127
Technical the Byte looks same way for Mobiflight.... 0=0 .... 127=127. .... BUT 128 = -128 .... 129 = -127 .... 130 = -126.... until 255= -1

So it looks to me like here we got a 2 Byte Value "signed" .... So from -32768 to +32767 .
So if you say on Left -182 this workes fine from 0-179° Cause here the Offset is positive.... BUT If Offset is between 180 and 360 the readed Value is Negative now.


EDIT:
My first idea was wrong.. I need to rethink the system. This take some time please !
Good Luck !
2020-09-21 19:54
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Sorry for double Posting.... I had to rework the idea...... In case i can not test in FS2020 hopefully this work....


Use ON LEFT : if($<-32586,$-182,32767)
On RIGHT : if($>32585,-32768,$+182)

NOTE: As i said.... EventID are more profitable. Hopefully FSUIPC change this problem until it get released finaly.
If this not work we need to check again. But pretty sure we find a way !
Good Luck !
2020-09-21 20:03
Avatar
Sinver
Posts: 16
I’m genuinely losing the will to live trying to find this list of event id’s. If you could discord it I’d really appreciate it!

Edit, found it!
2020-09-21 20:18
icon