Set the magnetos within a lua script

Post any technical issues here. This forum gets priority from our staff.
new reply
noelutter
Airman Basic
Posts: 5
Joined: 11 May 2016, 08:18

Set the magnetos within a lua script

Post by noelutter »

Hi, I'm building a hardware control panel for the Comanche. Every control is made within a lua script.
Everything works fine, except the magnetos switch.

I use the following code:

Code: Select all

ipc.writeLvar("L:Magnetos1", val)
with val = 0, 1, 2 or 3 as described in the A2A Comanche variable list.

When I call this code line, the magnetos switch moves just a bit but seems to return to its original position.

Any idea ?

Gypsy Baron
A2A Master Mechanic
Posts: 3396
Joined: 02 Aug 2008, 17:04
Location: San Francisco

Re: Set the magnetos within a lua script

Post by Gypsy Baron »

It appears that the standard FSX controls are used directly. From my
FSUIPC4.ini file:

0=PD,14,C66025,0 ;//Magneto Left
1=PD,15,C66023,0 ;//magnetos OFF
2=PD,16,C66024,0 ;//Magneto Right
3=PD,17,C66026,0 ;//Magneto BOTH

Paul

Image

User avatar
Nick - A2A
A2A Captain
Posts: 13803
Joined: 06 Jun 2014, 13:06
Location: UK

Re: Set the magnetos within a lua script

Post by Nick - A2A »

There's also another L:Var "L:Magnetos1Switch" which you could try.

Cheers,
Nick

...Edit - nope that one doesn't seem to work either. Probably best just to use the default FSX/P3D controls as Paul suggests.

noelutter
Airman Basic
Posts: 5
Joined: 11 May 2016, 08:18

Re: Set the magnetos within a lua script

Post by noelutter »

Wow, thanks a lot Paul & Nick.
It works !
Here is my new lua script:

Code: Select all

  if val == 0 then
    ipc.control(66023)
  elseif val == 1 then
    ipc.control(66024)
  elseif val == 2 then
    ipc.control(66025)
  elseif val == 3 then
    ipc.control(66026)
  end
One more question: I didn't find a list with all the FSX controls. Is it possible to find it somewhere ?

User avatar
Nick - A2A
A2A Captain
Posts: 13803
Joined: 06 Jun 2014, 13:06
Location: UK

Re: Set the magnetos within a lua script

Post by Nick - A2A »

noelutter wrote:One more question: I didn't find a list with all the FSX controls. Is it possible to find it somewhere ?
Yes - take a look in the "FSUIPC Documents" folder inside the "Modules" directory of your host sim. You should find "The 2016 List of FSX and P3D Controls.PDF".

Cheers,
Nick

new reply

Return to “Piper Comanche 250 Tech Support”

Who is online

Users browsing this forum: No registered users and 20 guests