Aerofly FS4 SDK - External DLL

  • Hi, I am very glad to open a discussion about the released updated DLL for connecting AFS4 with external applications. Here I leave a short Claude Sonnet 4 non-technical overview of the DLL, so we get an idea of what does it includes and what we could do with it.

    Aerofly FS 4 External DLL SDK - Overview

    🔌 What is it?

    The External DLL SDK allows external programs to connect directly to Aerofly FS 4 and access real-time flight data. Think of it as opening a data stream from your aircraft that other software can read and use.

    📊 What Data is Available? (285+ Variables)

    🛩️ Aircraft Position & Movement

    • GPS coordinates (latitude/longitude)
    • Altitude, heading, airspeed
    • Pitch, bank, vertical speed
    • Position in 3D space

    🎮 Flight Controls & Systems

    • Control surface positions (ailerons, elevator, rudder)
    • Engine data (throttle, RPM, fuel flow)
    • Landing gear, flaps, brakes
    • Autopilot settings and modes

    📡 Navigation & Communication

    • Radio frequencies (COM, NAV, ADF)
    • GPS and navigation data
    • Transponder codes
    • Course selections (OBS)

    ⚙️ Aircraft Systems

    • Engine status (running, starting, fuel)
    • Warning systems and alerts
    • Environmental data (wind, weather)
    • Performance limits (V-speeds)

    📐 Simulation Controls

    • Time and weather control
    • Camera/view positioning
    • Aircraft repositioning
    • Simulation state (paused, etc.)

    🚀 What Can This Enable?

    For Users:

    • Custom instrument displays on tablets/phones
    • Integration with navigation apps like XCSoar
    • Physical cockpit hardware (switches, panels)
    • Flight data recording and analysis

    For Developers:

    • Real-time access to all flight parameters
    • Two-way communication (read data AND send commands)
    • Professional-grade interface suitable for training systems
    • 60Hz update rate for smooth, responsive applications

    💡 Key Benefits

    • Complete transparency - Access to nearly every simulation parameter
    • Real-time performance - Data updated every frame
    • Bidirectional - Read flight data AND control the aircraft
    • Professional grade - Used in commercial training systems

    🎯 Bottom Line

    This SDK transforms Aerofly FS 4 into an open platform where developers can create custom instruments, training tools, navigation integrations, and hardware interfaces. It provides the foundation for the community to build the advanced tools that serious flight simulation demands.


    The External DLL SDK opens Aerofly FS 4's full potential for professional and enthusiast applications. 🛩️

    Best regards, Juan

  • The possibilities are endless:

    • Send aircraft position data to some external programm, like an external ATC client or moving map - and this could be a local or internet service. There are plans to connect to Sayintensions, but this could also include VATSIM or a virtual airline client.
    • Interact with hardware like motion rigs, or other custom hardware not being able to register as a regular game controller. Think of external cockpit instruments like dedicated radio panels, e.g. Logitech cockpit panels
    • You could also improve mechanics like an external source for system failures on your aircraft, or have a talking co-pilot, screaming passengers or even a more dynamic custom mission generator.

    ...but for everything that needs the weather to change dynamically or inject traffic from the outside.

  • What this doesn't summarize...

    You can basically send ANY aircraft switch, knob or lever command as if you were interacting with the aircraft with a mouse or input device as well. So not only can you set radio frequencies but you could also theoretically write support for your custom home built cockpit and make every switch work.

  • An ambitious project I would like to try in the future, when Moza release an SDK for flight products (actually their SDK is only for racing products), is trying to implement force feed back telemetry, so the Moza AB9 could react to what is happening in the simulator.

    Actually, the Moza AB9 can be used with AFS4 (already tested), but with fixed force parameters. To have full Moza implementation, we need to provide the joystick the simulator parameters, so it can react accordingly to it. For example, shaking with the engine rumble, vibrating when the flaps move, loosing force in stall, etc.

    Best regards, Juan

  • What this doesn't summarize...

    You can basically send ANY aircraft switch, knob or lever command as if you were interacting with the aircraft with a mouse or input device as well. So not only can you set radio frequencies but you could also theoretically write support for your custom home built cockpit and make every switch work.

    Thanks Jan for your comments. With the SDK release, we will be able to have full FlyShirley implementation. It can interact with the sim as an assistant, like adjusting lights, flaps, etc.

    Best regards, Juan

    Edited 2 times, last by Jugac64 (June 7, 2025 at 12:32 PM).

  • What i think about this ...

    is it now (again) ready für a (6dof .. or 3) motion platform control ?

    The update rate is not fast enough for that and that would require an entirely different interface dedicated just for high speed telemetry. But the DLL is not meant for that. The DLL is more suited for moving maps, flight tracking or similar things.

  • Thanks Jan, I did some research and you are right, FFB needs 500-1000Hz data feed to work optimally. A first level implementation could be this (analysis with ChatGPT):

    It’s possible to implement a lightweight force feedback system even when receiving low-frequency data (1–2 Hz), by triggering short force effects based on discrete events rather than continuous physics simulation. For example, you can apply brief feedback pulses when flaps are extended, landing gear is deployed, or touchdown occurs. This approach reduces processing demands and avoids the need for high-frequency telemetry, while still enhancing immersion and situational awareness. Ideal for applications with limited data rates or simpler simulation goals.

    Best regards, Juan

  • This is the first work I want to do, an Aerofly-Python SDK, so we can interact with the sim from Python (or another) aplications. Claude 4 can explain it better than me :)

    Aerofly FS 4 ↔ Python Real-Time Bridge Project

    🚀 What we're building:

    A real-time data bridge that connects Aerofly FS 4 with Python applications, enabling live flight data streaming and external instrument development.

    🔧 How it works:

    1. Modified DLL - Enhanced the official External DLL sample with TCP server functionality
    2. JSON Data Stream - Converts all flight data (285+ variables) to JSON format
    3. TCP Bridge - Serves data on localhost:12345 at 20Hz update rate
    4. Python SDK - Easy-to-use Python library for connecting and processing flight data

    📊 Available Data:

    • Aircraft position, attitude, speeds
    • Engine parameters, fuel, systems status
    • Navigation radios, autopilot settings
    • Controls input, gear, flaps status
    • Performance data, warnings, environmental info

    💻 Technical Overview:

    DLL Side (C++):

    Code
    // Receives data from Aerofly FS 4
    // Converts to JSON format  
    // Serves via TCP on port 12345

    Python Side:

    Python
    from aerofly_fs4_sdk import AeroflyClient
    
    client = AeroflyClient()
    client.connect()
    
    # Get real-time flight data
    lat, lon, alt = client.get_position()
    speed = client.get_airspeed()

    🛠️ Current Status:

    • ✅ DLL modification complete with TCP server
    • ✅ JSON serialization of flight data
    • ✅ Python SDK framework designed
    • 🔄 Currently testing compilation and connections

    Best regards, Juan

  • That's awesome - I would like to implement it but on Mac that seems a big no no.
    Hopefully one day...

    Sorry to hear that.

    @Jet-Pack is there a way to compile on a Mac? Or at least to compile for a Mac? As I understood DLLs are not a Mac-thing?

  • Just for the record, a lot of what AIs tell you about how this interface with Aerofly FS works is completely false. There is no correct training data for AI so it cannot know the correct answer and just hallucinates. There is also no online documentation for it so there is no correct answer it can give you. This will require human intelligence and creativity to try out and experiment with.

    With enough dedication you can develop a force feedback system as well. You just need to do all the high speed stuff manually but you can use slower values like airspeed to modify the responses over time of course. So basically develop your own physics model for the control forces and then use the data from the sim to tune that model over time.

    Similarly you could theoretically develop a motion platform that has its own physics simulation of the aircraft and then slowly correct your own physical model with the response of the sim, e.g. using a Kalman filter or similar. Nothing is impossible it just takes a lot of work since the DLL is not designed for this high speed response.

    But like I said, for other applications like maps and tracking it should be more than enough.

  • Just for the record, a lot of what AIs tell you about how this interface with Aerofly FS works is completely false. There is no correct training data for AI so it cannot know the correct answer and just hallucinates. There is also no online documentation for it so there is no correct answer it can give you. This will require human intelligence and creativity to try out and experiment with.

    With enough dedication you can develop a force feedback system as well. You just need to do all the high speed stuff manually but you can use slower values like airspeed to modify the responses over time of course. So basically develop your own physics model for the control forces and then use the data from the sim to tune that model over time.

    Similarly you could theoretically develop a motion platform that has its own physics simulation of the aircraft and then slowly correct your own physical model with the response of the sim, e.g. using a Kalman filter or similar. Nothing is impossible it just takes a lot of work since the DLL is not designed for this high speed response.

    But like I said, for other applications like maps and tracking it should be more than enough.

    Yeah as a data point (without using AI and trying to stay out of IP issues) - in my line of work this kind of applications are done via etherCAT as the simulation data needs to:
    - arrive at 5 to 10kHz to be usable
    - need to be run with it's own realtime node.
    You absolutely do not want the simulation starting to drop frames because windows started the antivirus.
    In addition, once you start to use FFB or anything with humans, a lot of safeties needs to be backed it, like watchdog signals and limit monitoring (also on the motors!).
    You want to be pretty sure you're not sending NaNs to the motors or a high step demand because a delayed torque packet arrives later than expected.

    From what I have seen, 20 to 50ms delays causes big escalations from our users as it shuts down the HiL / SiL / Driver in the Loop - normally this is the range for a watchdog signal to be considered "triggered" and simulation stops.

    If you're doing low-risk, low-speed applications it's all ok.

    If you need to respond in realtime, you need to start implementing Matlab models (imagine a delay in the FFB system that gets out-of-sync with the video - the user would barf after a minute)

  • Well, FFB project is discarded, thanks for your feedback.

    By the way, a simulator doesn’t interact with the AB9 directly, the Moza Cockpit software is in the middle of the communication with the sims, and I suspect it would manage all these controls.

    If this what not the case, I doubt the other sims would have implemented the integration:

    MOZA Cockpit Control Software

    Our proprietary MOZA Cockpit Control Software sets the industry standard with its intuitive UI design and superior interaction experience. It offers plug-and-play convenience along with shareable presets for tailored force feedback settings. Users can effortlessly adjust control parameters, fine-tune the intensity of force feedback, and modify response characteristics to perfectly align with their personal preferences.

    Best regards, Juan

    Edited 2 times, last by Jugac64 (June 8, 2025 at 4:37 PM).

  • Next useful idea: integration of Navigraph Charts (needs integration with Navigraph platform) with AFS4.

    A little big for my capacity, but I hope someone could work on this.

    By the way, we are just beginning with this and in a brainstorming stage. Please suggest anything you think it could be done externally to work with the sim, maybe some of your ideas could be implemented.

    Best regards, Juan

    Edited 5 times, last by Jugac64 (June 8, 2025 at 4:25 PM).

  • Well, FFB project is discarded, thanks for your feedback.

    By the way, a simulator doesn’t interact with the AB9 directly, the Moza Cockpit software is in the middle of the communication with the sims, and I suspect it would manage all these controls.

    If this what not the case, I doubt the other sims would have implemented the integration:

    MOZA Cockpit Control Software

    Our proprietary MOZA Cockpit Control Software sets the industry standard with its intuitive UI design and superior interaction experience. It offers plug-and-play convenience along with shareable presets for tailored force feedback settings. Users can effortlessly adjust control parameters, fine-tune the intensity of force feedback, and modify response characteristics to perfectly align with their personal preferences.

    To clarify - when I read about a FFB platform I imagined one of those tilting rigs used in motorsport simulation.
    I wasn’t aware you guys meant the force feedback on the stick.

    Uhm… depends a lot on what kind of inputs the MOZA system accepts.
    If you can calculate out of the sim data provided by the DLL the force on the control surfaces (so more or less a model as Jet-Pack suggested), then you would be able to tell how much force to provide.

    But still - depends how fast is the DLL, your calculations and then the response time of the ffb. You could have some delay or you could have none.

  • Last update for some time :) , I will be out for some weeks.

    Working with the SDK is not simple, but not impossible either ;)

    I learned how to compile and start doing modifications, assisted by AI of course.

    We changed from TCP sharing data approach to Shared Memory. Here it is a short explanation.

    Keep dreaming and doing things for AFS4, and thanks again to IPACS Team for trusting us and sharing this great tool.

    🛩️ Aerofly FS 4: Shared Memory Bridge - A Better Alternative to TCP

    The New Approach

    Instead of using TCP sockets and JSON parsing, this implementation uses Windows shared memory to create a direct data bridge between Aerofly FS 4 and external applications.

    The hybrid DLL maintains the original working SDK structure while adding a shared memory layer that writes flight data to a fixed binary structure accessible by any external process.

    Key Benefits

    • 10x faster than TCP - sub-millisecond latency
    • No network configuration - no ports, no firewall issues
    • Zero dependencies - no socket libraries or JSON parsing
    • Rock solid reliability - OS-native shared memory
    • Simple integration - binary struct, direct memory access
    • Maintains compatibility - original DLL functionality preserved

    Perfect For

    Real-time dashboards, flight logging, external instruments, motion platforms, and any application requiring high-frequency flight data access.

    Why It Works

    By building on the proven IPACS SDK foundation and adding shared memory as a secondary data layer, we get the best of both worlds: guaranteed compatibility with Aerofly and modern high-performance data access for external applications.

    Bottom line: Faster, simpler, more reliable than network-based solutions.


    Best regards, Juan