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
MicuMedic
Posts: 4
I am having issues with Radio Audio Switches to be able to hear the morse code and change NAV 2 Active / standby. Below is from the document of the offsets. I have audio for Nav1 working with offset 0x3122, Value type: INT Size of bytes: 1 Mask value with : 0x10 Set Value: 1
I really don't understand the 2^3 notation or what to do with this. It is the same issue for the Nav2 standby swap.

Bonus question. is it possible to have switch to turn it on (value 1) on the first depress then turn off (value 0) on t6he next depress?

3122
Radio audio switches (FS2002+ only). Read/write bit settings as follows:
2^7 COM1 transmit
2^6 COM2 transmit
2^5 COM receive both
2^4 NAV1 sound
2^3 NAV2 sound
2^2 Marker sound
2^1 DME sound
2^0 ADF1 sound For ADF2 sound, on FS2004, see offset 02FB.


3123
Radio Use/Standby swap toggles (FS2002+ only), Write bits to operate toggles. Don’t bother to read it, there’s no meaning to anything read.
2^3 COM1 swap
2^2 COM2 swap
2^1 NAV1 swap
2^0 NAV2 swap
2017-02-12 21:23
Avatar
pizman82
From: ETSI, Germany
Posts: 6010
Supporter
Hi.
This is just a kind of binary-decimal calculation.....

1 Byte gots 8 bits. We difine our bits with 1 for ON or 0 for Off.
If you write a decimal value in a full byte it got a range of 256 .
So the "²" or ^2 is just to define the specified bit.... Here is Formula .... Decimal .... Binary
2^0 =1 =0000 0001
2^1 =2 =0000 0010
2^2 =4 = 0000 0100
...
2^7=128 = 1000 0000
If you for example write the value 128 in this byte then the 7.th Bit (The highest bit) is set to 1 (all other to zero)

Normaly we would do this with Bit Masking..... But it look like the simulator only want ONE of the Bits high. To prefent a double bit high at same time we use the 2^x technic !
You can try if you want to use bit masking and what happend if you set more bits to 1 same time. ( I dont know if posible)


To question 2.
Normaly Yes.
the value you write should be a "IF Function"
For a standard offset boolean ( ON or OFF switch for example) you can use as value IF($=1,0,1) That means.... If you Push the button and the actual status is 1 then turn into 0.... if the button is 0 it would be change to 1 (toggle function)

Hope this helps !
Good Luck !
2017-02-15 17:52
Avatar
MicuMedic
Posts: 4
Thank you for the response but it was a bit more technical than I could understand for answer 1. I did get it working. Answer 2 was great.

For anyone for later. For FSX Nav 2 standby switch;

Off set: 0x3123
Value Type: Int
Size in Bytes: 1
Mask values with : 0x1
Set Value: 1


Answer 2:

For some reason, if($=0,1,0) would not work but if($=1,0,1) worked perfectly. Both should work but.... if($=0,1,0) worked every time.
2017-02-18 01:43
Avatar
pizman82
From: ETSI, Germany
Posts: 6010
Supporter
Nice to hear it workes...

iconMicuMedic:


Answer 2: Both should work but.... if($=0,1,0) worked every time.


Right ! Both should work.
Maby you got a little issue while testing....
Check if you use Comma "," instead of decimalpoint "."
Be shure you open and close brackets ()
Dont get additional SPACE in this formula.

*****************
iconMicuMedic:

Thank you for the response but it was a bit more technical than I could understand for answer 1. .



I try again with other words...
The byte 3122 for example got 8 Bit It can set 8 different things like the 8 Radio Switches !
Everytime one BIT is 1 then a switch set to ON.... If a bit is 0 then the switch set to OFF.

If we use Bitmasking like in other situations we do not write the whole byte.... We only change one of the Bit´s. In THIS Situation the special problem is that i think the Simulator only alow us to set ONE function to ON at same time....
So if we use Bitmasking and set every Bit seperate, it can happen, that one bit is already "1" and we put another bit to "1" and thats "not good" .
When we use the describted technic and write a value in the full byte (like 2^1 2^2 2^3 and so on) then this result in a perfect System....
Like i try to explane above with the chart, we always clear with this values all other bit except the one we want to set.

So if for example NAV 1 Sound is Active and we want Marker Sound now and write 2^2 (=decimal 4) in the whole Byte then the system sent 0000 0100 to the offset. So the
Nav1 Bit (0001 0000) from last function is overwritten and now Zero again to prevent double action.

Maby this was better to understand.... If not .... Just forget. This is a special situation we not need every time !
Good Luck !
2017-02-18 23:20
Avatar
tobypham
Posts: 13
im working with A2A C172, I can not switch off the NAV1/2 button with offset 0x3122 (switch on is ok)
when I change to Default C172, its ok for switch on/off, :confused:
it happens with COM1/2, NAV1/2
2017-04-26 13:05
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi.
We talked about this 6 weeks ago.

I told you, you maby can use EventID instead of Offsets, too.
A Mobiflight Forum search brings this..... https://www.mobiflight.com/forum/message/3185.html
Maby a LVar technic ! You should talk to the guys who build this plane, too.


Sorry to say but the A2A is maby not so easy to controll like other aircrafts.....
Maby there is a easy way, too.... But i can´t test it for you cause i not own the A2A.
My apollogy.

EDIT: And i think on Com1/2 this is normal...... If i´m right it´s not posible to disable this functions with a additional button Push. There MUST always be one COM Active.... You only can swap them with pushing the other one....

Please check first HOW it workes in the Virtual A2A Cockpit.... Can you there with a mouseclick disable a COM ?? Or can you there disable the Nav with a click ?
Remeber you only can do things that can be done in the virtual cockpit, too. Maby the A2A Software is different to the FSX Cessna in that point !
[Last edited by pizman82, 2017-04-26 16:43]
Good Luck !
2017-04-26 16:29
Avatar
albeagle
Posts: 142
Either COM1 or COM2 must be on at all times, but that's not the case with NAV1 and NAV2. I have A2A Cessna 172 so I will check and let you know.
Regards
AlbEagle

https://flyingforfun.weebly.com/
2017-04-26 23:30
Avatar
tobypham
Posts: 13
im testing with A2A C172
its weird when enable the button but can not disable that :confused:
i also test with Event ID, its not working. its working with ADF and MRK buttons only
2017-04-29 16:48
Avatar
albeagle
Posts: 142
With EventId should work. I am using switches and not tactile push buttons.
Regards
AlbEagle

https://flyingforfun.weebly.com/
2017-04-29 22:57
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
@ Avidflyer

I see you post the same text in the other Xplane Topic. https://www.mobiflight.com/forum/message/4782.html

Please confirm me first.... Is this all needed in FSX or is this just youre Improve Technic for Xplane and XPUIPC ???
Sorry im confused but i always think in FSX the Basic Bitwise System should work without any READ Configs and Comaperes and Preconditions !
The Problam with the swapping back Values is only in XPUIPC i think. Right ??

I must say i don´t understand youre technic with only one time reading..... I will check this on my next free days.
If you get more Informations or if i understnad wrong please tell me.

AND EDIT:
At the moment i check out for maby a Bug in the Mobiflight ReadOut Logic of Bitwise Offsets like this....
Please stay patient for some days... i need to make some test runs on my next free days. MABY This Bug if real existing is a part of this Problem too. I Will Report soon as posible!
[Last edited by pizman82, 2017-05-01 16:46]
Good Luck !
2017-05-01 16:26
icon