SimConnect + WASM combined project using VS2019

Chapter 1: SimConnect and WASM - what is this?

If I want my cockpit hardware to talk to MSFS2020, I need an interface to do that. That interface is called “SimConnect”. It is definitely not a bad idea to have a look at the SimConnect SDK Documentation. SimConnect is not automatically installed, but you can easily do this with these installation instructions. There are a lot of interesting samples here, and some more explanation of how to use SimConnect with C#.

SimConnect works according the client/server concept, where MSFS is the server and your application is the client. The SimConnect client “connects” with the SimConnect server. The client can be running on the same computer where MSFS2020 is running, but it can also be running on a different computer in the network (a lot of cockpit builders are distributing the hardware between different computers). Once connected, the SimConnect client can then use all the functions that are described in the API (Application Programming Interface). With these functions you can then read and write to all kinds of variables or trigger events.

But unfortunately not all variables or events can be controlled through SimConnect only. Some special variables like LVars and HVars (don’t bother too much about the names now) need some extra piece of software. This extra piece of software is based on a WASM module (WASM stands for Web Assembly Module). Documentation about the Web Assembly can be found here.

The below is a very simple representation of how all the pieces of the puzzle fit together.

That is now why my implementation includes 2 separate projects:

  • A SimConnect Client based on a Windows Form which also acts as the GUI - this is written in C#
  • A WASM module that works together with the SimConnect Client to allow accessing LVars and HVars - this is written in C++

Off topic, but my PIC-Controlled hardware is written in C, so I am really using all the C-languages. But that should not be a surprise, because I’m Belgium that loved the sound of C back in the 80’s.

Goto Chapter 2: Setting up the environment

6 Likes