Dear all,
I read a lot about how to connect FSUIPC with PMDG, but still feel stuck. I want to start simple and just flick a switch for a start, so what I did is this to flick the AntiCollisionLight on the OVHD.
1) Adapt the ini of PMDG
2) write up a test function to switch the light switches
private Offset<BitArray> Lights = new Offset<BitArray>(0x0D0C, 2);
private Offset<int> sendControl = new Offset<int>(0x3110, true);
private Offset<int> controlParameter = new Offset<int>(0x3114);
private readonly int EVT_OH_LIGHTS_ANT_COL = 69756 ;
public void Process()
{
try
{
FSUIPCConnection.Process();
}
catch (FSUIPCException ex)
{
if (ex.FSUIPCErrorCode == FSUIPCError.FSUIPC_ERR_SENDMSG)
{
// Send Message error - connection lost to FSUIPC
FSUIPCConnection.Close();
} else
{
throw ex;
}
}
}
public void SetLightSwitch(int lightSwitch, bool state)
{
// this.Lights.Value[(int)lightSwitch] = state;
controlParameter.Value = EVT_OH_LIGHTS_ANT_COL;
sendControl.Value = Convert.ToInt32(state);
}
The function Process() is called through a timer in my .net windows form app every 200ms.
When I start the app nothing happens within PMDG 737NGX. I tested my functions with a default plane and I can switch my switches with the commented out line in my SetLightswitch properly, so the connection is working. I have difficulties understanding how to read and write to PMDG only using FSUIPC. Can you help me please and show me an example how it is done properly?