Crokybird

Saitek MultiPanel Display in PMDG aircraft not updated

Recommended Posts

Hi,

I have the problem that the LED display of my Saitek Multi Panel is not being updated on PMDG aircraft.

I have the following setup:
All buttons of my Saitek Multi Panel are controlled by LINDA except the rotary knob.
Mapping the functions SAI_MULTI_increase_value and SAI_MULTI_decrease_value in LINDA (on Press) causes the rotary knob to be jumpy and with a lot of latency.
Instead, I am using SPAD and FSUIPC which gives a much better behavior of the rotary knob.

The Multi Panel display is updated and consistent with FSX on my default aircraft. However, on my PMDG aircraft the altitude, heading, etc is correct in FSX in the Virtual Cockpit, but the display of my Saitek Multi Panel is never updated. The altitude stays at 10000, the IAS and HDG at 000.
I have set EnableDataBroadcast=1 in [SDK] section of my PMDG ini files, but that didn't help.

 

The default and PMDG aircraft are handled differently by SPAD and FSUIPC in my setup:

Default aircraft:
SPAD : Multi Panel 1 - Setup - Rotary Knob - FSUIPC Offset Change (for ALT,VS,IA,HDG and CRS)

PMDG aircraft:
SPAD: Multi Panel 1 - Setup - Rotary Knob - FSUIPC Virtual Button , Virtual Joystick 64 , Virtual Button 0-9 (ALT-CRS)
FSUIPC : Buttons & Switches , Profile specific, Joy# 64, Btn# 0-9 , Select for key press , keys to be sent when button pressed
FSX : PMDG Aircraft - CDU/FMC - PMDG Setup - Options _ Key commands - Autoflight - keys for rotary knob functions

 

So, on PMDG aircraft, when I turn the rotary knob, SPAD sends a virtual joystick+button command to FSUIPC, FSUIPC translates this into a key press command and sends this to FSX, and in FSX this key press is equivalent to an rotating knob function in my PMDG aircraft. It works perfectly in FSX, except that the Saitek Multi Panel display is not updated.
I then decided to replace the FSUIPC key press by a LUA script because that can handle multiple commands. The initial key press in the lua script works perfectly with the ipc.keypress command.


CtrlShift6.lua:
ipc.keypress(54,11) -- send CTRL+SHIFT+6
--.... some function to update Multi Panel display ....

CtrlShift7.lua:
ipc.keypress(55,11) -- send CTRL+SHIFT+7
--.... some function to update Multi Panel display ....


I have seen the function RefreshSMP() in common.lua, but that is not a global function that I can call from another lua script. 

Is it possible to put a command(s) in the lua script to get my Multi Panel display updated?
Or is there another easy solution? 

 

CBird

 

Share this post


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

Hi CBird

The LINDA implementation for Saitek radio and multi panels is limited to standard default aircraft. Due to the non-standard interfaces used by more sophisticated add-on aircraft from companies like PDMG and Aerosoft, they do not use or recognise the default functionality. This is the problem you have hit. I can offer no solution at present.

If you wish to use the RefreshSMP() and other functions in common.lua, these can be called from your own functions written in LUA in the user.lua file in the aircrafts /linda/aircrafts/{your aircraft}/ folder. You need to write and save a function like:

function myRefreshSMP()

      RefreshSMP()

end

However, it is not possible to called this type of function as a timed event.

 

Share this post


Link to post
Share on other sites

Hi ScotFlieger,

I already was afraid that it wouldn't be that simple. I will give it a try and do some lua-programming myself.

If I get it working then I will let you know (but it will certainly take some time).

 

CBird

 

Share this post


Link to post
Share on other sites


Problem solved ! 

I have the Saitek MultiPanel (SMP) display fully synced with FSX for my PMDG737 and PMDG777 aircraft, whether I use the rotary knobs of the SMP or use the mouse cursor to rotate the AutoPilot knobs on the screen. In the end it was just a bit of Lua-event trapping, and sending offsets to FSUIPC. Credits go out to BillyDragon and his post "pmdg sdk offset configuration in saitek multipanel" on the SimFlight forum, which put me on the right track.

I will explain the steps how I got it to work, but of course SPAD (v0.51), FSUIPC and LINDA are required. 
I assume some basic knowledge of creating profiles in SPAD and know how to use FSUIPC from within the FlightSim.


SPAD
In SPAD I have created a dedicated profile "PMDG".
Then select:  Multi Panel 1 - Setup - Rotary Knob  - plus the following:
ALT - FSUIPC Virtual Button - Clockwise  - Virtual Joystick N = 64 , Virtual Button N =1
ALT - FSUIPC Virtual Button - CClockwise - Virtual Joystick N = 64 , Virtual Button N =2
VS  - FSUIPC Virtual Button - Clockwise  - Virtual Joystick N = 64 , Virtual Button N =3
VS  - FSUIPC Virtual Button - CClockwise - Virtual Joystick N = 64 , Virtual Button N =4
IAS - FSUIPC Virtual Button - Clockwise  - Virtual Joystick N = 64 , Virtual Button N =5
IAS - FSUIPC Virtual Button - CClockwise - Virtual Joystick N = 64 , Virtual Button N =6
HDG - FSUIPC Virtual Button - Clockwise  - Virtual Joystick N = 64 , Virtual Button N =7
HDG - FSUIPC Virtual Button - CClockwise - Virtual Joystick N = 64 , Virtual Button N =8
CRS - FSUIPC Virtual Button - Clockwise  - Virtual Joystick N = 64 , Virtual Button N =9
CRS - FSUIPC Virtual Button - CClockwise - Virtual Joystick N = 64 , Virtual Button N =10

In C:\Program Files (x86)\SPAD\SPAD.ini you should now see:

RotUpActionALT=VButton,64,2
RotUpActionVS=VButton,64,4
RotUpActionIAS=VButton,64,6
RotUpActionHDG=VButton,64,8
RotUpActionCRS=VButton,64,10
RotDownActionALT=VButton,64,3
RotDownActionVS=VButton,64,5
RotDownActionIAS=VButton,64,7
RotDownActionHDG=VButton,64,9
RotDownActionCRS=VButton,64,11

 

FSUIPC
In FSUIPC I have created two profiles: PMDG737 and PMDG777, although you can also use a single profile.
In FSUIPC select: Key Presses - Tick the box Profile specific?
In SPAD press Click at "Send button to Flight Sim" for each Rotary Knob (Clockwise or Counter Clockwise) and connect this in FSUIPC to key presses. 

I programmed the following key presses:
SPAD: ALT Vjoystick=64, Vbutton=1  ==> FSUIPC: ctrl + shift + 1
SPAD: ALT Vjoystick=64, Vbutton=2  ==> FSUIPC: ctrl + shift + 2
SPAD: VS  Vjoystick=64, Vbutton=3  ==> FSUIPC: ctrl + shift + 3
SPAD: VS  Vjoystick=64, Vbutton=4  ==> FSUIPC: ctrl + shift + 4
SPAD: IAS Vjoystick=64, Vbutton=5  ==> FSUIPC: ctrl + shift + 5
SPAD: IAS Vjoystick=64, Vbutton=6  ==> FSUIPC: ctrl + shift + 6
SPAD: HDG Vjoystick=64, Vbutton=7  ==> FSUIPC: ctrl + shift + 7
SPAD: HDG Vjoystick=64, Vbutton=8  ==> FSUIPC: ctrl + shift + 8
SPAD: CRS Vjoystick=64, Vbutton=9  ==> FSUIPC: ctrl + shift + 9
SPAD: CRS Vjoystick=64, Vbutton=10 ==> FSUIPC: ctrl + shift + -

In ..\Flight Simulator X\Modules\FSUIPC.ini you should now see:

[Buttons.PMDG737]
0=P64,1,K49,11     -{Key press: ctl+shft+1}-
1=P64,2,K50,11     -{Key press: ctl+shft+2}-
2=P64,3,K51,11     -{Key press: ctl+shft+3}-
3=P64,4,K52,11     -{Key press: ctl+shft+4}-
4=P64,5,K53,11     -{Key press: ctl+shft+5}-
5=P64,6,K54,11     -{Key press: ctl+shft+6}-
6=P64,7,K55,11     -{Key press: ctl+shft+7}-
7=P64,8,K56,11     -{Key press: ctl+shft+8}-
8=P64,9,K57,11     -{Key press: ctl+shft+9}-
9=P64,10,K189,11     -{Key press: ctl+shft+-_key}-


PMDG aircraft in FlightSim

In the FlightSim the FSUIPC key presses have to be connected to a PMDG key command.
Goto CDU - PMDG Setup - Options - Key commands - Autoflight
Then program the keys for the rotary knob functions:

ctrl + shift + 1 = ALTITUDE SELECTOR INC
ctrl + shift + 2 = ALTITUDE SELECTOR DEC 
ctrl + shift + 3 = V/S SELECTOR INC
ctrl + shift + 4 = V/S SELECTOR DEC 
ctrl + shift + 5 = SPEED SELECTOR INC
ctrl + shift + 6 = SPEED SELECTOR DEC
ctrl + shift + 7 = HEADING SELECTOR INC 
ctrl + shift + 8 = HEADING SELECTOR DEC
ctrl + shift + 9 = COURSE SEL INC (CAPT)
ctrl + shift + - = COURSE SEL DEC (CAPT)


The rotary knobs of the Saitek MultiPanel are now linked to the AP buttons of the PMDG aircraft.

So far this should be a known process (I even saw it on YouTube), but now I add something new:


LUA event-trapping

First of all it is necessary to enable the data communication output from the PMDG aircraft in the FlightSim.
Add these lines:

[SDK]
EnableDataBroadcast=1

to these files:

..\Flight Simulator X\PMDG\PMDG 737 NGX\737NGX_Options.ini
..\Flight Simulator X\PMDG\PMDG 777X\777X_Options.ini

 
Now event-trapping lua code must added to the user.lua file of each PMDG aircraft. This only works if the DataBroadcast is/can be enabled, which is not the case for the "old" PMDG 747 Queen of the Skies. This user.lua file is loaded when the PMDG aircarft is started in the FlightSim. If you update LINDA, then these user.lua files are not overwritten.  

Location of the user,lua files:
..\Flight Simulator X\Modules\linda\aircrafts\PMDG 737NGX\user.lua
..:\Flight Simulator X\Modules\linda\aircrafts\PMDG 777\user.lua

Finally, I listed below the user.lua script with the necessary event trapping.
Some of the coding and the Lvars are taken from the Actions.lua files (some location as the user.lus files) :

 

-- Dummy user functions file
-- ===========================

-- This file is loaded right after main actions.lua script loaded.
-- You can use this file to:
-- 1. Override any functions or settings in main script
-- 2. Execute any desired startup sequence for this aircraft (i.e. your own c&d state macro)
-- 3. ... use your imagination

-- This file will not be replaced on the aircraft module update, so all of your modifications
-- will remain active. Best practice from this moment is DO NOT MAKE ANY CHANGES in original
-- actions.lua file. Make all the modifications HERE.

------------------------------------------------------------------------
-- # SAITEK Multi Panel Autopilot Display for PMDG aircraft #[by CBird]#
------------------------------------------------------------------------
-- FSUIPC offsets:
-- 0x07D4 = Autopilot altitude value, as metres*65536
-- 0x07F2 = Autopilot vertical speed value, as ft/min
-- 0x07E2 = Autopilot airspeed value, in knots
-- 0x07CC = Autopilot heading value, as degrees*65536/360
------------------------------------------------------------------------
function PMDG_AP_ALT_show ()            --Display ALT--
    local meters2feet = 100/2.54/12
    local feet2meters = 12*2.54/100
    local ngx_alt = ipc.readLvar("L:ngx_ALTwindow")
    if ngx_alt == nil then ngx_alt = 0 end
    ipc.writeUD(0x07D4, math.floor(ngx_alt*feet2meters*65536 + 0.5))
end
function PMDG_AP_VS_show ()                --Display VS--
    local ngx_vvs = ipc.readLvar("L:ngx_VSwindow")
    if ngx_vvs == nil then ngx_vvs = 0 end
    if ngx_vvs <= -20000 then ngx_vvs = 0 end
    if ngx_vvs >= 20000 then ngx_vvs = 0 end
    ipc.writeSW(0x07F2,ngx_vvs)
end
function PMDG_AP_SPD_show ()            --Display IAS--
    local ngx_spd = ipc.readLvar("L:ngx_SPDwindow")
    if ngx_spd == nil or ngx_spd < 0 then ngx_spd = 0 end
    ipc.writeUW(0x07E2,ngx_spd)
end
function PMDG_AP_HDG_show ()            --Display HDG--
    local ngx_hdg = ipc.readLvar("L:ngx_HDGwindow")
    if ngx_hdg == nil then ngx_hdg = 0 end
    ipc.writeUW(0x07CC, ngx_hdg / 360 * 65536 )
end
event.Lvar("L:ngx_ALTwindow",100,"PMDG_AP_ALT_show")
event.Lvar("L:ngx_VSwindow",100,"PMDG_AP_VS_show")
event.Lvar("L:ngx_SPDwindow",100,"PMDG_AP_SPD_show")
event.Lvar("L:ngx_HDGwindow",100,"PMDG_AP_HDG_show")

 

Changing the Course is not event-trapped because a course change is already displayed/synced on the SMP correctly. 

How does it work:
Rotate the knob on the SMP => SPAD sends a Virtual joystick and Virtual Button command to FSUIPC => FSUIPC translates button command into a (ctrl +shift) key press => the PMDG aircraft connects this key press to an AutoPilot rotary knob command => the AutoPilot display in the FlightSim is updated => a change in the AP display of the FlightSim is event-trapped by the user.lua script => the functions in the lua script read the AP display in the FlightSim (Lvar) => the value of the AP display is written as an FSUIPC offset => the Saitek MultiPanel display is immediately updated if FSUIPC offset is written. 
If you do not rotate the knob on the SMP, but use the mouse button in the FlightSim to rotate the AP buttons, then the AP display in the FlightSim is also updated, and that event is trapped by the lua script, etc.

It took a while to figure it all out, but in the end it is a fairly simple, straightforward process. 
Both the FlightSim and the Saitek MultiPanel display now react accurately and quickly to the Saitek MultiPanel rotary knob  !

 

CBird

Share this post


Link to post
Share on other sites

The user.lua script in black text is better readable than in green text :)

 

-- Dummy user functions file
-- ===========================

-- This file is loaded right after main actions.lua script loaded.
-- You can use this file to:
-- 1. Override any functions or settings in main script
-- 2. Execute any desired startup sequence for this aircraft (i.e. your own c&d state macro)
-- 3. ... use your imagination

-- This file will not be replaced on the aircraft module update, so all of your modifications
-- will remain active. Best practice from this moment is DO NOT MAKE ANY CHANGES in original
-- actions.lua file. Make all the modifications HERE.

------------------------------------------------------------------------
-- # SAITEK Multi Panel Autopilot Display for PMDG aircraft #[by CBird]#
------------------------------------------------------------------------
-- FSUIPC offsets:
-- 0x07D4 = Autopilot altitude value, as metres*65536
-- 0x07F2 = Autopilot vertical speed value, as ft/min
-- 0x07E2 = Autopilot airspeed value, in knots
-- 0x07CC = Autopilot heading value, as degrees*65536/360
------------------------------------------------------------------------
function PMDG_AP_ALT_show ()            --Display ALT--
    local meters2feet = 100/2.54/12
    local feet2meters = 12*2.54/100
    local ngx_alt = ipc.readLvar("L:ngx_ALTwindow")
    if ngx_alt == nil then ngx_alt = 0 end
    ipc.writeUD(0x07D4, math.floor(ngx_alt*feet2meters*65536 + 0.5))
end
function PMDG_AP_VS_show ()                --Display VS--
    local ngx_vvs = ipc.readLvar("L:ngx_VSwindow")
    if ngx_vvs == nil then ngx_vvs = 0 end
    if ngx_vvs <= -20000 then ngx_vvs = 0 end
    if ngx_vvs >= 20000 then ngx_vvs = 0 end
    ipc.writeSW(0x07F2,ngx_vvs)
end
function PMDG_AP_SPD_show ()            --Display IAS--
    local ngx_spd = ipc.readLvar("L:ngx_SPDwindow")
    if ngx_spd == nil or ngx_spd < 0 then ngx_spd = 0 end
    ipc.writeUW(0x07E2,ngx_spd)
end
function PMDG_AP_HDG_show ()            --Display HDG--
    local ngx_hdg = ipc.readLvar("L:ngx_HDGwindow")
    if ngx_hdg == nil then ngx_hdg = 0 end
    ipc.writeUW(0x07CC, ngx_hdg / 360 * 65536 )
end
event.Lvar("L:ngx_ALTwindow",100,"PMDG_AP_ALT_show")
event.Lvar("L:ngx_VSwindow",100,"PMDG_AP_VS_show")
event.Lvar("L:ngx_SPDwindow",100,"PMDG_AP_SPD_show")
event.Lvar("L:ngx_HDGwindow",100,"PMDG_AP_HDG_show")

 

Share this post


Link to post
Share on other sites

Hi, Crokybird:

Firstly, I want to thank you for this post. I have been bumping my head after this issue with 777 (the funiest thing is that my 737 works perfectly with Saitek, with no intervention needed).

I have implemented every thing you said, step by step and now I get all my rotary buttons working on 777. However, I am not able do display the AP parameters on the Multifunction Saitek Panel.

At the user.lua file, as soon as updated it, the LINDA Editor claimed the error "53: attempt to call field 'Lvar' (a nil value) stack traceback:". As per my poor knowledge about this, I suppose Linda is not able to read any 'ngx_' variable, but the SDK clause is set to broadcast on, like:

[SDK]
EnableDataBroadcast=1

I appreciate any help.

Thank you.

Share this post


Link to post
Share on other sites

The LINDA Editor provides comprehensive error checking of LUA code syntax. However, it is not perfect and can report errors which have no effect of the running of the code. In certain cases it can be ignored but there is no guarantee that the code will run. 

The error message is indicating an error in line 53 of your code. I would start looking there. 

Share this post


Link to post
Share on other sites

Hi decio.apn,

I provided 51 lines of lua code (line 1 = "-- Dummy user functions file", line 50 = "event.Lvar("L:ngx_HDGwindow",100,"PMDG_AP_HDG_show")"), so if you get an error at line 53 then I assume that you are adding some code yourself. ScotFlieger is right in saying that you should check the code in line 53 of your user.lua file. LINDA will stop at the first line containing an error, so the first 52 lines are OK, including the ngx-Lvars there.

I am already in the process of getting the buttons on the Saitek Multi Panel working. For example, when I press the AP button on the Multi Panel then the CMD A button on the MCP is pressed in the FlightSim on the PMDG MCP, and the light of the AP button gets switched on. The programming of the AP-buttons you can do in LINDA, but which function you connect to a button is your personal choice. In LINDA I have connected the AP CMD A button to the AP-button on the Multi Panel.

I have added the following code to my user.lua file (this comes right after the code I presented earlier, so starting at line 51):

 

-----------(this is line 51 in user.lua)-----------------------------------------------------
function PMDG_AP_AP_btn ()
    if ipc.readLvar("L:ngx_MCP_CMDA") == 1 then
        ipc.writeUW(0x07BC, 1)
    else
        ipc.writeUW(0x07BC, 0)
    end
end
function PMDG_AP_HDG_btn ()
    if ipc.readLvar("L:ngx_MCP_HdgSel") == 1 then
        ipc.writeUW(0x07C8, 1)
    else
        ipc.writeUW(0x07C8, 0)
    end
end
function PMDG_AP_NAV_btn ()
    if ipc.readLvar("L:ngx_MCP_LNav") == 1 then
        ipc.writeUW(0x07C8, 1)
    else
        ipc.writeUW(0x07C8, 0)
    end
end
function PMDG_AP_IAS_btn ()
    if ipc.readLvar("L:ngx_MCP_Speed") == 1 then
        ipc.writeUW(0x07DC, 1)
    else
        ipc.writeUW(0x07DC, 0)
    end
end
function PMDG_AP_ALT_btn ()
    if ipc.readLvar("L:ngx_MCP_LvlChg") == 1 then
        ipc.writeUW(0x07D0, 1)
    else
        ipc.writeUW(0x07D0, 0)
    end
end
function PMDG_AP_VS_btn ()
    if ipc.readLvar("L:ngx_MCP_VS") == 1 then
        ipc.writeUW(0x07EC, 1)
    else
        ipc.writeUW(0x07EC, 0)
    end
end
function PMDG_AP_APR_btn ()
    if ipc.readLvar("L:ngx_MCP_App") == 1 then
        ipc.writeUW(0x0800, 1)
    else
        ipc.writeUW(0x0800, 0)
    end
end
function PMDG_AP_REV_btn ()
    if ipc.readLvar("L:ngx_MCP_VORLock") == 1 then
        ipc.writeUW(0x07C4, 1)
    else
        ipc.writeUW(0x07C4, 0)
    end
end
event.Lvar("L:ngx_MCP_CMDA",100,"PMDG_AP_AP_btn")
event.Lvar("L:ngx_MCP_HdgSel",100,"PMDG_AP_HDG_btn")
event.Lvar("L:ngx_MCP_LNav",100,"PMDG_AP_NAV_btn")
event.Lvar("L:ngx_MCP_Speed",100,"PMDG_AP_IAS_btn")
event.Lvar("L:ngx_MCP_LvlChg",100,"PMDG_AP_ALT_btn")
event.Lvar("L:ngx_MCP_VS",100,"PMDG_AP_VS_btn")
event.Lvar("L:ngx_MCP_App",100,"PMDG_AP_APR_btn")
event.Lvar("L:ngx_MCP_VORLock",100,"PMDG_AP_REV_btn")

 

My LNAV-function is not yet working properly. Also, if I press "ALT" on the Multi Panel, I now do a LVL CHG, but what if if want to do an ALT INTV on the MCP?
It is all just playing around with attaching AP button presses to PMDG functions in LINDA, and writing FSUIPC offsets.
Please note that you always have to define a function first, before you can call the function by the event.Lvar().

So far, my Multi Panel display is fully synced with the FlightSim and I have most AP buttons also activated (light gets switchedon/off) when I press a button. Good enough for now.

I would like to have my Saitek Multi Panel working without any lua-intervention, but I don't know how to get that working without re-installing my FlightSim to try it out. (then I need a second computer).

CBird

 

 

,  

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Hi CBird

Thank you for the work you have been doing on the Saitek Panel. I may be able to help with a better integration of your event calls into LINDA's main timer.

If you look in lib-user.lua and lib-special.lua (in \linda\libs\) you will find 2 new timer functions LibUserTimer1Hz and LibSpecTimer1Hz. You can define one of these functions in your user.lib for the aircraft and they will override the original. You then replace all your event.lvar definitions with simple function calls. They will then be called every second.

For example,

function LibUserTimer1Hz()

PMDG_AP_AP_btn ()

PMDG_AP_HDG_btn ()

....

end

Share this post


Link to post
Share on other sites

Hi ScotFlieger,

I didn't know about the LibUserTimer1Hz function in ..\linda\libs\lib-user.lua. I have tested it at once.
I disabled the event.Lvar calls to my PMDP_AP_xx_btn functions in user.lua , and added these PMDP_AP_xx_btn functions to lib-user.lua as you suggested.
It works!

However, the button light-on/off response to an AP- button press on the Multi Panel is slower when I use lib-user.lua instead of user.lua. The reason is simple. In my user.lua I use a timer value of 100 in the event.Lvar routines, which means 100 milliseconds, which is 0.1 sec. The LibUserTimer1Hz function in lib-user.lua of course runs at 1Hz, which is a timer value of 1 sec, which is 10 times slower than the event.Lvar routine.
Very sort timer values in the event.Lvar(...,timer-value,...) routine may have a little impact on FlightSim performance, but I decided to keep with the short response times using the event.Lvar routines in my user.lua.
Thanks anyway for the support and suggestions.

CBird

Share this post


Link to post
Share on other sites

Hi CBird

Thank you for the update. I agree 10Hz or, even better, 20Hz is the rate that would best meet the HMI requirement. I am working on bringing the Saitek interface handling into the core LINDA.exe in the same way as the VRInsight MCP panels are handled. I may be in touch. Also are you happy for me to incorporate some of your logic into a future update?

Share this post


Link to post
Share on other sites

Hi ScotFlieger,

Of course you may incorporate anything from me into a future update. I think everybody is grateful anyway for all the effort you put into supporting and developing LINDA, so if I can help I will.

Because I also have the PMDG 777, I will post the Saitek Multi Panel AP-button functions (for user.lua) when I have tested them. I haven't bought the latest PMDG 747 QotS II because I have the old version, which unfortunately does not broadcast the data communication, so I can't provide that user.lua code. I am waiting for the 64bit version of P3D. Then I will then make the switch from FSX to P3D and get the latest PMDG747 (will cost me a lot in add-ons, but a hobby simply costs money isn't it :biggrin:). 

CBird

Share this post


Link to post
Share on other sites

Thank you CBird.

P3D 64bit will be a welcome breakthrough. However, for LINDA to work, FSUIPC4 will need to interface with the 64bit. That is an known until v4 is released and LINDA may also need to be made 64bit. Only the future will tell. 

Share this post


Link to post
Share on other sites

Hi, Scot and CBird:

Thank you for your attention to that.

Actually there was some remark lines on the top of my user.lua that I just removed.

The error I am facing is now on the line 47, that corresponds to:

event.Lvar("L:ngx_ALTwindow",100,"PMDG_AP_ALT_show")

LINDA is not recognizing the ngx_ALTwindow variable, what is strange, since this same variable appers before on the code.

Share this post


Link to post
Share on other sites

Hi decio.apn,

In "FSUIPC Lua Library.pdf" you can read all about the event.Lvar routine. This Event library function was introduced for FSUIPC with version 4.960, so I hope you have this or better the latest FSUIPC version.

The ngx_ALTwindow variable is a standard variable (LVar) in LINDA for PMDG aircraft, at least for the PMDG737 and PMDG777.
Let's check whether LINDA recognizes this variable:

Open FlightSim and select  PMDG737 or 777 as current aircraft in Free Flight. No need to start a flight.
Open LINDA Settings page and make sure that you are in "FSX sync" with the PMDG aircraft.
Select LINDA Tracer (Shift+F1). Now the Settings page is replaced by the Tracer page and a separate console window is opened.
On the Tracer page top-left select "Reload LVars list".
In the list of Lua Variables you should find "ngx_ALTwindow". If you don't see this variable, or the complete list is empty, then I think your PMDG aircraft is not connected properly to LINDA or the variables are not broadcasted. I would suggest to re-install the latest version of LINDA.

If the ngx_ALTwindow variable exists, then you can test the working of the variable.
In the FlightSim you have to start the PMDG flight. Let's keep the aircraft on the ground, but MCP should be working (otherwise you can't check anything).
On the Tracer page select the variable ngx_ALTwindow. In the console window you see the message "[L] LVar: ngx_ALTwindow = 10000".
Do a right mouse click on the ngx_ALTwindow varable on the Tracer page, and the variable turns red on the Tracer page. In the console window you now see the message " Watching new LVar: ngx_ALTwindow = 10000".
If you increase the altitude on the Saitek MultiPanel, then the console window will show, for example
[L] LVar: ngx_ALTwindow = 10100
[L] LVar: ngx_ALTwindow = 10200

Any luck so far?

CBird

Share this post


Link to post
Share on other sites

Hi CBird:

Sorry taking so long to answer.

I did what you described and it worked easy and fine. So, it is proved the problem is not with 777 variables access. It is all right. The issue should be at my LINDA module. I will perform other tests and let you know.

Thanks for your support.

Share this post


Link to post
Share on other sites

Ok, problem persists. I'm still getting the error:


Syntax error!

...Steam\steamapps\common\FSX\Modules
Line:
    54: attempt to call field 'Lvar' (a nil value)
stack traceback:
    ...Steam\steamapps\common\FSX\Modules\linda\lua\tmp.lua:54: in main chunk
 

The odd thing is: LINDA is showing an error at line 54 of a tmp.lua file, while actually I am working on 

C:\Program Files (x86)\Steam\steamapps\common\FSX\Modules\linda\aircrafts\PMDG 777\user.lua

and the red line in error on the editor is the line #49.

It makes no sense at all.

I've found a similar issue at http://forum.simflight.com/topic/80810-lua-error-aerosoft-airbus-fs-linda/ but the solution was not clear.

I went check that tmp.lua file LINDA Editor is referencing on and I found those initial lines:

require("ipc")
require("event")
require("com")
function require () a = a end
dofile("C:\\Program Files (x86)\\Steam\\steamapps\\common\\FSX\\Modules\\linda\\system\\common.lua")
 

After that, it is a copy of my user.lua

 

 

Edited by Decio Pedroso
complementing

Share this post


Link to post
Share on other sites

Hi Decio,

The tmp.lua file seems to be a core file of LINDA. I checked the contents of my tmp.lua file, and it starts with:

require("ipc")
require("event")
require("com")
function require () a = a end
dofile("C:\\FSX\\Modules\\linda\\system\\common.lua")
... and then a listing of System functions, but certainly not a copy of my user.lua.

This tmp.lua file is part of the installation package of LINDA (v2.9.6), so your tmp.lua files should be the same as mine if you are using LINDA v.2.9.6.

The event.LVAR function should be "activated" by the require("event") command in tmp.lua, so maybe the require("..")  commands do not work properly.
If it is the first time that the event.Lvar command is used in the user.lua file that you are editing, then this could mean that it is the first time that LINDA encounters a problem with this event.Lvar function, and then gives you an error in a core LINDA file.
However, I do not have real knowledge how LINDA works internally, so I think help is needed from ScotFlieger on this.

CBird

Share this post


Link to post
Share on other sites

tmp.lua is a temporary file used for syntax checking by the LINDA Editor. It changes between edits. It should not be included in the delivered installation. You should not be playing with the \lua folder.

Share this post


Link to post
Share on other sites

I checked a lot of recent LINDA installation packages (LINDA_2.9.x_Standard_vx.zip  ) and all zip-files have the tmp.lua file in the subfolder "Your Flt Sim Folder\Modules\linda\lua ". I agree that we (users) should not be playing with the \lua folder (I certainly am not), but Decio's error message seems to be pointing to this tmp.lua file.

Share this post


Link to post
Share on other sites

The tmp.lua can be deleted. I have removed the file from the baseline. I have been working on an alternative method for the problem you raise to make it more generic. I will PM you later. 

Share this post


Link to post
Share on other sites

As ussually, thank you for all your support and attention to this issue, folks.

CBird, actually I've never used 'event' instruction before, so, you probably right. It is not activated on my LINDA but I don't have any idea of what to do about.

Decio.

Share this post


Link to post
Share on other sites

I suggest you hold off. I have been working on a simpler working model for users.

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