Most of the commonly reported issues and questions are answered in the Frequently Asked Questions (FAQ) option under the Support menu of this website.
*** PLEASE NOTE ***
Your forum account is not the same as the account used in the shop. They are completely separate accounts.
1st December: A new version of the GoFlight Interface Tool for MSFS is now available.
12th November: A new version of the GoFlight Interface Tool for X-Plane is now available.
6th June: A new version of Virtual Flight Sim Hardware is now available (huge update)
21st November: A new version of the GoFlight Interface Tool for FSX/FSXSE/P3D is now available.

Is a PMDG Bespoke Event possible

Hello, since for MSFS PMDG B737 no Detective is available how can I issue a bespoke event with known variables, eg. 7X7X_Ground_Power_Light_Connected & 7X7X_Ground_Power_Light_NotInUse. Have seen the values 0 and 1 vs. 1 and 0 in Developer Mode under Local Variables and like to set them onto two P8 Module Lights. 7X7X_Ground_Power_Light_Connected & 7X7X_Ground_Power_Light_NotInUse did not appearing under LightData although there are in use. Or can I set them manually into the PMDG SDK list (and how)? Best regards Ralf

Answers

  • Detective has never been enabled for PMDG aircraft because the SDK provides everything. The two lvars you mention are available in the SDK but named differently. In light data, Search for Ground_Power and they will show up.

    Best wishes
    Steve
  • Hi Steve, thank your for your fast respond, unfortunately the DATA_FWDOH_ELEC_LIGHT_GROUND_POWER is only the equivalent to 7X7X_Ground_Power_Light_Connected, the other 7X7X_Ground_Power_Light_NotInUse has no Lvar in PMDG SDK. It's technically the information for the ground crew to not disconnect External Power Connector when in use (or disconnect when not in use) and as far as I can see the only possibility to make a Status Statement "External Power In Use". Or with the help of various variables and functions (if, then, else...) but then I need the help of the detective. See attached files of external connector and the overlay for my intentions, maybe you have an idea, how to proceed in this case... Best regards Ralf



  • Lua can access the PMDG Lvars. An example that will give you an idea on how to use is here: https://www.pollypotsoftware.org.uk/support/user-guide/user-guide-git/43-lua/130-lua-pmdg-ngx-example.html

    Replace getkvar with getlvar.

    Best wishes
    Steve
  • Ok, have checked LUA example, but at the moment the syntax is out of my capability, what I have found out in developer mode is the logic behind used in PMDG B737:

    if "7X7X_Ground_Power_Light_Connected" is = 0 and "7X7X_Power_Door is = 1" then "7X7X_Ground_Power_Light_NotInUse" is = 1 //External Power Off but Connected
    else = "7X7X_Ground_Power_Light_NotInUse" = 0 //External Power On or External Power Disconnected

    How can I translate this into LUA in order to get a bespoke Lvar for "7X7X_Ground_Power_Light_NotInUse" with values 1 or 0 for a light indication only (no switching function required)? Best regards Ralf
  • edited August 2023
    Add this to global_aircraft.lua so it runs continuously (you may need to restart GIT after doing so):
    while (true)
    do
       if (getlvar("7X7X_Ground_Power_Light_Connected") == 0 and getlvar("7X7X_Power_Door") == 1) then
           setbvar("Bespoke Var 99", 1)
       else
           setbvar("Bespoke Var 99", 0)
       end
       sleep(1000)
    end
    This will ensure Bespoke Var 99 is the equivalent value of 7X7X_Ground_Power_Light_NotInUse.

    The "while do end" loop ensures the statements run continuously after a 1 second pause (sleep).

    Best wishes
    Steve
  • Hi Steve, thank you for your help, unfortunately it doesn't work. I've copied the code into the PMDG global_aircraft.lua and checked the content with notepad. Then I've set the light with ON/1 to Bespoke Var 99 and restarted all include PC. The light is always illuminated independent upon switching or releasing external power connector. There must be data for it - seen on FMC CDU page Airplane Service 1/4 LSK 2L Ground Power: the NotInUse Light correspond to "Release" (amber) and not "Active" (green) Wording. Best regards Ralf
  • Create a new lua script so that you can query what the lvars are. E.g.

    print(getlvar("7X7X_Ground_Power_Light_Connected"))

    Remember to save the script and then you can run it in the Lua console and its current value will be show in the output area of the lua console.

    Best wishes
    Steve
  • Hi Steve, something I'm doing wrong it seems - got lua error unknown lvar name all the time, also for known lvars:

    Lua Connected!
    Lua Error Code 1: Running File C:\USERS\xyz\DOCUMENTS\GOFLIGHT INTERFACE TOOL\LUA\PMDG 737\CHECK_OUTPUT.LUA
    Error: ...TS\GOFLIGHT INTERFACE TOOL\LUA\PMDG 737\CHECK_OUTPUT.LUA:1: getlvar: C++ Exception Thrown - Unknown Local Variable Name, 7X7X_Ground_Power_Light_NotInUse
    Lua Error Code 1: Running File C:\USERS\xyz\DOCUMENTS\GOFLIGHT INTERFACE TOOL\LUA\PMDG 737\CHECK_OUTPUT.LUA
    Error: ...TS\GOFLIGHT INTERFACE TOOL\LUA\PMDG 737\CHECK_OUTPUT.LUA:1: getlvar: C++ Exception Thrown - Unknown Local Variable Name, 7X7X_Ground_Power_Light_Connected
    Lua Error Code 1: Running File C:\USERS\xyz\DOCUMENTS\GOFLIGHT INTERFACE TOOL\LUA\PMDG 737\CHECK_OUTPUT.LUA
    Error: ...TS\GOFLIGHT INTERFACE TOOL\LUA\PMDG 737\CHECK_OUTPUT.LUA:1: getlvar: C++ Exception Thrown - Unknown Local Variable Name, 7X7X_Power_Door
    Lua Error Code 1: Running File C:\USERS\xyz\DOCUMENTS\GOFLIGHT INTERFACE TOOL\LUA\PMDG 737\CHECK_OUTPUT.LUA
    Error: ...TS\GOFLIGHT INTERFACE TOOL\LUA\PMDG 737\CHECK_OUTPUT.LUA:1: getlvar: C++ Exception Thrown - Unknown Local Variable Name, DATA_FWDOH_AIR_SWITCH_L_PACK

    The first scriptexample is working, also notepad is used for editing. checked LUA Manual for Lua Error Code 1 but no luck. Is there something I can do further?
  • If the 7X7X.... variables are genuine lvars then it could be they have just not been created by the aircraft at the point of testing. You can manually add them to the PMDG 737 aircraft section of the KnownLvars.xml file in Documents\GoFlight Interface Tool and see if they work correctly after restarting GIT.

    Any variables beginning with DATA are SDK variables so use getkvar instead of getlvar.

    Best wishes
    Steve
  • Hi Steve, i will do this and comming back and will read a little in the lua-help description of course. Best regards Ralf
  • Hi Steve, set the related Lvars (7X7X...) manually to KnownLvars.xml and checked with XML Notepad, no errors.
    After Starting MSFS and GIT and LUA code assignement, the Lvars were wiped out of the KnownLvars.xml file. The Lvars are not visible in LUA console and the error message is the same as above, it is not working. For the getkvar function I found in the Online LUA description that it is not available in GIT FS2020. So it seems that PMDG B737 in FS2020 did not accept any additional entry, at least for me... (tried with knownlavars.xml writing protection too, but the error message is the same) Best regards Ralf
  • The documentation is out of date for getkvar as I have just checked the code and support is there for it.

    I suspect support for the PMDG is limited in both Lua and Detective because the SDK was doing all the work. I'll need to go over all the code to see what is happening.

    Best wishes
    Steve
Sign In or Register to comment.