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
HBilliet
Posts: 28
Supporter
I have just finished the tutorial to display the COM1 frequency using the 7-segment display, and it works fine. But I see that the frequency is missing the last digit? Example: 125.825 is displayed as 125.82.

I can perfectly understand why that is, because FSUIPC only returns 4 digits (32 bit as BCD), so 125.825 gives me the value 2582. I know that the first digit should also be 1, so I use $+10000 (as instructed in the tutorial) which gives me the 125.82. But I'm a bit disappointed that the last digit is omitted.

I looked at JeeHell FMGS (the add-on I'm using), hoping that they might have a better way to give the frequencies, but I can't find any specific offsets for it, so I guess they are using the default offsets as provided by FSX.

I tried to find something on the forum, but it seems that nobody is really bothered by that "detail"? Am I the only one being disappointed that I can't simulate the exact frequency?

There is of course a solution. There is some "logic" that could be implemented based on the last digit. Reason is that the steps are 0.025. So based on the last digit returned by FSUIPC (which can be 0, 2, 5 or 7), you can replicate the last digit (which will then respectively be 0, 5, 0 or 5):
  • Value ABC0 should display as 1AB.C00
  • Value ABC2 should display as 1AB.C25
  • Value ABC5 should display as 1AB.C50
  • Value ABC7 should display as 1AB.C75


But is there a way to program this with MobiFlight? Or do you really need to write some LUA code (no clue yet how to do that).
2020-09-11 21:49
Avatar
HBilliet
Posts: 28
Supporter
I always like a challenge B) So I solved it myself.

I put the following formula in "Transform":
($ + 10000) * 10 + ($ % 5) * 2.5

  1. The last part ($ % 5) * 2.5 simply gives me 0, 5, 0, 5 when the last digit of the FSUIPC value is 0, 2, 5, 7 ("%" is the module operator)
  2. Then I simply add 10000 to the FSUIPC value to get the leading "1", multiply by 10 and add the result of the above formula


@Moderator - would be nice if you could change the title of this topic to "How to show 6 digits for the COM frequency"

(PS. I don't know if somebody else found this - if so, I apologize and all credits go that person of course)
2020-09-11 23:23
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Your Idea is cool.... And Sure this is already be done multiple times ( and with a better forum software you would also find the topics via search ;) )
BUT
Your Problem is technical deeper.... Cause what do you do if the Simulator ( Like P3Dv5 or FS2020) also work with the 8.33 khz System ?
Then the last digit not work with the easy "2 and 7 need a 5" logic.... here lots of different 5´s are needed.

In that case FSUIPC give us a more profitable solution we MUST use with the new 8,33 System but we also CAN use with the old 25khz System.
(NOTE: this Offsets are NOT for FSX.... They will work only in P3Dv4 (FSUIPC5) or in P3Dv5 and FS2020.)

iconQuote:

05C4 4 Active COM1 frequency in Hz (32 bit int) Ok-SimC Ok-SimC
05C8 4 Active COM2 frequency in Hz (32 bit int) Ok-SimC Ok-SimC
05CC 4 Standby active COM1 frequency in Hz (32 bit int): Ok-SimC Ok-SimC
05D0 4 Standby COM2 frequency in Hz (32 bit int) Ok-SimC Ok-SimC

Good Luck !
2020-09-12 00:04
Avatar
fuginic
Posts: 8
Hi all,

sorry can you please explain better this issue?

I have the same problem but changing only the "Transform" field with ($ + 10000) * 10 + ($ % 5) * 2.5 doesn't work.
I see only 3 digits + "." + 2 digits.

I tried to change, in the Display tab, the number of digits. I tried enabling 1 or 7 but the frequency is every time wrong and it doesn't change 5 by 5 but I see 1, 7 or other numbers.

I'm using FS2020, can you please help me?

Thanks
Christian
2020-11-14 22:13
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Why so difficult ?

I still guide you to the new Offset. Other user still reported this should already work in FS2020.
Whatever also the quoted formula will work and logic is correctly.

In your situation at first split between a Software or Hardware issue.
In the Config Line you use to calcuate this there are 2 Collumns to the right. Pease check what is written there until MF is running.
E.g. with a frequency of 121.500 the left Column must show 2150..... the right 121500 .
If YES then the problem is in your Display settings. If not then your Formulas/settings are wrong.
Good Luck !
2020-11-15 02:55
Avatar
fuginic
Posts: 8
Hi,

sorry for the long quite period but I had the possibility to test it only during these days.

I retry to add the latest digit, but it doesn't work.
I understood what you wrote but I don't have the same behavior using my simulator:
when the frequency is 128.000 the display shows 128.000 (FSUIPC value 2800 Output value 128000)
when the frequency is 128.005 the display shows 128.000 (FSUIPC value 2800 Output value 128000)
when the frequency is 128.010 the display shows 128.012 (FSUIPC value 2801 Output value 128012)
when the frequency is 128.015 the display shows 128.012 (FSUIPC value 2801 Output value 128012)
when the frequency is 128.025 the display shows 128.025 (FSUIPC value 2802 Output value 128025)

My configuration is:





Can you please help me to understand where I'm wrong?
Thanks
Christian
2021-01-04 00:00
Avatar
Hortax
From: LFST, France
Posts: 19
Supporter
Hi Fuginic,

You simply use the wrong Offset (MSFS2020 or P3D, 8.33 kHz radios)
For COM1 Active, use offset 05C4
For COM1 Standby, use offset 05CC
For COM2 Active, use offset 05C8
For COM2 Standby, use offset 05D0
and uncheck (don't use) the transform box.

In my config for COM1 Active, i have the following values
Offset : 0x05C4
Value Type : INT
Size in bytes : 4
Mask value with : 0xFFFFFFFF (<- 8 F's)
BCD Mode : check
Transform : unchecked
[Last edited by Hortax, 2021-01-04 13:17]
2021-01-04 11:14
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

@ Fuginic

Like Hortax said.... You must use the NEW Offset if you like the 8.33 System.

iconQuote:


when the frequency is 128.000 the display shows 128.000 (FSUIPC value 2800 Output value 128000)
when the frequency is 128.005 the display shows 128.000 (FSUIPC value 2800 Output value 128000)
when the frequency is 128.010 the display shows 128.012 (FSUIPC value 2801 Output value 128012)
when the frequency is 128.015 the display shows 128.012 (FSUIPC value 2801 Output value 128012)
when the frequency is 128.025 the display shows 128.025 (FSUIPC value 2802 Output value 128025)



In the 25khz System the "steps" between not exist.... So there is no 128.005 , 128.010 and 128.015 !
If something is not exist it is not posible to show on a Display.... And the Formula you use is fully based on the 25khz System. So it will NOT work for 8.33.

Solution: Use NEW Offset and feel happy !

***************

@ Hortax
iconQuote:

In my config for COM1 Active, i have the following values
Offset : 0x05C4
Value Type : INT
Size in bytes : 4
Mask value with : 0xFFFFFFFF (<- 8 F's)
BCD Mode : check
Transform : unchecked


Looks good. Whatever BCD Mode should be Disabled. Looks like it not occure in a error.... But it is normaly not needed and finaly wrong as i understand.
Good Luck !
2021-01-05 18:37
Avatar
fuginic
Posts: 8
Thanks, It works!

Thank you very much for your support
2021-01-05 22:21
Avatar
TheIrishAviator
From: Ireland
Posts: 11
iconHBilliet:

I always like a challenge B) So I solved it myself.

I put the following formula in "Transform":
($ + 10000) * 10 + ($ % 5) * 2.5

  1. The last part ($ % 5) * 2.5 simply gives me 0, 5, 0, 5 when the last digit of the FSUIPC value is 0, 2, 5, 7 ("%" is the module operator)
  2. Then I simply add 10000 to the FSUIPC value to get the leading "1", multiply by 10 and add the result of the above formula


@Moderator - would be nice if you could change the title of this topic to "How to show 6 digits for the COM frequency"

(PS. I don't know if somebody else found this - if so, I apologize and all credits go that person of course)



This worked brilliant for me, thank you.
2021-01-25 17:25
icon