Hey everyone!
A couple of years ago I've assembled an Arduino with a TFT display that shows the CDU text from PMDG's 737-NGX for P3D.
I recently bought the NG3 for MSFS and was porting my code to the MSFS SimConnect, but I'm having some issues retrieving the CDU display data. I can send the data just fine (such as FMC button clicks). Getting the display data that is the issue.
I'm not sure if the structures or IDs have changed, but I'm getting error 25 (SIMCONNECT_EXCEPTION_ILLEGAL_OPERATION) from SimConnect when trying to receive the data from the display with the code below (used to work fine in P3D and NGX). It's all in C#:
Here are the enums used in that function:
And here is where I register the data to be received (the same code I used in P3D):
Anyone has any idea on what might be the issue? I think the data definition values or perhaps the Data structures for the new PMDG might have changed, but I couldn't find any documentation about the new 737 SDK on PMDGs forum.
Thanks in advance,
A couple of years ago I've assembled an Arduino with a TFT display that shows the CDU text from PMDG's 737-NGX for P3D.
I recently bought the NG3 for MSFS and was porting my code to the MSFS SimConnect, but I'm having some issues retrieving the CDU display data. I can send the data just fine (such as FMC button clicks). Getting the display data that is the issue.
I'm not sure if the structures or IDs have changed, but I'm getting error 25 (SIMCONNECT_EXCEPTION_ILLEGAL_OPERATION) from SimConnect when trying to receive the data from the display with the code below (used to work fine in P3D and NGX). It's all in C#:
C#:
simConnect.RequestClientData(DATA_DEFINITIONS.PMDG_NGX_CDU_0_ID, DATA_REQUESTS.CDU_REQUEST, DATA_DEFINITIONS.PMDG_NGX_CDU_0_DEFINITION, SIMCONNECT_CLIENT_DATA_PERIOD.ONCE, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG.CHANGED, 0, 0, 0);
simConnect.RequestClientData(DATA_DEFINITIONS.PMDG_NGX_DATA_ID, DATA_REQUESTS.DATA_REQUEST, DATA_DEFINITIONS.PMDG_NGX_DATA_DEFINITION, SIMCONNECT_CLIENT_DATA_PERIOD.ONCE, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG.CHANGED, 0, 0, 0);
Here are the enums used in that function:
C#:
enum DATA_DEFINITIONS {
PMDG_NGX_CDU_0_ID = 0x4E477835,
PMDG_NGX_CDU_1_ID = 0x4E477836,
PMDG_NGX_CDU_0_DEFINITION = 0x4E477838,
PMDG_NGX_CDU_1_DEFINITION = 0x4E477839,
PMDG_NGX_DATA_ID = 0x4E477831,
PMDG_NGX_DATA_DEFINITION = 0x4E477832
}
enum DATA_REQUESTS : byte {
CDU_REQUEST,
DATA_REQUEST
}
And here is where I register the data to be received (the same code I used in P3D):
C#:
simConnect.MapClientDataNameToID("PMDG_NGX_CDU_0", DATA_DEFINITIONS.PMDG_NGX_CDU_0_ID);
simConnect.AddToClientDataDefinition(DATA_DEFINITIONS.PMDG_NGX_CDU_0_DEFINITION, 0, (uint)Marshal.SizeOf<PMDG.PMDG_NGX_CDU>(), 0, 0);
simConnect.RegisterStruct<SIMCONNECT_RECV_CLIENT_DATA, PMDG.CDUData>(DATA_DEFINITIONS.PMDG_NGX_CDU_0_DEFINITION);
simConnect.MapClientDataNameToID("PMDG_NGX_Data", DATA_DEFINITIONS.PMDG_NGX_DATA_ID);
simConnect.AddToClientDataDefinition(DATA_DEFINITIONS.PMDG_NGX_DATA_DEFINITION, 0, (uint)Marshal.SizeOf<PMDG.PMDG_NGX_Data>(), 0, 0);
simConnect.RegisterStruct<SIMCONNECT_RECV_CLIENT_DATA, PMDG.PMDG_NGX_Data>(DATA_DEFINITIONS.PMDG_NGX_DATA_DEFINITION);
Anyone has any idea on what might be the issue? I think the data definition values or perhaps the Data structures for the new PMDG might have changed, but I couldn't find any documentation about the new 737 SDK on PMDGs forum.
Thanks in advance,
Last edited: