Jump to content
Sign in to follow this  
kj_2002

DA PA31 Cheyenne / Assigning Buttons via Linda

Recommended Posts

Good afternoon,

 

I am currently  trying to assign certain buttons of the DA Piper Cheyenne either to a joystick/pad (regular and/or Hotas Warthog) or to my Saitek Switch Panel. What works well for most other FSX planes seems to be a problem with my favorite one.

 

At least partly:

 

For example:

Battery Master Switch: No problems

Avionics Master Switch: No Chance

 

I have used Linda and FSUIPC logs to find out what is happening:  "Toggle_Avionics_Master"  is the syntax which seems to be a standard FSX control jus as

 

- Toggle_Alternator1 resp. 2

- Toggle_elect_fuel_pump1 resp. 2

 

which I would like to assign to start the engines without using the mouse and the Head panel.

 

Unfortunately when I use Linda (which seems to be a great product) and assign "Avionics Master toggle"  from the default FSX Systems Lib I get the same logs but nothing happens with the switch in the panel. Avionics just stays dark.

 

 I have noticed that while using the Linda Tracer I can find various PA31 Lua variables, including

 

- PA31MasterAvionics

- PA31FuelPumpL

 

I have isolated the first one in the logs and could see that the status changed from 0 to 1 when I used the switch. This means that there has to be some link between "Toggle_Avionics_Master" and "PA31MasterAvionics". Therefore I have tried for hours and hours to define a function via the Linda Editor - and failed. I have done some programming before in my life and know how to use "IFs", "else" and "end" but I cannot find the correct syntax to achieve my goal.

 

Is there anybody out there who can please help me.

 

Thank you!

 

Karsten

Share this post


Link to post
Share on other sites

Hello Karsten,

 

it sounds a bit difficult to learn you the LUA programming language from ground up.

Yes, there are some IFs and THENs, but each language has it's own syntax.

 

It is way over my possibilities to learn you using LUA.

 

 

I can give you some hints how to start a module, but you have also to learn and search via google etc.

Here is a thread how to start gathering LUA variables with LINDA:

 

 

 

in short words:

- open LINDA GUI, press shift+F1, the "LINDA goes huntig" page opens (and the LINDA console)

on the left side you see all LUA variables listed, which are valid for your addon

there you can click on a variable and highlight it.

Below you can "set values" (pre-filled with 0 and 1).Click at "toggle" and see what happens.

 

Similar in the middle with offsets and on the right hand with controls (there you will also find your standard FSX controls "Battery Master Switch" etc

 

- once you've found a valid LUA variable, then create a new module and have a look into existing modules.

the code for a function is then:

function P40_Battery_on ()

      ipc.writeLvar("L:Battery1Switch", 1)
      DspShow("Batt", " on ")
end

the example is the A2A P40.

"L:Battery1Switch" is the LUA variable, your's would be probably "PA31MasterAvionics" as example ("L:" is not needed)

"1" says ON, and "0" says OFF

 

"DspShow" is for the MCP Combos Display, you could delete that line also.

 

 

These are the first steps, but again, it took me years to learn about FSUIP, controls, offsets, LUA variables, LUA programming etc.

It's nothing that could be learned in a few hours.

 

And, to make things more complicated, no addon acts like an other.

It isn't sure, that "PA31MasterAvionics" does really do what it promises ... it's all about try and error!!!


Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Hi Karsten, any succsess? Is your project still alive?

I just figured out wich variables are needed to start the engines and switch generator on. The avionics also. (in Linda GUI tool)

 

I want to build the overhead with hardware switches.

 

Now I have to find out how to assign a keypress to the lua variable.

 

/Hendrik/

 

ps thanks Guenseli for your short discription...

 

Share this post


Link to post
Share on other sites

Hi there,

I just found a problem in the Linda GUI. The Cheyenne funktions are not listed in the joystick-assignment page. In the Trace-page I was able to test the functions.

Do I have to type in the functions manualy in the editor?

 

The manual does not help in this case.

 

Any idea?

Share this post


Link to post
Share on other sites

Hi Eisenapferd

 

Do you have the function file for Cheyenne loaded on you system?  If this is present you will need to select it it the aircraft drop down at the top of the LINDA window.  The Trace page only shows you the variables and lets you set/reset and trace these values.  It does not access any functions that would be contained in your aircraft function file.


Andrew Gransden

Scotland, UK

LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer

i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew

Share this post


Link to post
Share on other sites

No, I had to make a new entry and so the cheyenne has no function entrys. I just made a module file (without any docs) and it seems to work.

 

see other thread in dev.-forum.

 

/Hendrik/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...