Simconnect setup for P3Dv3

Besides access to P3D data via FSUIPC, I wanted to know how hard it would be to connect directly to P3D without passing via FSUIPC. This should be possible via Simconnect, an API for P3D (which is also used by FSUIPC).

How to get everything working:

  • Get a copy of Visual Studio 2013 Express (I tried it with VS2017 community edition for hours but I failed big time getting the examples compiled/running. Most likely this was because the libraries are compiled in a different version (VS2017 uses platform 14.0))
  • Install all the SDK components
  • Set-up all required configuration files:
    • Simconnect.ini (C:\Users\maartenvd\Documents\Prepar3D v3 Files\Simconnect.ini), to be configured on the server side.
[SimConnect]
level=verbose
console=1
;RedirectStdOutToConsole=1
;OutputDebugString=1
;file=c:\simconnect%03u.log
;file_next_index=0
;file_max_index=9
    •  Simconnect.cfg (C:\Users\maartenvd\Documents\Prepar3D v3 Files\Simconnect.cfg OR C:\Users\maartenvd\Documents  OR in the client application directory), to be configured on the client side.
[SimConnect]
Protocol=IPv4
Address=192.168.0.10
Port=54321
MaxReceiveSize=4096
DisableNagle=0
    • Simconnect.xml (%APPDATA%\Lockheed Martin\Prepar3D v3\SimConnect.xml), to be configured on the server side.
<?xml version="1.0" encoding="Windows-1252"?>
<SimBase.Document Type="SimConnect" version="1,0">
  <Descr>SimConnect Server Configuration</Descr>
  <Filename>SimConnect.xml</Filename>
  <Disabled>False</Disabled>
  <!-- Example Local IPv4 Server Configuration-->
  <SimConnect.Comm>
    <Disabled>False</Disabled>
    <Protocol>IPv4</Protocol>
    <Scope>global</Scope>
    <MaxClients>64</MaxClients>
    <Address>192.168.0.10</Address>
    <Port>54321</Port>
  </SimConnect.Comm>
</SimBase.Document>
  • Copy the ‘simconnect.lib’ (e.g. C:\Program Files (x86)\Lockheed Martin\Prepar3D v3 SDK 3.4.22.19868\Utilities\SimConnect SDK\lib) to your console application directory
    • … and add the ‘simconnect.lib’ as command line option to the the linker options

  • Link the library where ‘simconnect.h’ (C:\Program Files (x86)\Lockheed Martin\Prepar3D v3 SDK 3.4.22.19868\Utilities\SimConnect SDK\Inc) is stored in the project or just copy the file to your application project directory

That should be it.

Sources:

  • http://www.prepar3d.com/SDKv2/LearningCenter/utilities/simconnect/simconnect.html
  • https://www.youtube.com/watch?v=kKlbEz0Oyew
  • https://www.youtube.com/watch?v=0b82zV2V5dE
  • https://msdn.microsoft.com/en-us/library/cc526981.aspx
  • https://msdn.microsoft.com/en-us/library/cc526983.aspx

Note: SimcConnect.xml and SimConnect.ini are not needed to use SimConnect under normal circumstances: SimConnect client addons that run on the same machine as Prepar3D will work without either of these two files.

Leave a Reply

Your email address will not be published. Required fields are marked *