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! 

icon
Avatar
goatie999
Posts: 1
Hi,

I'm 1 week into my learning curve on starting to link physical hardware to XP11 and the Zibo 737-800 (v3.39.32 in my case at the moment).

I may be making life WAY to hard for myself but in an attempt to make the most effective use of every available bit within the offset definitions where I'm defining the Offset in the XPUIPC configuration as a UINT8, I've hit a lack of understanding of how to write a switch's dataref value back to a specific bit of the 8 available within the defined offset.

I've been able to get this to work for read-only dataref like annunciators so wanted to replicate the setup for switches if possible rather than creating an entire UINT8 offset just to store a single switch value of 1 or 0 (which I've been able to successfully do with the following code:

iconCode:
Dataref swttest laminar/B738/buttons/autopilot/hdg_sel int
Offset	0x53F8	UINT8	4	rw	$swttest >swttest @


As an example of what I have tried (and failed) in my attempt of efficiency, using the Heading Select (hdg_sel) button on the MCP within the 6th bit location of Offset 0x5318 UINT8 :

iconCode:
Dataref swtmcpcptfd laminar/B738/switches/autopilot/fd_ca int
Dataref swtmcpatarm laminar/B738/switches/autopilot/at_arm int
Dataref swtmcpn1 laminar/B738/buttons/autopilot/n1 int
Dataref swtmcpspeed laminar/B738/buttons/autopilot/speed int
Dataref swtmcpvnav laminar/B738/buttons/autopilot/vnav int
Dataref swtmctlvlchg laminar/B738/buttons/autopilot/lvl_chg int
Dataref swtmcphdgsel laminar/B738/buttons/autopilot/hdg_sel int
Dataref swtmcplnav laminar/B738/buttons/autopilot/lnav int
Offset	0x5318	UINT8	4	rw	$swtmcpcptfd _
					$swtmcpatarm 2 * + _
					$swtmcpn1 4 * + _
					$swtmcpspeed 8 * + _
					$swtmcpvnav 16 * + _
					$swtmcplvlchg 32 * + _
					$swtmcphdgsel >swtmcphdgsel @ 64 _
					$swtmcplnav 128 * +


Anyone out there have any advice on the way to get this working? The example within the XPUIPCOffsets.cfg file would seem to suggest that it is possible but the example there addresses a different outcome and I'm struggling to understand the definition provided.

Defining the MobiFlight end of this seems to be lovely and simple mind you :D
2020-03-18 19:01
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3522
Supporter
In theory this should maby work..... The tutorial in the Config file look simular to your build.....
Maby a wrong syntax.... But the basic Idea looks correct.

Whatever..... I would not invest time here. XPUIPC normaly have thousends of empty Offsets cause it not include all the Stuff like PMDG Areas, Project Magenta Offset and so on.
So i think you can simply use 1 Byte Int Offsets for every single Boolean Input or Output. Hardly... You can also use 4 Byte Int for a Bool.... You will not reach the Limit of Offsets.
Good Luck !
2020-03-23 18:43
Avatar
knemsiz
Posts: 14
Hey,

You are lucky that you got my very first forum message. You need to add this code to xpuipcoffsets.cfg file. The rest is on MF. After command, you can use any offset value after 6500 as far as I know. Enjoy.

iconCode:
Command 0x6561 UINT8 1 0 laminar/B738/autopilot/hdg_sel_press _
0 1 laminar/B738/autopilot/hdg_sel_press
2020-03-24 16:26
icon