Python - Get LVARS

Hi folks,

This topic is targeted mostly to MSFS Developers - maybe someone will be able to help me. Im advanced programmer in web languages like PHP, CSS, Html and JavaScript and flightsimmer since 13 years. Some time ago i just get an idea for creating app for msfs - reading simconnect events and data and playing sounds when something happens. App will be total freeware for everyone, so any help is any help is greatly appreciated because maybe I will create some new tools for sim.

Anyway - I’m now learning Python (step by step), like other languages it looks simple and i really joy to write code there but I dont have any knowledge about how to use SimConnect to read L Vars and K Vars from aircraft like PMDG 737 or A320 by FlyByWare.

I have created with success code to listen simconnect every 250ms and then playing sounds when for example airplane is on ground, or in air - passing some altitude, speed etc. Im using pythin library from here:

GitHub - odwdinc/Python-SimConnect: Python interface for MSFS2020 SimConnect.dll

And since SimUpdate12 SimConnect have build-in ability to read those L Vars and K Vars. Anyone knows how to read for example switch state from PMDG 737 using it?

Info about L Vars in simconnect:
Release Notes for Sim Update 12 [1.31.22.0] - Microsoft Flight Simulator

Any help appriciated, mostly just a few lines of code to show me the way how I can read them from Sim.
Happy New Year everyone reading this post :slight_smile:

EDIT: This is official site with using LVars in simconnect but i dont know how to use it in code:
SimConnect_AddToDataDefinition (flightsimulator.com)

1 Like