- Messages
- 1
- Country

Hi all:
First time developing using simconnect.
I am trying to update new waypoint in front of the AI aircraft as the AI aircraft is flying. I see that when I send the first waypoint, AI aircraft will takeoff and fly towards it, but when I try to send another waypoint, I get exception 19 (invalid data size?).
I basically have a function (as a test) that will send a single waypoint by a button click. First time, no exception, everythings cool. Then after the aircraft is in the air on its way to the single waypoint, I call this function again by subsequent button clicks (right now for test I use same waypoint), I get exception 19. Even if I use a different waypoint (by another button click), I get the same.
Basic code is here
private void set_Single_Waypoint(double lat, double lon, double alt, double speed, DEFINITIONS d)
{
simconnect.AddToDataDefinition(d, "AI WAYPOINT LIST", "number", SIMCONNECT_DATATYPE.WAYPOINT, 0.0f, SimConnect.SIMCONNECT_UNUSED);
SIMCONNECT_DATA_WAYPOINT[] wp = new SIMCONNECT_DATA_WAYPOINT[1];
wp[0].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED;
wp[0].Altitude = 1000;
wp[0].Latitude = 47.445501972979;// 47 + (27.79 / 60);
wp[0].Longitude = -122.308007293086;// -122 - (18.46 / 60);
wp[0].ktsSpeed = 100;
Object[] objv1 = new Object[wp.Length];
wp.CopyTo(objv1, 0);
simconnect.SetDataOnSimObject(DEFINITIONS.Extra300SWaypoints, Extra300SID, 0, objv1);
}
I tried the freeze alt/lat/long, send the above waypoint, then unfreeze it, still get exception 19 (I dont think thats the problem).
I think my methodology of updating new waypoints is wrong...but out of ideas now...
This is for school project. Help will be much appreciated.
Sincerely,
Sam
First time developing using simconnect.
I am trying to update new waypoint in front of the AI aircraft as the AI aircraft is flying. I see that when I send the first waypoint, AI aircraft will takeoff and fly towards it, but when I try to send another waypoint, I get exception 19 (invalid data size?).
I basically have a function (as a test) that will send a single waypoint by a button click. First time, no exception, everythings cool. Then after the aircraft is in the air on its way to the single waypoint, I call this function again by subsequent button clicks (right now for test I use same waypoint), I get exception 19. Even if I use a different waypoint (by another button click), I get the same.
Basic code is here
private void set_Single_Waypoint(double lat, double lon, double alt, double speed, DEFINITIONS d)
{
simconnect.AddToDataDefinition(d, "AI WAYPOINT LIST", "number", SIMCONNECT_DATATYPE.WAYPOINT, 0.0f, SimConnect.SIMCONNECT_UNUSED);
SIMCONNECT_DATA_WAYPOINT[] wp = new SIMCONNECT_DATA_WAYPOINT[1];
wp[0].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED;
wp[0].Altitude = 1000;
wp[0].Latitude = 47.445501972979;// 47 + (27.79 / 60);
wp[0].Longitude = -122.308007293086;// -122 - (18.46 / 60);
wp[0].ktsSpeed = 100;
Object[] objv1 = new Object[wp.Length];
wp.CopyTo(objv1, 0);
simconnect.SetDataOnSimObject(DEFINITIONS.Extra300SWaypoints, Extra300SID, 0, objv1);
}
I tried the freeze alt/lat/long, send the above waypoint, then unfreeze it, still get exception 19 (I dont think thats the problem).
I think my methodology of updating new waypoints is wrong...but out of ideas now...
This is for school project. Help will be much appreciated.
Sincerely,
Sam

