• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS SimConnect - Accessing Local Variables

Messages
11
Country
switzerland
Hi all - I was very happy to learn that MSFS2020 came with a SDK and that it supports SimConnect as well. While I've been able to convert some of my work to the new SDK, I'm struggling with accessing local variables. In FSX Lvars were only accessible via the panels system, which in turn could only be accessed via a C++ DLL. It appears, however, that this is no longer supported. Did anyone find a way to access local vars in MSFS2020 already? If so, I'd be happy to learn how.
 
Messages
2,077
Country
us-ohio
As far as I am aware, there is no method to do this. No form of custom DLL, either module or gauge are supported by MSFS2020
 
Messages
11
Country
switzerland
Thanks, I thought that was the case. I guess that'll make it difficult for anyone that wishes to connect their home built sims / setups with any of the upcoming 3rd party aircraft. As far as I can recall from my FSX days, 3rd party devs used local vars quite heavily.
 
Messages
71
Country
norway
Developers like PMDG will probably have their own airplane SDKs as they have in FSX/P3D, so that shouldn't be any problems.
 
Messages
2,077
Country
us-ohio
Unless PMDG gets ASOBO to provide an interface... even they won't be providing an SDK. All, read that again... ALL gauges in the new sim run inside a sandbox that is isolated. It has no interaction with the user's system that the sim itself does not allow.
 
Messages
240
Country
switzerland
Right now, the only way to read or write LVars is from a WASM module, because there are wrappers in WASM for all functions of the old Panels interface, which includes the ability to read/write LVars.

However, there's no easy way to export them to the outside world. for example an external Simconnect client, since WASM modules cannot call any of the WIndows API features ( Named Pipes, Socket, IPC, etc ) that are usually used to send data across processes.

It MIGHT ( although I haven't tried ) be possible to use Simconnect itself to communicate between a WASM module ( which, as of today, can only be a Gauge, since standalone modules are not supported yet ), using the SimConnect_CreateClientData, SimConnect_RequestClientData, SimConnect_SetClientData ( etc. ) functions, so the WASM gauge could communicate with an external .EXE using Simconnnect itself as a transport, and sharing data using some kind of protocol to handle LVars.

It's quite tricky, but might work, provided all the following will work:

- those Simconnect calls working as they did in FSX/P3D, both in the external .EXE and in the WASM module, which not something to take for granted, since even more basic functions are still INOP today.

- until WASM works only with Gauges, it will be fairly impractical, since you would have to add this "proxy" gauge to every airplane you have, something that wouldn't be required if the module could just start with the sim, like any other .DLL

- You'll have to create some data exchange protocol to act on LVars, design the data areas, work with strings ( LVar names ) which can be tricky

It would be way easier if Asobo just added support for LVar to Simconnect natively, so you could just use it from an external .EXE, without having to deal with any of that.
 
Messages
2
Country
spain
Right now, the only way to read or write LVars is from a WASM module, because there are wrappers in WASM for all functions of the old Panels interface, which includes the ability to read/write LVars.

However, there's no easy way to export them to the outside world. for example an external Simconnect client, since WASM modules cannot call any of the WIndows API features ( Named Pipes, Socket, IPC, etc ) that are usually used to send data across processes.

It MIGHT ( although I haven't tried ) be possible to use Simconnect itself to communicate between a WASM module ( which, as of today, can only be a Gauge, since standalone modules are not supported yet ), using the SimConnect_CreateClientData, SimConnect_RequestClientData, SimConnect_SetClientData ( etc. ) functions, so the WASM gauge could communicate with an external .EXE using Simconnnect itself as a transport, and sharing data using some kind of protocol to handle LVars.

It's quite tricky, but might work, provided all the following will work:

- those Simconnect calls working as they did in FSX/P3D, both in the external .EXE and in the WASM module, which not something to take for granted, since even more basic functions are still INOP today.

- until WASM works only with Gauges, it will be fairly impractical, since you would have to add this "proxy" gauge to every airplane you have, something that wouldn't be required if the module could just start with the sim, like any other .DLL

- You'll have to create some data exchange protocol to act on LVars, design the data areas, work with strings ( LVar names ) which can be tricky

It would be way easier if Asobo just added support for LVar to Simconnect natively, so you could just use it from an external .EXE, without having to deal with any of that.

Hi Umberto .... your post from past 9 Sep 2020 (more than a year ago) is very very interesting.

Do you know of any project that havs worked and developed such a gauge to be able to interface panel local variables to an external .exe program by means of the MSFS simconnect server and simconnect client connections from gauge and .exe ??

I think in FSX it already existed such an issue with local variables data to be passed into an external simconnect .exe program ... am i right?? do you know of any solution already developed for FSX ??

Thank you and Kind regards
Herminio Herrera -- Jaguair from Spain.
 
Top