Find the original repo here
Wrapper for the SimConnect SDK for Microsoft Flight Simulator 2020 (Windows only)
This project is at a very early stage and wraps only a few basic SimConnect function calls. Feel free to join the development at the source! :)
node-simconnect is a native NodeJS addon written in C++ and must be compiled to a dynamic C++ library before it can be loaded as a module in NodeJS. Included in this repository is a prebuilt binary built with SimConnect 10.0.61259.0 (FSX SP2), which is compatible with FSX SP2, FSX:SE and all versions of Prepar3D. Because SimConnect 10.0.61259.0 is a 32 bit library, you must use the 32 bit version of NodeJS in order to import the module.
To install node-simconnect using the included binary:
npm install fspm-node-simconnect
Note: The included binary requires the 32 bit version of NodeJS.
Import the module:
const simConnect = require('node-simconnect');
The available functions are described below. Please refer to example.js for more help.
open(connectedCallback, simExitedCallback, exceptionCallback, errorCallback)
Open connection and provide callback functions for handling critical events. Returns
false if it failed to call
open (eg. if sim is not running).
var success = simConnect;
requestDataOnSimObject(reqData, callback, objectId, period, dataRequestFlag)
Each simulation variable is defined by an array.
"Plane Latitude" // Datum name"degrees" // Units namesimConnectdatatypeFLOAT64 // Datum type (optional, FLOAT64 is default and works for most data types)0 // Epsilon (optional, 0 is default)
requestDataOnSimObjectType(reqData, callback, radius, simobjectType)
requestDataOnSimObject. Used to retrieve information about simulation objects of a given type that are within a specified radius of the user's aircraft. See SDK Reference for more details.
This will receive info about the user's aircraft. For this, a radius of 0 is used. Notice that when
STRINGV is requested, the unit should be
Example: This will receive info about all aircraft within a 10 km radius. The callback will run one time for each identified aircraft.
Used to create a data definition. Returns an id which can be used with
requestDataOnSimObjectType in place of the array. This should be used when you have multiple requests for the same data - otherwise the app will crash after receiving too many requests.
var navInfoDefId = simConnect;
setDataOnSimObject(variableName, unit, value)
Set a single Simulation Variable on user aircraft. First parameter is the datum name, second is the units name and last is the value.
Subscribe to a system event. See SDK Reference for available events.
Manually close the connection to SimConnect. Returns
false if it fails.
var success = simConnect;
Manual build 🔨
You might wish to build node-simconnect manually. Due to the licensing of the SimConnect SDK (is this still valid?) the library files are not included in this repository, so you must provide these yourself.
- Node.js (64 bit)
- MS Visual Studio 2019
You must provide your own copy of the SDK files. For FSX:SE, these can be found under
C:\MSFS SDK\SimConnect SDK. Follow these steps carefully:
- Copy the
SimConnect SDKfolder here
$npm run build