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.

Using GIT and T8 switch to connect GRD PWR via CDU

Hi Steve,

Given the problem there is with the GRD PWR LED not functioning correctly on the 737 I've decided to adopt a different approach.

The SDK includes the relevant commands for each section of the CDU and via GIT and FSUIPC.INI I've successfully programmed the CDU button presses to enable GRD PWR instead of having to navigate via the mouse. Those commands are via a T8 switch.

What I can't work out is whether I can assign a command to the Light command so it's either on or off according to whether that option is selected in the CDU. This is what I have but the LED is always on. Can you help please?

image
Cheers,
Ray (Cheshire, England)

Comments

  • Hi Ray,

    I have just had a look in the SDK and nothing is available.

    You could fake it, by creating a bespoke event for turning it on and another for turning it off and in there set a Bespoke Variable to either 0 or 1 and then assign that Bespoke Variable to the LED.

    E.g. Using "Bespoke Var 0", On would be:

    Send EVT_CDU_L_MENU
    Set Bespoke Var 0 1

    and Off would be

    Send EVT_CDU_L_MENU
    Set Bespoke Var 0 0


    Best wishes

    Steve
  • Hi Steve,

    I shall try that tomorrow. Thanks very much.
    Cheers,
    Ray (Cheshire, England)
  • edited April 2019
    Morning Steve. I've done as you suggested but the LED always remains on. Here is the entry in PMDG.xml...

    Control ID="1" EVENTType="NGXEvent" EVENT="EVT_CDU_L_MENU" ACTIONType="EventCmd" ACTION="CUSTOM" LIGHTType="Var" LIGHT="Bespoke Var 0" LIGHTACTIONType="LightCmd" LIGHTACTION="ON" LIGHTVALUEType="Float" LIGHTVALUE="1" ACTION_OFFType="EventCmd" ACTION_OFF="CUSTOM" /

    I've removed the leading and trailing < > as the code wasn't showing in my post.
    Cheers,
    Ray (Cheshire, England)
  • There are no Bespoke Events assigned. You need to go into Detective to build those. Create one with these Tasks:

    Send EVT_CDU_L_MENU
    Switch Bespoke Var 0
    Case 0:
    Set Bespoke Var 0 1
    Case 1:
    Set Bespoke Var 0 0
    EndSwitch

    Then assign this bespoke event to your ON event on the switch.
  • Steve,

    Detective is disabled with the PMDG737 loaded.
    Cheers,
    Ray (Cheshire, England)
  • Of course it is :D I can write you some Lua to do the same if you want?
  • Thanks Steve, that's nice of you. Do you need anything from me?
    Cheers,
    Ray (Cheshire, England)
  • edited April 2019
    Open the Lua Console. Create a new Lua script and call it what you want. A text editor should then open with a blank Lua script file. Copy and paste the following into the text editor and then save the file:
    sendevt("EVT_CDU_L_MENU", MOUSE_LEFTSINGLE)
    
    if (getbvar("Bespoke Var 0") == 0) then
        setbvar("Bespoke Var 0", 1)
    else
        setbvar("Bespoke Var 0", 0)
    end

    Assign the Lua code as you would a normal event, Look for LUA_ followed by the script name you entered.

    Best wishes
    Steve
  • Steve,

    Having done all that I've hit a problem. The switch I want to assign to that LUA script currently holds all the commands used by FSUIPC to navigate to the CDU and select keys to turn GRD PWR on and off. If I replace those with the call to the LUA program then GRD PWR won't work.

    I suppose the solution is to embed those commands into the LUA program. I'm pasting them (bit cheeky!) in case you can embed them.

    70=P109,1,C70183,536870912 -{Custom control: <70183>}-
    71=P109,1,C70176,536870912 -{Custom control: <70176>}-
    72=P109,1,C70168,536870912 -{Custom control: <70168>}-
    74=P109,1,C70167,536870912 -{Custom control: <70167>}-
    75=P109,1,C70168,536870912 -{Custom control: <70168>}-
    76=P109,1,C70169,536870912 -{Custom control: <70169>}-
    77=P109,1,C70171,536870912 -{Custom control: <70171>}-
    78=P109,1,C70171,536870912 -{Custom control: <70171>}-
    79=U109,1,C70183,536870912 -{Custom control: <70183>}-
    80=U109,1,C70176,536870912 -{Custom control: <70176>}-
    81=U109,1,C70168,536870912 -{Custom control: <70168>}-
    82=U109,1,C70167,536870912 -{Custom control: <70167>}-
    83=U109,1,C70168,536870912 -{Custom control: <70168>}-
    84=U109,1,C70169,536870912 -{Custom control: <70169>}-
    85=U109,1,C70166,536870912 -{Custom control: <70166>}-
    86=U109,1,C70171,536870912 -{Custom control: <70171>}-
    87=U109,1,C70171,536870912 -{Custom control: <70171>}-

    P represents a switch on; U represents a switch off. 109 is the button ID as shown in FSUIPC. You will know the rest probably.
    Cheers,
    Ray (Cheshire, England)
  • You could just use FSUIPC to do all the key presses and remove the sendevt from the lua script so all it does is flick the variable between 0 and 1.
  • I've never used LUA before so need my hand holding. I have all the key presses plus the GRD PWR switch working on a T8 switch. How can I send the value of that variable via a FSUIPC command? I know any LUA file in the Modules folder is automatically executed.

    Sorry to ask basic questions.
    Cheers,
    Ray (Cheshire, England)
  • if you use Lua in the GIT Lua console and modify the script you did so its just:
    if (getbvar("Bespoke Var 0") == 0) then
        setbvar("Bespoke Var 0", 1)
    else
        setbvar("Bespoke Var 0", 0)
    end
    You can assign this to the switch and assign you key commands in FSUIPC to the same switch.

    Best wishes
    Steve
  • Steve, really sorry but where is the GIT Lua console? Separate executable or within GIT? I can't see any reference to LUA.
    Cheers,
    Ray (Cheshire, England)
  • On the Status Tab.
  • Thanks Steve. I've assigned the lua script but the light doesn't go on or off.

    image
    Cheers,
    Ray (Cheshire, England)
  • Sorry Ray I'm talking out of my backside, its the NGX so its doesn't support Bespoke Events or Bespoke Variables.

    Its not going to be possible in GIT until the completely rewritten version is released at the end of the year'ish

    You might be able to do it in FSUIPC using Lua and Pete's GoFlight Lua commands.
  • Thanks Steve. I’ll have a word with Pete but it’s not a big issue with the LED. I can now turn on GRD PWR with a single switch which is the main thing. The LED is just the icing on the cake.
    Cheers,
    Ray (Cheshire, England)
  • Hello, is it possible to use an AC AMPS Value for GRD PWR Selector as trigger to switch a GND PWR IN USE Light on/off?
  • That's an interesting take on things. Would that be possible Steve?
    Cheers,
    Ray (Cheshire, England)
  • I can't see a numeric value for AC Amps in the NGX SDK.

    Best wishes
    Steve
  • Okay, thanks.
    Cheers,
    Ray (Cheshire, England)
  • Hello Ray, too bad - the idea behind was that only if a current flows, the EP can be in use...

    The problem seems to be that you need a light which does not exist in cockpit - the EP IN USE LT, which is located at EP Connection panel. In my understanding the logic behind this LT is as follows:

    EP LT ON CASE: if ON GND and EXT PWR LT ON and EXT PWR SW ON
    EP LT OFF CASE: ifnot EP LT ON CASE or EP LT ON CASE and then AT LEAST ONE APU GEN SW ON or EP LT ON CASE and then BOTH ENG RUN WITH GCB ON

    EP and APU providing elec power whichever was switched at last but not in parallel, ENG overrides EP (if in use)
    Maybe you can program a logic depending upon switch settings and light ON/OFF variables.

    Best regards
  • fsam, you're describing things that mean little to me I'm afraid. I haven't a clue what EP is or does. The GRD PWR light staying on or off throughout the various phases of the flight is not a major issue for me. GSX prevents me pushing back with GRD PWR connected and I also have a checklist to make sure I do the right things in the right order before I start to taxi.

    But thanks for your interest.
    Cheers,
    Ray (Cheshire, England)
  • sorry, EP means external power.
    Best regards
  • Thanks fsam. :)
    Cheers,
    Ray (Cheshire, England)
Sign In or Register to comment.