MFS2020 + PMDG SDK coding

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
koyot
Posts: 11
Joined: Wed Jan 05, 2022 6:00 pm

MFS2020 + PMDG SDK coding

#1 Post by koyot »

Hey guys,

So i have been trying to get single button working. I have tested this with default MFS event on Airbus and connection/code seems to work. However when I try to use B738 PMDG events its not doing anything?
Does Air Manager needs to work with PMDG events first or am I missing something? its like its not seeing them and as they are 3rd party and not built into MFS I assume it's not seeing those events.
Whats my best way here? Wait for AM to add PMDG support or use different code? I have seen here on forum that someone managed to make panels for PMDG but he used something different in place of events and I am not sure what it is.
Code below seems to work with PMDG but that's when using ROTOR_BRAKE which I have no idea what it is, it's code of the person from this forum.
-- Callback function which is called when the button is pressed
function button_pressed() fs2020_event("ROTOR_BRAKE", 50001) end
-- The following print function is not necessary but can help you to verify that the button has been pressed
print("GPWS TEST")

-- TEST GPWS

-- function() fs2020_event("ROTOR_BRAKE", 50004) end)

-- Create a button with the name 'Com swap'
hw_button_add("GPWS TEST", button_pressed)
Now when I use my code below, it does not work.
-- Callback function which is called when the button is pressed
function button_pressed() fs2020_event("EVT_GPWS_SYS_TEST_BTN") end
-- The following print function is not necessary but can help you to verify that the button has been pressed
print("GPWS TEST")

-- Create a button with the name 'Com swap'
hw_button_add("GPWS BUTTON", button_pressed)
Open to nay ideas and suggestions.
Thanks
Krys

User avatar
samburner3
Posts: 16
Joined: Thu Apr 16, 2020 9:29 am
Location: Australia

Re: MFS2020 + PMDG SDK coding

#2 Post by samburner3 »

I think you are trying to write lvar (or local variables that are defined on a per aircraft basis) that AM does not support (yet) 😭 see my question https://siminnovations.com/forums/viewtopic.php?t=7828

User avatar
Ralph
Posts: 7867
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: MFS2020 + PMDG SDK coding

#3 Post by Ralph »

Next year there's the 2024 version. I don't think there's any point in supporting the current version anymore.

User avatar
Crunchmeister
Posts: 222
Joined: Tue Aug 10, 2021 2:06 pm

Re: MFS2020 + PMDG SDK coding

#4 Post by Crunchmeister »

The Airbus (particularly the default one) and the PMDG 737 are totally different animals. Most 3rd party plane devs use as many of the standard SimConnect and SDK events and variables as possible in their aircraft. Not PMDG. From what I've seen, most of the PMDG 737 runs off of custom lvars, not events. So most of the fs2020_event() call will do nothing.

You need to find what the lvar is that you need to access. You can likely find it on hubhop. You'll need to subscribe to said variable using the fs2020_variable_subscribe(), then add some handling logic based on that value, and then write using fs2020_variable_write().
- Ryzen 5950x, 64GB 3600MHz RAM, RTX3070Ti

Simstrumentation Instrument dev
Free Air Manager instruments for MSFS available at http://www.simstrumentation.com

Post Reply