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
kjoussen
From: Hamburg, Germany
Posts: 178
Hi there,

i think i went through the whole forum....if not...just send me the link to the thread and sorry.

FSX with Standard Airbus A321

According to the FSUIPC reference there is an Offset where you can switch single lights on/off by setting a dedicated bit. Sounds reasonable, but how to implement in MF?

Here is the reference

Offset 0D0C - Int - 2 bytes long (bits from lo to hi):
0 Navigation
1 Beacon
2 Landing
3 Taxi
4 Strobes
5 Instruments
6 Recognition
7 Wing
8 Logo
9 Cabin

Or is this not possible in FSX, allthough the standard A321 has seperated switches via software in the head over panel?

I think for switching on a dedicated light there must be something like $ or <Bit> and for switching off $ xor <Bit>

Thanks in advance

Kai
2021-10-09 21:10
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Yes this is possible....
Simply write a BIT instead of a Byte.

Adress here is Offset 0D0C .... Size 2 Byte .... Typ INT
Then you click on the "Mask Bit" Symbol in the next line.
MF will open a new GUI part where you see the single "Bits" ( In that case 16 Bits cause 2 Byte Offset..... Nubered from 0 to 15 From Right to left)
e.g. to controll Navigation Lights you disable all checkmarks expect the one from BIT#0 . And you write "1" for ON and "0" for OFF.

Same work for Outputs, too...... Just with one important fact...... Here MF Read a INTEGER Value instwad of the Binary Bit Value.....
So for exampe if you read bit#3 then it is like "0000 x000" Binary...... Means if Bit is "1" then MF Config value is not "1"..... Its "8". Cause "0000 1000" is decimal "8"
Good Luck !
2021-10-09 22:01
Avatar
kjoussen
From: Hamburg, Germany
Posts: 178
Ah, that's the trick :rolleyes:

Thank you very much.

But i have one small issue with the cabin lights.
In FSX / a321 the corresponding switch is 3-state switch, with value 0 for off, 32 (Bit 5!) with cabin an d panel lights on and 512 (bit 9 according to FSUIPC) which does....ah...i don't know.
And although my hardware switch controlling bit 5 of 0d0c is working, the switch in the visual panel of FSX does not react. The lights do (off or on), but not the switch. Hm...

Oh, and a small feature request for better usability for the dialog where you can set / unset the single bits. A button "deselect all" would be very handy.

Cheers

Kai
2021-10-10 11:42
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi Again !

About your suggestion.....
I create a Request : https://github.com/MobiFlight/MobiFlight-Connector/issues/523
Whatever.... Myself and most professional users not "mark" the bits by this tool.... You could also enter the Hexadecimal Value in the Field, without open this GUI.
But i think this would be a benefit to include your idea !


About Values.....
Thats what i explane above.....
If you read in the Output Config Only the special BIT ..... then the system not execute 1/0 ..... Techical it still read a Decimal BUT it ignore all unselected Bits and use "0" for it.
Lets say the Byte looks like this 0010.0111 If you read just Bit 5 Selected then MF see 0010.0000 - And thats Decimal 32.
Would you read the whole Byte here then 0010.0111 is decimal 39 Cause 1+2+4+32 = 39

About your Problem:
I not see what you do, and i can not test in case i no longer own FSX ( Just P3D and FS2020) .
May a issue in your Input.... Or the A321 use a special logic here.
But whatever..... If your Switch make the correct Command.... and also the needed light in the Sim is active. Then simply not care about the virtual Switch Position.
Good Luck !
2021-10-10 15:06
Avatar
kjoussen
From: Hamburg, Germany
Posts: 178
I know how to work with binary vs dec / hex / as i'm an IT-Consultant (above 50 :O )....but thank you anyway.

What i do not understand iswhy the stock A321 of FSX delivers 0 / 32 (= Bit 4) and 512 (= Bit 9) whereas last mentioned does not show any changes on the screen as far as i could see. And why the official FSUIPC reference says that bit 9 is responsible for the cabin light.
And why the visual switch on the screen does not react on changes of my hardware switch, as all others (Strobe, Landing, ..... name it, you got it) do.

But as you said, i don't care about the state of the visual switch on the screen, as the desired funktion is doing what it should. Well, i almost do not care...:-/
2021-10-10 20:06
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hard to give a awnser, again ! ..... Badly i have no way to test this.

And sorry for the "basic info"
Most users have no knowledge anout Informatics.... So the Hexa and Binary Stuff is a stranger fact for them !


Basically the logic is not always "clear". Specially in AddOns this can happen. But also the B737 and the A320 in FSX are additional Stuff. Yes its stock FSX but it was a new part and also use some own Offsets in FSUIPC.

For example.... There exist AddOns with some special systems..... So lets say the AddOn got a own Landing Light System ( like a B737 with extractable lights). Here the programmers mostly work with a own logic.... BUT they also must handle the FSX Stock Landing Lights to have the grafical effect of Lights in Front View Window.
Means.... If you press the virtual switch with the mouse then it move the switch in VR Cockpit.... AND.... it controll the SIM Stock Landing Lights internal, too.
If you now write the Event/Offset of the Stock FSX Lights here..... Then the Lights go ON, but the Virtual switch not move, cause you not use the Event for the AddOn Switch! You just controll the lights itself.

So... I don“t know what this Virtual Switch finally do. And whats the logic behind.

May the key is to write a Combination Value ! ... Find out what happen if you move the virtual switch by readout the Offset as a Output !
Lets say if you move switch the value is e.g. 33 then you know it activate bit5 (32) and bit0 (1) .
If you use for input not Bitmask and you write the whole BYTE..... Then a write of Decimal 33 occure in "0010.0001"
But take Care..... This write would set the whole Byte/Word ..... So if for example Bit0 is controlled by a own switch and you write the whole decimal, then this different Switch/system is involved, too!
Good Luck !
2021-10-11 13:02
Avatar
kjoussen
From: Hamburg, Germany
Posts: 178
It seems to be a bug in the stock Airbus of FSX.

There is a key combination for the cabin (= panel) light: Shift-L.
Funny enough, even when you press this Key, the visual switch in the panel does not move.

But there is probably a bug in MF as well.

To test it, i changed the input settings for this dedicated switch from FSUIPC Offset to "Keyboard", entered Shift-L in the corresponding line, clicked ok....but when i come back to this dialog, the input tab shows "No Action" instead of my Keyboard simulation.

Kai
2021-10-12 14:41
icon