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

Can you read/write aircraft specific variables (LVARs and HVARS) through simconnect?

Messages
238
Country
unitedstates
What the title says. I've been reading other threads and have seen folks told to use FUIPC but I'd rather do it without that.

Thanks
 
Nope, no way, no how. :confused:

You may have seen it, sorry to repeat if so, but if you'd like an open-source alternative for full access to the MSFS Guage API then you may like to check out my WASimCommander project. L vars can be read/set via dedicated methods in the Client component/library, and H events triggered via calculator code. There's a basic demo in C# included.

Cheers,
-Max
 
Nope, no way, no how. :confused:

You may have seen it, sorry to repeat if so, but if you'd like an open-source alternative for full access to the MSFS Guage API then you may like to check out my WASimCommander project. L vars can be read/set via dedicated methods in the Client component/library, and H events triggered via calculator code. There's a basic demo in C# included.

Cheers,
-Max
Thanks. That looks like a better way to go for me.
 
One point of caution/heads-up on how SimConnect handles L vars:

SimConnect seems to respect/use the Unit type specifier for L vars. However as far as I've been able to tell, and I've researched this a bit, in MSFS there's no other way to specify Unit types for L vars (not in the model config files, nor via Gauge API nor calculator code). This means that up to now, one always got the same value out of the L var as it was set with -- which is what shows up in things like the Dev Mode inspector view or reading the values via C function calls or calculator code (in XML or via C API).

I've now heard of two instances where SimConnect will convert an L var to a different Unit type than is expected. Both were found (by a user of my MSFS Touch Portal plugin) on the dev version of the FBW A320 model. One is "A32NX_AUTOPILOT_HEADING_SELECTED" which is always in whole degrees (it's just for a display). However when requested via SimConnect, using the default Unit type of "number", the return value is in radians. Why? I have no idea. Specifying the Unit type as "degrees" returns the expected value as whole degrees. How does SimConnect even know that the value can be converted to another angle type? No idea. Even using calculator code like
(L:A32NX_AUTOPILOT_HEADING_SELECTED, "radians") doesn't convert the value (it just returns the whole degrees). 🤷‍♂️

I haven't heard what the other affected variable is named, but it was a similar confusion with an unexpected conversion from ft/min to m/sec or something like that. I haven't looked into how FBW is creating these two vars in the first place. Only thing I can think of is that they're creating them via SimConnect in the first place (eg. from a WASM). But that's pure speculation at this point.

Cheers,
-Max
 
c++:
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_CUSTOM, "L:VARIABLE_NAME", "Bool", SIMCONNECT_DATATYPE_FLOAT64, 0, DATA_Custom);

how to see the value in XML? This doesn't work:
<TOOLTIPID>Altitude: %((A:pLANE ALTITUDE, number))%!f!% feet - Custom Value: %((L:VARIABLE_NAME, bool))%!s!% - VS: %((L:DEFINITION_CUSTOM.VARIABLE_NAME, bool))%!s!% - Value: %((A:VARIABLE_NAME, number))%</TOOLTIPID>

Thanks
 
Back
Top