Hello. I am hoping that someone can give me some direction for integrating a self-written external code into Prepar3D. What I am trying to do is extract and pass current aircraft information (location, angle of attack, side slip, etc.) from Prepar3D to my external code, where that aircraft information is used as the input to the code. The output of the code is load increments (forces and moments in X,Y,Z direction) that will then be passed back into Prepar3D to update the flight dynamics.
As of now, I am struggling to find where to begin on this integration process. Is this something that should be handled with simconnect? Are there any examples of something similar that someone could point me to? My external code is currently a Matlab file but can be re-written in C, another language, or compiled if needed.
Integrating External Code
Re: Integrating External Code
There is HttpX.dll and HttpX64.dll - an add-on, third party module that provides full duplex read/write capability of Flight Simulator Variables and Events across the panel set each update cycle via http protocol. It accommodates number and string values from A: (read), C: (read/write), E: (read), L: (read/write), P:Variables (read) and K:Key Events (write). It does not read .MDL exclusive L:Vars. HttpX works with FSX, FSXA, FSX Steam and P3D (through at least v.4.2), but not FS9.
So, if you can work with JavaScript, it might provide a solution.
Here are links:
https://www.fsdeveloper.com/forum/threa ... v3.439969/
and
https://www.fsdeveloper.com/forum/threa ... v4.442397/
Hope this helps,
Bob
So, if you can work with JavaScript, it might provide a solution.
Here are links:
https://www.fsdeveloper.com/forum/threa ... v3.439969/
and
https://www.fsdeveloper.com/forum/threa ... v4.442397/
Hope this helps,
Bob
Re: Integrating External Code
Or you could use the built in capabilty of SimConnect combined with the SimObject API.
Ed Wilson
Senior Developer
Mindstar Aviation
Senior Developer
Mindstar Aviation