Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Unsuccessfully trying to disconnect the autopilot on PMDG 747-400X

Featured Replies

As a newbie in LUA, I am trying to understand the variables and code in the Linda PMDG 747-400X module here:

 

http://forum.avsim.n...ule-version-12/

 

What I want to do, it to write a LUA script that when executed it will disconnect any/more/all of the 3 autopilots (I believe there is such a button on the real 747-400 yoke).

 

So far I've tried this:

 

 

if (ipc.readLvar("L:MCP_CMD_L_Switch_var") == 1) or (ipc.readLvar("L:MCP_CMD_C_Switch_var") == 1) or (ipc.readLvar("L:MCP_CMD_R_Switch_var") == 1) then
ipc.keypress(65, 10)
else
ipc.control(72210, 0)
end

 

 

But it does not work.

 

Clearly, I have not understood which variables (and what values/actions they permit on themselves), control the autopilots.

 

Any help would be greatly appreciated.

 

 

 

PS: The extra portion of the same script that I want to make, that disengages the autothrottle, works fine, by the way:

 

 

if ipc.readLvar("MCP_AT_ARM_Switch_var") == 10 then
ipc.control(72101, 0)
else
ipc.control(72210, 0)
end

 

 

PS2: Next step for this same script would be, if the user presses the same button for a second time (the above was for the first time, that is why I want to check if any of the autopilots are active), to silence all warnings (as a result of the first/previous action) eg a master caution or master warning.

I don't have the 747 installed anymore, because the V2 is coming, but if I'm not mistaken, isn't there a keyboard command you can assign to the Yoke disconnect button in the PMDG key command pulldown? Then you just map that straight through FSUIPC to a button on your physical yoke. I know this keyboard command slot exists on the NGX, and that is how I'm doing it with that one. In other words, I'm saying you can probably go the easy route and just skip the lua code altogether--probably worth your time just to double check the Key command pulldown, just to verify.

  • Author

I don't have the 747 installed anymore, because the V2 is coming, but if I'm not mistaken, isn't there a keyboard command you can assign to the Yoke disconnect button in the PMDG key command pulldown? Then you just map that straight through FSUIPC to a button on your physical yoke. I know this keyboard command slot exists on the NGX, and that is how I'm doing it with that one. In other words, I'm saying you can probably go the easy route and just skip the lua code altogether--probably worth your time just to double check the Key command pulldown, just to verify.

 

There is such keyboard command, and that was the way I have it now.

 

The problem is, that with the same joystick button, here is what I want to do:

 

With a joystick button:

 

- pressed once -> all autopilots and autothrottle disconnect

- pressed for a second time -> all warnings and cautions (due to the above) are silenced

 

Now as I said (and you), the autopilot part works very well, with the keystroke.

 

However, the autothrottle does not.

 

Why?

 

Because there is a keystroke available to define, for autothrottle TOGGLE, and NOT for DISCONNECT.

 

So the second time I push the button to silence the warnings, the autothrottle gets engaged again.

 

This is why I need a portion of the script to be the one I describe in my previous post:

 

 

if ipc.readLvar("MCP_AT_ARM_Switch_var") == 10 then ipc.control(72101, 0) else ipc.control(72210, 0) end

 

 

 

 

(I've tested this, and it works fine, by the way)

 

Now, if you observe the my first script (in the post above) carefully:

 

 



if (ipc.readLvar("L:MCP_CMD_L_Switch_var") == 1) or (ipc.readLvar("L:MCP_CMD_C_Switch_var") == 1) or (ipc.readLvar("L:MCP_CMD_R_Switch_var") == 1) then
ipc.keypress(65, 10)
else
ipc.control(72210, 0)
end

 

 

I am trying to achieve the autopilot part, via the keystroke -> attempting to send the code (65) (which according to the FSUIPC documentation is the Ctrl+A keystroke -> the one I have assigned for the autopilot in the PMDG 747-400X option menus).

 

But clearly, I am doing something wrong.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.