• 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.

How to get overhead status from simconnect

Messages
9
Country
france
Hi everybody,

I made an overhead panel to control my airbus x extended on fsx, it is a hardware averhead panel which is connected to my c++ application on a serial port with arduinos on each modules of overhead. I would know if it's possible to get from simconnect variables all overhead lights status?
When I start my c++ application, I would set my overhead to the same state it is in fsx. For exemple, how to get from simconnect the status of "fault" light or apu available or other korry button status and so on

Thanks for you help and sorry if my english is bad ...
 
You would need access to the custom variables from the developer....
 
You would need access to the custom variables from the developer....

OK that is what I would do, but how to know the IDs (or string names) of this variables (or events in some cases), I set the .ini file of simconnect to start debug console but I can't see these variable in it.
 
That's what you would have to find out from the developer.
 
OK that is what I would do, but how to know the IDs (or string names) of this variables (or events in some cases), I set the .ini file of simconnect to start debug console but I can't see these variable in it.

I guess what you want to identify are the LVars and AVars used to manage the Overhead in 3D .mdl.
If so, then you can install XMLTools then add LocalVarsLogger utility to inspect all those LVars and figure out what each one of them does. You can also add XMLEventsLogger utility to detect the events triggered by OH switches.
With this info I think you can program a .dll module to be loaded by FS through DLL.XML, with a Simconnect bridge, which should be shared with your custom app in order to manage those LVars by any of C++ Var sharing methods.

Tom
 
Ok Tom and thanks for your reply. It is exactly what I want to do. OK about .dll and dll.xml as mentioned in SDK doc (Creating a Gauge using XML and C++). Now I will try to use tools which you talk about, I didn't know these tool and it seems to be exactly what I need...

I give shortly a little feedback
 
Here is a little feedback,

I installed XMLTools addon and add LVar logger an Event logger gauge to the panel, it is just what I looked for. Now I will write dll to create a simconnect brigde and that should be all right.

Thanks so much Tom and Naruto for your help
 
Good afternoon again,

So I tried to program a dll in order to get local vars from my AXE Aircraft, which are list by XMLTools. However, the SDK doc is very bad and I can't do what I want to. Is anyone can help me about how I could start?

Actualy, I copied my dll sample in FSX main folder and then added a "launch addon" in dll.xml, I write in my sample some "DebugOututString" and open a DBGView session to abserve what happen. But I can't see anything, my dll is loading by FSX at startup but never seems to execute module_init which containe a DebugOutputString"

Thanks for your help
 
Hello Laurent,

did you managed to get your bridge running?

I would also really like to access to LVars from an external application (provided over a DLL bridge just as you planned to).

Therefore I would be very interested in your experiences if you got that to work!

Best regards and thanks in advance for any tips on that
Andreas
 
Hi Andreas, yes I succeed to make a bridge from DLL C++ to LVars of FSX addons.

So, the first thing to do is to get/install XMLTools as explained in the previous post. This will allow you to get all the LVars (and IDs number) of in the addon :
- http://www.fsdeveloper.com/forum/resources/xmltools-2-0-installer.150/
- http://www.fsdeveloper.com/forum/resources/xmltools-2-0-xml-expansion-module-for-fsx.148/
Then use LocalVarsLogger to get all LVars

You can now write your DLL project (with or without simconnect events, like simstart, simstop or other...) and add it to DLL.xml. You can create a gauge xml which use directly your DLL, this in the panel.xml
In the DLL, you have to use FSAPI functions to manage Lvars, "set_named_variable_value" and "get_named_variable_value" for example, contained in gauges.h.

You can find informations about gauges.h in C++ Gauges Reference HERE
Also you can see simconnect reference HERE

Hope I helped you
 
Hello Laurent,

first thanks a lot for your very quick and detailed reply!

Basically I don't want to access the LVars from a gauge, but from a separate process outside FSX/Prepar3d and if I understood it correctly there is currently no way to access these LVars over the "normal" SimConnect SDK or did I miss something here?

If that's the case the only way would be to write a DLL (which is loaded over "DLL.xml") which has access to the LVars and can make them available to a process outside of FSX/Prepar3d.

Or is there a simpler way of accessing LVars from outside FSX/Prepar3d if I don't want to use existent 3rd party tools like FSUIPC?

Best regards
Andreas
 
OK you are right. Simconnect allows you to get/set only AVars of FSX. All others are created (in the XML file) by the developer of the addon you want to use.

If that's the case the only way would be to write a DLL (which is loaded over "DLL.xml") which has access to the LVars and can make them available to a process outside of FSX/Prepar3d.

This is exactly what I made, a very simple DLL loaded over DLL.xml and I get LVars from this DLL on a rasberryPI over network link.
But, you are able to use all FSAPI functions (in gauges.h) when a not NULL PANEL structure pointer exists and was set in your application. Also if you succeed to get this pointer in your external process I thing it sould work but how? I don't know because I've never tried that.
 
Hello Laurent,

This is exactly what I made, a very simple DLL loaded over DLL.xml and I get LVars from this DLL on a rasberryPI over network link.

That sounds exactly what I'm searching for. ;)

If you are able to access the data over network from your DLL, then it also should be very easy to access this data from a different process (the worst case would be using "local" TCP connection or pipe).

Would you mind sharing some code of your DLL?
I'll also write you a PM with my e-mail address if you prefer that.

Best regards and thanks again for your quick replies
Andreas
 
What will you use as C++ Compiler? I suppose MSVisualStudio or Eclipse?
I ask you that because I used to write software on QT and it's a different way to understand, not typical common C++ lib but QT Lib and classes.

So, you can see this page, you will find about "WinSock2" lib which allows you to create a simple TCP Server.
HERE is the whole TCP Server code you could use

Then your external process could connect to this server as client and so on
 
Hello Laurent,

yes, I'm using Microsoft Visual Studio - everything else would make it just more complicated for me. ;-)

What about the FSX specific part?
How the DLL retrieves the LVar data from FSX?

Best regards and thanks again
Andreas
 
Dear Andreas

What about the FSX specific part?

What do you mean about "FSX specific part?

ow the DLL retrieves the LVar data from FSX?

The DLL is writen using specific "libs" (not realy library but header file) like gauges.h and simconnect.h which are provided whith FSX SDK. These libs contain all necessary function (as FSAPI) for communication between FSX and all other process you want to make. Once included, "gauges.h" provide you to use for example "set_named_variable_value" or "get_named_variable_value" to manipulate LVars. You have to read "gauges.h".

Therefore, it is an important think to know, to use FSX SDK, you must have "GOLD" or "PRO/DELUXE" edition or FSX, all others don't provide SDK.
 
Back
Top