MSFS2020 PMDG Variables

Let Sim Innovations know about your Air Manager experience and let us know about your dream feature addition

Moderators: russ, Ralph

Post Reply
Message
Author
laoxu
Posts: 3
Joined: Thu Mar 30, 2023 2:27 am

MSFS2020 PMDG Variables

#1 Post by laoxu »

I'm creating an MCP on Arduino for PMDG 737/738 with the air manager, but the variables in the below site are not usable anymore. (I was trying to get MCP_VertSpeed)
https://siminnovations.com/wiki/index.p ... _variables
I read the FAQ says the support to PMDG is limited. But somehow, SPAD.NEXT can read that variable from the sim as below. I tried "PMDGNG3:MCP_VertSpeed" in air manager but no luck.
image.png
Could you please take a look at supporting the PMDG variables? Thanks.

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: MSFS2020 PMDG Variables

#2 Post by Ralph »

That's the NGX for FSX / Prepar3D.

SimPassion
Posts: 5336
Joined: Thu Jul 27, 2017 12:22 am

Re: MSFS2020 PMDG Variables

#3 Post by SimPassion »

laoxu wrote: Thu Mar 30, 2023 2:34 am I'm creating an MCP on Arduino for PMDG 737/738 with the air manager, but the variables in the below site are not usable anymore. (I was trying to get MCP_VertSpeed)
https://siminnovations.com/wiki/index.p ... _variables
I read the FAQ says the support to PMDG is limited. But somehow, SPAD.NEXT can read that variable from the sim as below. I tried "PMDGNG3:MCP_VertSpeed" in air manager but no luck.
image.png
Could you please take a look at supporting the PMDG variables? Thanks.
Try to see there if something useful could be retrieve, at least for the 737-700, there's 1763 references

https://hubhop.mobiflight.com/presets/

image.png

laoxu
Posts: 3
Joined: Thu Mar 30, 2023 2:27 am

Re: MSFS2020 PMDG Variables

#4 Post by laoxu »

SimPassion wrote: Thu Mar 30, 2023 10:08 am
laoxu wrote: Thu Mar 30, 2023 2:34 am I'm creating an MCP on Arduino for PMDG 737/738 with the air manager, but the variables in the below site are not usable anymore. (I was trying to get MCP_VertSpeed)
https://siminnovations.com/wiki/index.p ... _variables
I read the FAQ says the support to PMDG is limited. But somehow, SPAD.NEXT can read that variable from the sim as below. I tried "PMDGNG3:MCP_VertSpeed" in air manager but no luck.
image.png
Could you please take a look at supporting the PMDG variables? Thanks.
Try to see there if something useful could be retrieve, at least for the 737-700, there's 1763 references

https://hubhop.mobiflight.com/presets/


image.png
Hi SimPassion. Thanks for the site and it's very useful. Unfortunately, for the V/S, this site gives the same variable which I'm currently using. In the description, it mentions the problem I got. I just switched to MobiFlight today since I have no idea how to read offset (or even possible) in Air Manager. Thanks for the help.

laoxu
Posts: 3
Joined: Thu Mar 30, 2023 2:27 am

Re: MSFS2020 PMDG Variables

#5 Post by laoxu »

Ralph wrote: Thu Mar 30, 2023 3:43 am That's the NGX for FSX / Prepar3D.
Yes, I guess the same, but it works and do read data from MSFS2020/PMDG.

SimPassion
Posts: 5336
Joined: Thu Jul 27, 2017 12:22 am

Re: MSFS2020 PMDG Variables

#6 Post by SimPassion »

laoxu wrote: Thu Mar 30, 2023 2:52 pm
Ralph wrote: Thu Mar 30, 2023 3:43 am That's the NGX for FSX / Prepar3D.
Yes, I guess the same, but it works and do read data from MSFS2020/PMDG.
Well-known issue with negative values :
https://forum.pmdg.com/forum/main-forum ... ed-display
https://forum.pmdg.com/forum/main-forum ... post230405
https://forum.pmdg.com/forum/main-forum ... var-glitch



Detlef
Posts: 304
Joined: Mon Nov 16, 2020 9:43 am
Location: Bavaria

Re: MSFS2020 PMDG Variables

#9 Post by Detlef »

laoxu wrote: Thu Mar 30, 2023 2:51 pm
SimPassion wrote: Thu Mar 30, 2023 10:08 am
laoxu wrote: Thu Mar 30, 2023 2:34 am I'm creating an MCP on Arduino for PMDG 737/738 with the air manager, but the variables in the below site are not usable anymore. (I was trying to get MCP_VertSpeed)
https://siminnovations.com/wiki/index.p ... _variables
I read the FAQ says the support to PMDG is limited. But somehow, SPAD.NEXT can read that variable from the sim as below. I tried "PMDGNG3:MCP_VertSpeed" in air manager but no luck.
image.png
Could you please take a look at supporting the PMDG variables? Thanks.
Try to see there if something useful could be retrieve, at least for the 737-700, there's 1763 references

https://hubhop.mobiflight.com/presets/


image.png
Hi SimPassion. Thanks for the site and it's very useful. Unfortunately, for the V/S, this site gives the same variable which I'm currently using. In the description, it mentions the problem I got. I just switched to MobiFlight today since I have no idea how to read offset (or even possible) in Air Manager. Thanks for the help.
@laoxu,

I use FSUIPC with Airmanager for my PMDG MCP instrument. You need to run a .lua script in FSUIPC, basically this one:

Code: Select all

ipc.createLvar("yourprefix_MCP_VertSpeed", 0)
ipc.sleep(1000) -- needed as of Sep 5 2022, not sure today

function OffsetChanged(offset, value)
  ipc.writeLvar("yourprefix_MCP_VertSpeed", value)
end
event.offset(0x65d0 , "SW", "OffsetChanged")
It generates an Lvar and fills it with the information from an FSUIPC offset. The offset contains the vertical speed value.

The script above is taken from this one:

Code: Select all

-- Detlef von Reusner
-- FSUIPC7 lua script for PMDG 737-700
-- Oct 23 2022

-- Put 1=Lua PmdgOk in [Auto] section of fsuipc.ini file for automatic start. 


local gVar = {}

function AddVariable(lvar, vtype, len, offset)
  -- create Lvar with prefix
  -- call Lvar func per event when the associated offest changes
  -- len is optional. If len is not given the third parameter is assumed to be the offset.
  if offset == nil then offset = len end
  gVar[offset] = {}
  local var = gVar[offset]
  var.lvar = "ipcpmdg_"..lvar
  var.type = vtype
  var.len = len
  var.offset = offset
  
  ipc.log("creating Lvar "..var.lvar)
  ipc.createLvar(var.lvar, 0)
  ipc.sleep(1000) -- needed as of Sep 5 2022
end

function OffsetChanged(offset, value)
  -- ipc.log("OffsetChanged called, params: "..offset.." "..value)
  -- ipc.log("type of value is "..type(value))
  if gVar[offset].type == "STR" then
    -- ipc.writeLvarSTR(gVar[offset].lvar, value)  -- not working
    if offset == 0x656c or offset == 0x6572 then -- process dashes
      if string.find(value, "--", 1, true) ~= nil then
        ipc.writeLvar(gVar[offset].lvar, 99000.)
      else
        ipc.writeLvar(gVar[offset].lvar, tonumber(value))
      end
    else
      ipc.writeLvar(gVar[offset].lvar, tonumber(value))
    end
  else
    ipc.writeLvar(gVar[offset].lvar, value)
  end
end

function StartEventWatching()
  for offset, var in pairs(gVar) do
    if var.type == "STR" then
      event.offset(offset, "STR", var.len, "OffsetChanged")
    else
      event.offset(offset, var.type, "OffsetChanged")
    end
    ipc.sleep(200) -- not sure if needed
  end
end

-- ipc.sleep(30000) -- Verzoegerung fuer Linda ??

AddVariable("AIR_DisplayLandAlt", "STR", 6, 0x6572)
AddVariable("AIR_DisplayFltAlt", "STR", 6, 0x656c)

AddVariable("MAIN_annunAP", "UW", 0x65f1)
AddVariable("MAIN_annunAP_Amber", "UW", 0x65f3)
AddVariable("MAIN_annunAT", "UW", 0x65f5)
AddVariable("MAIN_annunAT_Amber", "UW", 0x65f7)
AddVariable("MAIN_annunFMC", "UW", 0x65f9)

AddVariable("MCP_IASMach", "FLT32", 1, 0x65c4)
AddVariable("MCP_IASBlank", "UB", 1, 0x65c8)
AddVariable("MCP_IASOverspeedFlash", "UB", 1, 0x65c9)
AddVariable("MCP_IASUnderspeedFlash", "UB", 1, 0x65ca)
AddVariable("MCP_VertSpeedBlank", "UB", 0x65D2)
AddVariable("MCP_VertSpeed", "SW", 0x65d0)
AddVariable("MCP_indication_powered", "UB", 0x65e9)

-- not really needed for published instruments:
AddVariable("PlanePitchDegrees", "SD", 0x0578)
AddVariable("SimOnGround", "UW", 0x366)
AddVariable("GroundAltitude", "SD", 0x0020)


StartEventWatching()

-- =============== additional Lvars / offsets ==========

ipc.createLvar("ipcpmdg_DC_Ammeter", 0)
ipc.sleep(1000) -- needed as of Sep 5 2022

ipc.createLvar("ipcpmdg_Frequencymeter", 0)
ipc.sleep(1000)

function ChangeMeterTopLine(offset, v)
  local amps, freq
  amps = tonumber(string.sub(v, 1 ,4))
  if amps == nil then amps = 999 end
  ipc.writeLvar("ipcpmdg_DC_Ammeter", amps)
  
  freq = tonumber(string.sub(v, 9 , 12))
  if freq == nil then freq = 999 end
  ipc.writeLvar("ipcpmdg_Frequencymeter", freq)
end

event.offset(0x64bc, "STR", 13, "ChangeMeterTopLine")

----

ipc.createLvar("ipcpmdg_DC_Voltmeter", 0)
ipc.sleep(1000) -- needed as of Sep 5 2022

ipc.createLvar("ipcpmdg_AC_Ammeter", 0)
ipc.sleep(1000)

ipc.createLvar("ipcpmdg_AC_Voltmeter", 0)
ipc.sleep(1000) -- needed as of Sep 5 2022

function ChangeMeterBottomLine(offset, v)
  local dc_volt, ac_amps, ac_volt
  
  dc_volt = tonumber(string.sub(v, 1 ,4))
  if dc_volt == nil then dc_volt = 999 end
  ipc.writeLvar("ipcpmdg_DC_Voltmeter", dc_volt)
  
  ac_amps = tonumber(string.sub(v, 5 ,8))
  if ac_amps == nil then ac_amps = 999 end
  ipc.writeLvar("ipcpmdg_AC_Ammeter", ac_amps)
  
  ac_volt = tonumber(string.sub(v, 9 ,12))
  if ac_volt == nil then ac_volt = 999 end
  ipc.writeLvar("ipcpmdg_AC_Voltmeter", ac_volt)
end
event.offset(0x64c9, "STR", 13, "ChangeMeterBottomLine")

-- ==============================
The script generates all Lvars, I need for my PMDG instruments. My PDF file explaining things is here:
https://www.dropbox.com/scl/fo/epx2ltcl ... 41vn94prso

Good flying!
Detlef

Post Reply