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
slammer88
From: LTBJ, Turkey
Posts: 148
Hey,

I'm looking for someone who knows the basics of FSUIPC offsets and familiar with coding on XPUIPC. I want to integrate my cockpit with XP-11 via XPUIPC, so that i can use it with MobiFlight, but i can't find a way to work encoders and buttons. Led's are working fine so far..

Any help will be appriciated.
2019-01-18 20:55
Avatar
azminear@gmail.com
Posts: 13
I am new to this but have had some success with my encoders for changing com , nav and transponder frequencies.
If the selection is on one of the presets it is pretty easy.
2019-01-19 00:38
Avatar
slammer88
From: LTBJ, Turkey
Posts: 148
It's not, i'm talking about writing the codes in xpuipcoffset.cfg file from the scratch :)
2019-01-19 08:09
Avatar
Otacon
Posts: 21
Hi, Im not an expert but I can tell you how I am able to at least flip a switch..

I first you need to know the correct dataref (it's like an event ID but for X-Plane).
If you have a standard plane you should find most of the datarefs in the file X-Plane 11\Resources\plugins\DataRefs.txt.
But otherwise there is a nice little plugin that can help you called DataRefEditor. With it you can see and manipulate all used datarefs during simulation.

Then you can edit your XPUIPCOffset.cfg.
Here is an example I wrote (copy/pasted):

# Pitot heat 2
Dataref PitotHeat2 sim/cockpit/switches/pitot_heat_on2 int
Offset 0x4111 UINT32 4 rw $PitotHeat2 >PitotHeat2 @

The first line is just a comment.
The bold thing is the dataref.
The italic thing is a variable that you can choose freely.
int is the data type (it is mentioned in the DataRefs.txt). --> int=Integer
0x4111 is the offset that you have to set in MF. I just took a random free offset.
UINT32 is the datatype and lenght of the datastream that will send the values to MF.

Number of bits Min. value Max. value
8 bit 0 256
16 bit 0 65535
32 bit 0 4294967295


So in my example I actually just would need 8 bit.
The 4 is the priority and rw stand for read and write (in this case I would just need w).

This is my corresponding configuration in MF:
<onPress type="FsuipcOffsetInputAction">
<source type="FSUIPC" offset="0x4111" offsetType="Integer" size="2" mask="0xFFFFFFFF" bcdMode="False" inputValue="1" />
</onPress>
<onRelease type="FsuipcOffsetInputAction">
<source type="FSUIPC" offset="0x4111" offsetType="Integer" size="2" mask="0xFFFFFFFF" bcdMode="False" inputValue="0" />
</onRelease>

This was just a quick and dirty description and I think there are some mistakes but you get the idea.

There is a full description at the top of the XPUIPCOffset.cfg file.
Greetings,
Maik
2019-02-01 18:43
Avatar
Pinello
Posts: 1
Can you specify custom datarefs in the XPUIPCOffset.cfg, and XUIPC/Mobiflight will be able to use it? Like custom datarefs for the IXEG 737?

Regards
2019-03-23 16:42
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2578
Supporter
Yes. Thats what he explane above.


What i not know.... WHAT is a free offset.

In FSUIPC exist a complete free area (Whatever pretty small) on Offset 66C0 and the follow bytes.
BUT you can also use Areas that a reserved for example to PMDG or Project Magenta. Aslong you not use these AddOns that Offsets are already "free".

In XPUIPC i don´t know. Its bad that the "range" of Preselected Offsets is not include in this "cfg" file.

So.... basicly you can create a new "line" with the technic "otacon" explane ( find out Data Ref and set it to a offset of your choise)
What i NOT KNOW is what happend if you use here a Offset that is already used by XPUIPC internal list.

Result A: This offset will not work and the basic settings of XPUIPC have priority.
Result B: It give a crash cause your config and XPUIPC try to read/write this offset same time
Result C: It work.... XPUIPC give your custom Entrys more priority and stop the preselected Setttings if you use a offset manualy.

THATS what you need to find out ! ( Or you find a realy free range.... Then there is no problem finaly)
Good Luck !
2019-03-24 03:00
Avatar
Otacon
Posts: 21
As far as I unterstand there are no default offsets provided by XPUIPC.
Only the offsets defined in the XPUIPCOffset.cfg will be taken into account.
Which means all offsets not defined in the config-file are free.

So if you use the same offset multiple times it should use either the first or the last appearance in the file.
Greetings,
Maik
2019-03-25 09:31
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2578
Supporter
There MUST be default Offsets i think !

Most of FSUIPC Stuff is basicly working with XPUIPC and Standard Xplane Aircrafts.

For Example 0BC8 2 Byte.... It normaly show Parking Brake as i know.
Or 0BE8 4 Byte show us Gear Status.

Whatever this Offsets ( And hundrets of other Offsets) are included ( Thats the basic usage of XPUIPC) .
Is i understand this CFG File is just to include new Data (out of standard range) .... But badly the Standard Offsets are not listed here.( I think they include in basic script in win.xpl file)

BUT.... If you like you can simply test this ! ( I not own Xplane... So i can´t do this)

Step 1:
Read Offset 0BE8 ..... Gear Status.
Check if this Offset is working ( Get in aircraft.... Start..... Get Gear Up and check if Offset Change. )

Step 2:
If Offset work in Step 1 then NOW use your Code.... Read a Dataref of your choice (4 Byte) and write it exactly to 0BE8 as you done in the PitotHeat example instead to 4111

NOW.... Get into the Sim and Read again....0BE8 4 Byte INT.
Change PitoHeat and also Change Gear UP/DOWN.
WHAT is on that Offset showed..... Does it already show GEAR Status.... Does it show Pitot now (and ignore gear) or does it get buggy and stop working correctly ?
Good Luck !
2019-03-25 10:31
Avatar
Otacon
Posts: 21
You are right, there are default offsets in XPUIPC.
I tried 0BC8 which is not present in the config file and it worked.

Then I tried to override this offset with the master caution in the config.
What happened was that it still used the values of the parking brake, which means the default offset.

But as far as I remember regarding to some offset lists I find the range above 0x4000 was relatively free
Greetings,
Maik
2019-03-25 20:01
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2578
Supporter
yes. i think so , too..... And thanks for testing that !

4000 until 4200 (512 Byte)
4200-4300 (Blocked for a FSUIPC internal Sound-process.... So maby also free in XPUIPC
4300 until 6000 (7424 Byte)
6D80 until 7360 (1504 Byte)

All are listed as "reserved" in FSUIPC Lists. ( Mostly in Use for comercial AddOns and 3rd Party Software.)

Maby XPUIPC already include also some "AddOn" Sections in this areas.... But i not heard about that.

*****
Summary... I think it would be verry usefull if XPUIPC Puplisher would give us a "Up to Date" Offset List.... Whatever a full include of the whole offsets in this CFG File would be the best solution. then the User simply can rework every offset directly as he need it !
Maby somebody is in contact with them and can send a suggestion for that !
Good Luck !
2019-03-25 21:08
Avatar
slammer88
From: LTBJ, Turkey
Posts: 148
For me, unused Offset's are working flawlessly, you can find the full list on Pete Dowson's web-site or FSUIPC's folder. Some ranges marked as "unused". Try using them only with 1 bit, it works for buttons and leds, even for 7 segments.
2019-04-22 09:56
Avatar
slammer88
From: LTBJ, Turkey
Posts: 148
https://www.youtube.com/watch?v=lXuRwEiZa-s&t=4s
2019-05-25 17:20
Avatar
DocMoebiuz
Moderator
From: NW of KPWK, United States
Posts: 1301
iconslammer88:

https://www.youtube.com/watch?v=lXuRwEiZa-s&t=4s



I provided a comment to your video.
I was also not able to use the Command with an encoder. So what I did instead was to read and write to a Custom Offset using the DataRef:
sim/cockpit2/autopilot/heading_dial_deg_mag_pilot

iconCode:
Dataref ApHeading	sim/cockpit2/autopilot/heading_dial_deg_mag_pilot	float
Offset 0x66D0	FLOAT64	4	rw	$ApHeading	>ApHeading @
Have a great day!
Sebastian

MobiFlight - Simply build your own home cockpit for your favorite flight sim - FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2019-08-10 23:02
Avatar
slammer88
From: LTBJ, Turkey
Posts: 148
Hi Doc,

Sad to say but after converting into XP-11 completely, I've found another software called Air Manager which has native support for both sim's. Was a bit costly for me, but took a leap of faith and invested. After some painstaking LUA scripting, It has become just as I wanted. No delays, no crashes, stable as it is.

Had to do this somehow because, at some point, I wouldn't utilize my stuff as I wish via Mobi & XPUIPC. I stood away from SimVim because it was solely designed for XP and I had intentions to use my system with both XP-11 and P3D. Later I've decided to continue only with XP-11 until FS2020.
2019-08-15 08:14
Avatar
DocMoebiuz
Moderator
From: NW of KPWK, United States
Posts: 1301
We just released 7.5.3 that fixes the missing events problem with P3D and FSUIPC.

You might want to give it a try.

Have fun simming!
Have a great day!
Sebastian

MobiFlight - Simply build your own home cockpit for your favorite flight sim - FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2019-08-15 16:57
icon