How do I add Switches not listed in Controls > Assignments?

Other problems or issues not covered by other troubleshooting topics.
Post Reply
richardtsllc
Posts: 19
Joined: Sat Aug 03, 2013 11:42 pm

How do I add Switches not listed in Controls > Assignments?

Post by richardtsllc »

Not sure if this is correct section, but hopefully it'll be read and responded to, moved if more appropriate elsewhere. Thanks in advance.

I'm running the Alabeo DA-42 with P3D v5.4, because it's the only add-on aircraft I can find matching my airplane IRL, a 2006 DA-42, N327TS. Hardware is a powerful Windows 11 x64 Pro PC, 3 curved FHD monitors, panel with Simionic G1000 suite, Logitek Pro Switch panel, DTA flaps, TCA dual throttle quadrant. I also have the brunner CLS-E NG joystick and pedals, connected via brunner Smart I/O interface.

Alabeo won't support, so I'm trying to learn the SDK and basic scripting enough to add and/or correct the most important additional hardware panel switches I've added. First example, the two Engine Masters. Mouse over them on screen shows "Left (or Right) Engine Master On / Off", and they function in the sim. But there's nothing properly matching in the list of Controls Assignments to bind. Further, I don't see "Engine Master" in the list of SimConnect variables. How do I create / add / bind these?

I have FSUPIC, can that show me what actual variables are addressed by the sim switches, even though the on-screen names aren't the same?

I'm a 50+ year veteran of working with electronics and tech in general, but new to modern scripting, so thank you in advance for your patience and guidance. Old dog, new tricks.
User avatar
Martyson
Posts: 15188
Joined: Sun Mar 25, 2012 11:08 am

Re: How do I add Switches not listed in Controls > Assignments?

Post by Martyson »

Hello richardtsllc ,

FSUIPC has event logging that may help with your setup / assignment problem.
Best Regards,
Vaughan Martell PP-ASEL (KDTW)
richardtsllc
Posts: 19
Joined: Sat Aug 03, 2013 11:42 pm

Re: How do I add Switches not listed in Controls > Assignments?

Post by richardtsllc »

Thank you -
I have not yet been able to figure out how to use that feature of FSUIPC -
richardtsllc
Posts: 19
Joined: Sat Aug 03, 2013 11:42 pm

Re: How do I add Switches not listed in Controls > Assignments?

Post by richardtsllc »

When I run the log feature of FSUIPC, then mouse over and click the Engine Master switches in the sim (on screen), nothing shows up in the log. Doesn't that confirm they are not assigned? But, I think they do function as expected in the sim; i.e., the engines won't start without them ON, as in my real airplane. What I can't figure out is how to create and bind, as I mentioned in my previous post. Thanks again for your help.
User avatar
Martyson
Posts: 15188
Joined: Sun Mar 25, 2012 11:08 am

Re: How do I add Switches not listed in Controls > Assignments?

Post by Martyson »

richardtsllc wrote: Fri Mar 01, 2024 7:51 pm When I run the log feature of FSUIPC, then mouse over and click the Engine Master switches in the sim (on screen), nothing shows up in the log. Doesn't that confirm they are not assigned? But, I think they do function as expected in the sim; i.e., the engines won't start without them ON, as in my real airplane. What I can't figure out is how to create and bind, as I mentioned in my previous post. Thanks again for your help.
Did you test by clicking on a known good assignment e,g,, Parking Brake and see what the log says?
Best Regards,
Vaughan Martell PP-ASEL (KDTW)
User avatar
Martyson
Posts: 15188
Joined: Sun Mar 25, 2012 11:08 am

Re: How do I add Switches not listed in Controls > Assignments?

Post by Martyson »

"I'm running the Alabeo DA-42 with P3D v5.4"

I checked and only seen the Alabeo DA-42 for P3D v4 (not P3D v5)?
Best Regards,
Vaughan Martell PP-ASEL (KDTW)
richardtsllc
Posts: 19
Joined: Sat Aug 03, 2013 11:42 pm

Re: How do I add Switches not listed in Controls > Assignments?

Post by richardtsllc »

Yes, I was concerned about that - but I installed it back then, and it works properly otherwise. The same switches - notably Engine Master) didn't have P3D bindings back then, either. I reached out to Alabeo, and they were a-holes about not supporting further. I'm stuck with it for now because it's the only DA-42 for TDI (non-NG with Austro Engines) version of the DA-42 matching mine.

Summarizing the issue: How do I create and bind functions (example, Engine Master ON/OFF) which otherwise function properly on screen in the sim software, to physical hardware switches?
User avatar
Martyson
Posts: 15188
Joined: Sun Mar 25, 2012 11:08 am

Re: How do I add Switches not listed in Controls > Assignments?

Post by Martyson »

"When I run the log feature of FSUIPC, then mouse over and click the Engine Master switches in the sim (on screen), nothing shows up in the log. Doesn't that confirm they are not assigned? But, I think they do function as expected in the sim; i.e., the engines won't start without them ON, as in my real airplane. What I can't figure out is how to create and bind, as I mentioned in my previous post. Thanks again for your help."

Did you test by clicking on a known good assignment e,g,, Parking Brake and see what the log says?
Best Regards,
Vaughan Martell PP-ASEL (KDTW)
richardtsllc
Posts: 19
Joined: Sat Aug 03, 2013 11:42 pm

Re: How do I add Switches not listed in Controls > Assignments?

Post by richardtsllc »

I think we're getting somewhere. I'm using Log feature of FSUIPC with DA-42 sim running, toggling back'n'forth between sim screen and "FSUIPC6 Console Log" window. I've set FSUPIC Logging/Log Details to both "Button and Key operations" AND "Events (non-axis controls)".

Testing as you suggested, I cursor over and move the parking brake lever on the sim display, I see this line:
*** EVENT: Cntrl= 65752 (0x000100d8), Param= 1 (0x0000001) PARKING_BRAKES

But.. I don't see that variable available to assign in the P3D Controls menu listing. Similar story with these next two:

When I cursor over and move the two Engine Master switches on the sim screen, I see these lines:
*** EVENT: Cntrl= 66400 (0x00010360), Param= 3 (0x0000003) MAGNETO1_SET
*** EVENT: Cntrl= 66401 (0x00010361), Param= 3 (0x0000003) MAGNETO2_SET

Now that we know the respective Event Control numbers, I wire to my hardware switches, then properly assign / bind those using FSUPIC's "Buttons and Switches" Options. I've done that (connecting through a brunner Smart I/O), and sure enough I can now see those two EVENT: line items appearing in the Log window (!), same as when I cursor over the controls on screen. BUT.. despite the events showing up in the Log window, the switches on screen DO NOT MOVE.. WTH??! What am I missing? Something I need to set between FSUPIC and P3D?

Regardless, it is progress, and I very much appreciate your continued attention and assistance. Perhaps others are following this exchange and will weigh in with further advice and guidance.

RBT
richardtsllc
Posts: 19
Joined: Sat Aug 03, 2013 11:42 pm

Re: How do I add Switches not listed in Controls > Assignments?

Post by richardtsllc »

I should have mentioned when I bind a switch to the Parking Brakes, it DOES move the lever in the sim onscreen display, as expected. Is something going on with Alabeo preventing proper binding of the Engine Masters switches' function into the aircraft add-on itself?

And, I did have to move the physical wiring to the upper part of the Smart I/O (digital input channels 31-50). For whatever reason(s), there must be some kind of (USB?) conflict with the lower channels. When I was testing Engine Master switches earlier, no matter which input channel I wired, it always activated "Gear Toggle" (in addition to Magneto#_Set), even though I can't find that assigned anywhere. When I moved from Smart I/O channels (1-30), it fixed that issue.
User avatar
Martyson
Posts: 15188
Joined: Sun Mar 25, 2012 11:08 am

Re: How do I add Switches not listed in Controls > Assignments?

Post by Martyson »

“I should have mentioned when I bind a switch to the Parking Brakes, it DOES move the lever in the sim onscreen display, as expected. Is something going on with Alabeo preventing proper binding of the Engine Masters switches' function into the aircraft add-on itself?”


Here is an example for PMDG737:


PMDG 737 NGX
Credit goes to PMDG for supplying the information.

FSX control/event numbers

The following is the FSX control/event numbers for the 737 NGX for use in eg. FSUIPC, LINDA, or HIDmacros [2] to control the aircraft from third-party software/hardware. They are derived from the file PMDG_NGX_SDK.h in the SDK. See this page for details.


Variable FSX Event Description
// Overhead - Electric
EVT_OH_ELEC_BATTERY_SWITCH 69633 01 - BAT Switch
EVT_OH_ELEC_BATTERY_GUARD 69634 02 - BAT Switch Guard
EVT_OH_ELEC_DC_METER 69635 03 - DC SOURCE Knob

Etc. :

https://aviation.allanville.com/misc/fsx-pmdg-737-ngx
Best Regards,
Vaughan Martell PP-ASEL (KDTW)
KevinKaessmann
Posts: 162
Joined: Sat Aug 04, 2018 10:14 am

Re: How do I add Switches not listed in Controls > Assignments?

Post by KevinKaessmann »

FSUIPC 5 but I assume this should work in newer versions
https://fsxtimes.wordpress.com/2019/12/ ... variables/
In short: assign a button to FSUIPC Control "List Local Panel Vars".
Sitting in the aircraft, press the assigned button and you get a dump of the known LVARs.

But it's a trial and error story:
  • You have to find out which LVAR has what purpose and what content leads to which action
  • You think, you've found the right LVAR but then you find out it's a dependent LVAR, set by some other action, so seeking further for the right one (just like an adventure game ;-)
  • In some cases, it's not sufficient to simply set the LVAR but needs further action (event, P3D storage location)
I've done it for the most used of my aircraft to steer them by levers, switches and buttons.
As I don't have enough switches, FSUIPC made it possible to combine functions by FSUIPC LUA scripts, e.g. one switch for both batteries and such things.
KevinKaessmann
Posts: 162
Joined: Sat Aug 04, 2018 10:14 am

Re: How do I add Switches not listed in Controls > Assignments?

Post by KevinKaessmann »

In addition:

Read the FSUIPC PDF documentation, it's in the modules folder.
As I remember, the advanced user guide contains the P3D offsets as not everything can be done by LVAR.
LVARs are mostly used by addon aircraft to implement their own functions.

Many basic functions can be controlled by "peek/poke" into P3D storage offsets - doing this in a first run (say "prototyping") by FSUIPC is easier as programming with the SDK in my opinion.

The log with the events - as Martyson wrote before - is another helpful thing in finding out how to control an aircraft (nearly) without mouse and keyboard.

Good luck ;-)
Post Reply