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
idekkers
Posts: 3
Hi

trying to figure out how to set up 5 different toggle switches to work with this:

#0D0C Lights (FS2k/CFS2), a switch for each one (bits from lo to hi):
0 Navigation1 Beacon

2 Landing

3 Taxi

4 Strobes

5 Instruments

6 Recognition

7 Wing

8 Logo

9 Cabin

I set up a switch for each toggle in the 172, but when I try to use them, the first one toggles one, but each one after,
toggles the others off, and none of them switches off itself,
what am I doing wrong? do I need to use masks?

thanks
2021-03-18 23:50
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

AT FIRST: If i remember right then XPUIPC work in this special offset a little different to the standard FSUIPC System. Maybe we need to figure out the logic here and confirm if its still simmular or if we need to use some other logics here. Whatever.... What you like to do, should be possible finaly!

About your Question....
iconidekkers:


what am I doing wrong? do I need to use masks?



Exactly!! Cause it is written in your Offset List !
iconidekkers:


#0D0C Lights (FS2k/CFS2), a switch for each one (bits from lo to hi):



Normaly this is done with latching switches.... So we would MASK the Offset in a way that only the assigned BIT is active.... e.g. BIT0 for Nav.... BIT1 for Landing and so on.
Here the Switch simply use "1" for press and "0" for release. ( All switches same way just with different masked Bits)

If you use a momentary push button to toggle then this is a little more advanced and need a IF Condition .....
In the INPUT Config you choose the Offset and MASK again the needed BIT. As Value you say if($=0,1,0)
Only on Press is used here. Ignore the On Release!
Good Luck !
2021-03-19 09:02
Avatar
idekkers
Posts: 3
thanks for the reply,
but I still don't know how to actually do it :-/
this is what I have now:
Offset : 0x0D0C
Value type: Int
Size in bytes: 2
Mask Value with: 0xFFFF
BCD Mode : not checked (still have no idea what this does....)
Set value: 8 (for taxi)

I understand I have to change the Mask Value, but all I do just make it not work at all or work the wrong way?
for example, for Beacon which is bit 1 - I set value to 2, and I try to set mask to 0x02, but that does not work...
2021-03-23 12:41
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi idekkers,

please do as follows:
- Assign the Buttons you need as devices for the board.
- Create a config i.e. for switch the taxi-light
- click on EDIT (...) - the input wizard opens
- choose the module the taxi switch is installes
- choose the device for the taxi light
- now for On Press
-- take the FSUIPC Offset
-- insert in the base settings: 0x66C0 (the custom offsets are from 66C0 to 66FF)
-- value type is INT and the size in Bytes is 2
-- Enter the mask value with: 0x08 and if you open the box (...) you wil see bit #3 is set
-- if you have a latching switch insert in MORE OPTIONS beneath Set value 1
-- if you have a button or a non latching switch insert instead of the 1: if($=0,1,0) with a non latching switch you are ready with this config
-- if you have a latching switch:
-- click on tab OnRelease
-- choose FSUIPC Offset
-- insert offset 0x66C0
-- value is INT and size in Bytes 2
-- mask value with 0x08
-- more options set value is 0
- click ok
- click the Output tab
- make a config to read the offset 0x66C0
- insert in the base settings Offset: 0x66C0
-- value type is INT and size of bytes is 2
-- let the mask value 0xFFFF
click ok
run MF
if you press the assigned button the offset should show 8
If you have a latching switch the value should hold the 8 until you release it.
if you have a button the 8 will be shown until you press the button a 2nd time

If this example has been successful you can take the same config and instead of 0x66C0 you can insert 0x0D0C.
Assign the other buttons/switches in the same way. That's it.
Please report the result.
Grüße,
Stephan (Time: UTC+2)
2021-03-23 15:27
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Just to awnser the open questions.....

1. BCD
This is short for "Binary Code Decimal" ..... Please google for that to get more informations.
In short words.... This is a old system that is still used for some rare FSUIPC Offsets.
Its a mix from Binary and Decimal.... Here Numbers are split in 4Bit "NIbbles".
You not need to learn this.... Simply use it only if it is clearly flagged as BCD in the Offset lists! ... else NEVER use this Option !

2. Writing full Byte instead of Masking.

Your Right.... Bit 3 represent a decimal "8" .... But if you try to write the BYTE you get in the trouble you explane before.....
The Decimal "8" is in binary "0000 1000" . If you NOT use masking ( so all BITS are selected 0xFFFF) then MF write the WHOLE Byte.....
In this example it write all Bits to "0" except the Bit#3 that is write to "1" ( As explaned.... 8 means 0000 1000 )
So all Lights except Taxi are set to OFF now.

If you use Bitmask an you select only the bit#3 then all other Bits are not involved.... It will send now something like "xxxx 1xxx"
So all other Bits remain in there current state.... All other lights stay ON or OFF whatever they was before.

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

Summary:
This is pretty easy.... Click next to the MASK field to get into a GUI. There you see all Bits ( Bit0-15 in your case) and you can hook the checkmarks to OFF or ON whatever Bit you like to use. the Hexa Code is only used for advanced users cause it´s faster.... Feel free to use the GUI !
Good Luck !
2021-03-23 19:06
Avatar
idekkers
Posts: 3
thank you both so much
it works perfectly now
the thing I didn't get was that I tried to enter the value in "more options" instead of just 1 and 0.
2021-03-24 19:16
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Yes...

This is a little confusing.... But in case of the basic programming logic of Mobiflight we need to handle this....

NOTE:

There is a BIG difference between INPUT and OUTPUT here....

Lets say you build 2 Configs.... One Input and one Output.... Both use the same Offset and the same Bitflag.... Lets say Bit#3 is selected again.

For the INPUT Config we use Values 1 and 0 ..... Cause we WRITE here the specific Bit to ON/OFF or TRUE/FALSE:
You can not use a decimal Value like "8" here cause a single Bit can not be "8".... It is only 1/0 at all.
BUT
If we now look in the OUTPUT Config we have a different situation.
If we here read the 3#Bit then the Value for Output is "8" if it´s ON and it´s "0" if its off.....
Thats in case MF just read the Bit.... But it show it finaly in Decimal..... All "non-used" Bits are "0" ( Whatever they are 0 or 1 in real)
So lets say a Offsert is in true 1111.1111 If we read only Bit#3 then mobiflight will see 0000.1000 ..... and thats finaly "8"

Extreme example..... If you mask Bit 1,2,3 and raw value is still "1111.1111" then Mobiflight read "0000.1110" So it show decimal "14"


****************
Good Luck !
2021-03-24 21:12
icon