Jump to content
Sign in to follow this  
KPBG

One Button for LVAR and FSX Control

Recommended Posts

Hi, folks. I just got the hang of writing basic (very basic : ) Lua scripts for my Carenado Baron panel (homebuilt). I've got every switch of mine working the corresponding button in the sim except for one instrument. The DME Position indicator (below the HSI) sends an FSX Control (Dme_select and parameter or 1 or 2) and an LVar command (DMEPOS 1 or 2). Is it possible to write an Lua command that will do the FSX command and the LVar?  Here's what I have for this section, just need to add the FSX command and not sure how. Thanks for any and all help! -- Dana

 

-- ## DME Position ##
 
function DME_1_Position ()
    ipc.writeLvar("DMEPOS",1)
end
 
function DME_2_Position ()
    ipc.writeLvar("DMEPOS",2)
end
 

Share this post


Link to post
Share on other sites

Hi KPBG

 

There are 2 means to communicate with an aircraft. Using LVars or, for more basic aircraft, using FSX Controls. The LVar is something set up by the aircraft designer while the FSX Control is defined by Microsoft in the core simulator.

 

If you want to use both calls in your functions then you can. In addition to the ipc.writeLvar use the functions FSXcontrol and FSXcontrolname. FSXcontrol uses the number reference e.g. 66650 and FSXcontrolname uses DME_SELECT. The parameter is added by using a colon e.g. DME_SELECT:1.

 

However, I would caution against using what is the same function using both LVars and FSX Controls. This can lead to conflict. That said, some more sophisticated aircraft add ons do not use the FSX interface fully and it can be necessary to write to both.


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

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...