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.