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
rvroman
Posts: 3
My apologies if this has been asked and answered before, but if it has I cannot find it.

Is it possible to have one 7 segment LED show two different values?

What I would like to do is have one DME that can switch between NAV 1 and NAV 2.

So with the toggle switch in the on position (on press):

Action type FSUIPC: Offset
Use preset: Radios - DME 1/2 Select
Offset 0x0378
Value type: int
Size in bytes: 2
Mask value with: 0xFFFF
Set Value 2:

I would see the DME information from NAV 2 on the LED display.



Then with the toggle switch in the off position (on release):

Action type FSUIPC: Offset
Use preset: Radios - DME 1/2 Select
Offset 0x0378
Value type: int
Size in bytes: 2
Mask value with: 0xFFFF
Set Value 1:

I would see the DME information from NAV 1 on the LED display.



The switch is working fine with the above settings and the DME on the computer screen switches as it should. That is what I would like on my instrument panel so I do not have to make space for two DMEs.

Thanks
2021-01-21 05:55
Avatar
rvroman
Posts: 3
So a Google search for "Mobiflight COM1/COM2" brought me to this thread https://www.mobiflight.com/forum/topic/2256.html which with some alterations gave me what I needed. I figured I would post the solution in case anyone in the future searches for DME as I did originally.

Because I was using an on/off toggle switch I had to make the following changes to the directions in the thread above. I suppose if someone was using an on/off/on toggle then they might need to follow the original directions.

Input:
  • Create a name for the switch, such as DME Switch, and assign it as a button that was already established through the set up/settings process
  • On Press: Use FSUIPC as the action type, but do not use a preset. Instead type 0x66C0 in the offset box. Change the bytes to 2. Place a 1 in the set value box
  • On Release: Do the same thing but type a 0 in the set value box
  • (This is assuming you will use DME 1 most of the time and this will keep your toggle switch in the off position whenever using DME 1


Output: (This basically follows the original directions, I just had to add more outputs as I wanted both distance and speed, rather than a single frequency)
  • Create 5 outputs, Status DME, DME 1 Distance, DME 2 Distance, DME 1 Speed, DME 2 Speed
  • For Status DME do not use a present on the FSUIPC tab, just type 0x66C0 in the offset box and set it to 2 bytes
  • For DME Distance 1 use the preset you want (I used Radios - VOR 1 DME distance (tenths nm) [offset 0x0300]. On the display tab check use left padding, check displays 1, 2, and 3, and place the decimal in column 2. On the precondition tab choose Config item, choose Status DME, and use =0 for the current value
  • For DME 1 Speed use the preset you want (I used Radios - VOR 1 DME Speed String [offset 0x0C2E]. On the display tab check displays 6, 7, and 8. On the precondition tab choose Config item, choose Status DME, and use =0 for the current value
  • For DME 2 distance and speed do the same things substituting the offsets for VOR 2 -**** where appropriate. On the precondition tab do the same thing, but use =1 for the current value


When you are done your 7 segment LED will show the distance and speed for DME 1 and DME 2 when you flip the toggle switch. It should be noted that the DME display on the computer screen will not change between 1 and 2 with the toggle switch. This is because the offset for DME 1/2 select was not assigned. But is not an issue because the goal of building a radio stack is to avoid using the on screen radio stack anyway.

But, if you want it to change on the computer stack as well just create another input for the same toggle you used above. I labeled it DME Switch - Computer. On the input tab choose Event ID as the Action Type. Then for On Press choose DME2_Toggle (event ID 65788) and use 1 for the Param.

For On Release again use Event ID and then use DME1_Toggle (event ID 65787) and use 0 for the Param.

Your toggle switch will then control the radio stack on the computer as well as the LED display in your panel, and the switch on your panel will stay in sync with the switch on the computer stack.
2021-01-21 10:34
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Nice you found a solution.... But please let me correct some missing facts.

Your right.... The Sim have no Offset that support us the current shown Values of the Virtual Display..... So we can not read it and show it directly.... We need as you expect the 2 Values in Single Configs and need a Precondition System ( with a indicator) that handle this.

So your Basic way is fine.... E.g. A Config for DME1 Distance and another for DME2 Distance. Both on the same Display Diggits. And both with a Precondition to the indicator.
Like IF Indicator is 1 then Config 1 is working..... If Indicater is 0 then Config 2 is working.

.......
Your "issues" or better your "unpracticable work"......

The way with a Custom Offset ( like 66C0) is only needed if the Sim not support us a working indication. We use this e.g. to build a Multi Radio ( that not exist in the Sim)
In your case with DME1/DME2 we already have a working indicator in the Sim.
As yous say in first Posting.... You write Offset 0378 to "1" or "2" that swap the Virtual Switch in the cockpit.
This means you can also simply READ this Offset.
iconQuote:

0378 - 2Byte INT - DME1 or DME2 select (1=DME1, 2=DME2) Ok-SimC Ok-SimE



So this Offset show 1 or 2 whatever DME1 or DME2 is selected.

So you can simply use this as indication..... Precondition of First DME1 Config (Display) say " Only work if DME Status 0378 Config = 1 And the other Config "Only work if that config = 2"

*****

Last Note: If you realy need a Custom Offset then your "Size 2 BYte" is wrong. For a simple Bool Offset ( 0 or 1) a 1 Byte is enough !
Good Luck !
2021-01-21 16:41
Avatar
rvroman
Posts: 3
Thanks for those ideas, I will try them out.

I just went with 2 bytes as that is what clicking on "use" resulted in, but good to know it can just be one. To be honest I am still trying to wrap my head around the whole "bytes" thing. I have read a lot of threads here and on the FSUIPC support forums that have tried to explain it, the binary aspect, how many places, etc. Unfortunately they get way too technical way too fast. I am still trying to find the "Bytes for Dummies" thread. :w00t:
2021-01-21 17:55
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
A Basic overview about the math aspects and how Byte, Bit, Decimal binalry and Hexa work.

https://www.mobiflight.com/en/tutorials/community-guides/working-with-digital-values.html
Thanks to Stephan for his work here!

The other way is google.... And specialy Wikipedia.

At my beginning some years ago a spent maybe 2-3 months just with reading.
Go from one point to the next.....
If you read something and there is a fact you not understand then google for this fact.... and so on and so on.

And finaly feel free to ask us or to start a voice conversation in Discod to other people. Lots of questions can be simple awnser within 2 minutes of talking instad of 5 hours of reading !
Good Luck !
2021-01-21 21:36
icon