joepoway

Aerosoft A320 lua Command Question

Recommended Posts

I'm trying to write a lua function to set the brightness of the 4 main display panels  PFD, ND, ECAMU (ECAM Upper) and ECAML (ECAM Lower) all to 50% but I cannot find what the appropriate LUA script is to do each of these.

I actually don't want to assign an increment and decrement function but rather set all 4 displays to 50% with one assignment.

Can someone help me with what the scripts are need to do this in a function I want to write?

When I run the tracer I see AB_MPL_PFD_Power=12 and so on as I move the dial but am not sure of the format to issue a settings command I tried what I stated with a 50 value but it didn't work.

Thanks in advance

Joe

Edited by joepoway

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Joe

The cockpit display settings use the Lvar you identified and there are functions provided (eg. AB_MPL_PFD_Power_) that control these values - search the Airbus actions.lua file in Editor to find them. The Lvars vary from 0 to 20. It the InitVars() function you will find that the default OnVar is set at 16. You can change this to 12 and call AB_MPL_PFD_Power_on() to set it. Similar functions are provided for ND, ND Radar, ECAMU and ECAML.

To read the LVar you use:
    val = ipc.readLvar("AB_MPL_PFD_Power")
 

and write values (0 to 20) to it using:
        ipc.writeLvar("AB_MPL_PFD_Power", val)

Tip: Place new and modified functions in user.lua file. These are loaded after actions.lua and override existing functions of the same name. 

Edited by ScotFlieger
Tip added.

Share this post


Link to post
Share on other sites

Thanks again for your help!

I found the correct functions and now see the range is 0 to 20 I was unaware of the range. I was able to create the additional custom functions to my user.lua file that I had already made some entries and they work beautifully.

One thing that I haven't figured out how to use repeatedly is the Trace function. When I initiate it with my Aerosoft A320 it displays a quick long list and then nothing else. I'll have to read up on the Trace capabilities a bit so I can use this feature to help me find function names and values more effectively.

Thanks again

Joe 

Share this post


Link to post
Share on other sites

Glad you are getting things to work. When using the Tracer it is best to select just one or two variables to follow. Otherwise you will, as your experienced, get a very, very long list. Use pause and resume to provide some control and enable you to see what is happening. Avoid model data that is changing constantly.

When dealing with a Flt Sim (or even a real aircraft) concentrate on outputs you need (normally that displayed) and on inputs (button/knob operations) - the pilot interface. This is the way to control what we need to fly aircraft better. Avoid injecting values deep in the model.

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