DragonflightDesign
Resource contributor
- Messages
- 1,368
- Country

I'm being unkind to SimConnect again and it's repaying me with an exception 3: 'The client event, request ID, data definition ID, or object ID was not recognized.'
What I'm trying to do is get the payload station weights from an aircraft. Getting the number of payload stations is easy, but of course, it's an unknown quantity at runtime. So, what I have, looks like this. It's vb.Net but I'll accept any help in C# too
My starting point was this thread:
www.fsdeveloper.com
As soon as my code exits the function it is in (a button click) I get the exception.
What I'm trying to do is get the payload station weights from an aircraft. Getting the number of payload stations is easy, but of course, it's an unknown quantity at runtime. So, what I have, looks like this. It's vb.Net but I'll accept any help in C# too
Code:
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi, Pack:=1)>
Structure PayloadStations
Public station_weights() As Double
End Structure
Code:
Enum P3Data
REQUEST_PAYLOAD
DEFINE_PAYLOAD
End Enum
Code:
' Build the data definition - don't forget payload station enumeration starts from one
For i = 1 To nPayloadStations
dataRequest = "PAYLOAD STATION WEIGHT:" & i.ToString
p3d_simconnect.AddToDataDefinition(P3Data.REQUEST_PAYLOAD, dataRequest, "pounds",SIMCONNECT_DATATYPE.FLOAT64, 0, 1500 + i)
Next
' Now request the payload station weights once only
p3d_simconnect.RequestDataOnSimObject(P3Data.REQUEST_PAYLOAD, P3Data.DEFINE_PAYLOAD, SIMCONNECT_SIMOBJECT_TYPE.USER, SIMCONNECT_PERIOD.ONCE, SIMCONNECT_DATA_REQUEST_FLAG.DEFAULT, 0, 0, 0)
Design and programming problem: Adjusting Payload
Hi! This is my first post here although I've been trolling for some time to learn about the SimConnect SDK. My language/IDE of choice is Delphi but I hope you can help me anyway. I am working on a virtual aviation type program and I want it to adjust the payload of the aircraft depending on...
www.fsdeveloper.com

