MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

Go to page 1Go to page 012Go to page 2Go to page 2
Posts: 91
are days that I am trying to set the guidance for the Leonardo's maddog md80.
So for the encoders, we have solved see other posts. The problem still remains on the displays.
Offsets with related variables sent and read by ipc.lua work perfectly.
In the 7 segment displays, I actually have the correct Fsuipc values which I also visualize in mobiflight.

The problem is that offset is read and write slowly and there is a continuing interchange by a fraction time of 00000 for the altitude and 000 for spd or heading.
If I do a test with the default NAV1 and CRS everything works perfectly the values remain fixed and the speed of the encoders its in real time.

Someone have this issue? is a problem related from the specific offsets?
Many thanks
2019-04-24 11:02
From: ETSI, Germany
Posts: 5648
I have a Idea.

What Offset do you use for that ??

Normaly your Script should do what i explane you in other post....
It will READ a LVar ( or something else internal in Maddog) and WRITE the Data to a Offfset of Your Choice.
Mobiflight will finaly just show this Offset ( In same way like a Standard Offset form FSUIPC List for a FSX Aircraft)
If Your Display will show 000 instead of the currnt speed then the Value of that Offset is eactly at this moment also 000 !
So THIS is no issue in Mobiflight ! The Problem is in your script pretty sure !

Possible Isues.

1. As i said last time.... If you use a script that also include Inputs.... So you try to WRITE with your encoder this Offset and same time you read this offset for the Display then this can not work...... In That case you need a special Logic with 2-3 Variables so you have a logical splitting between Input and Output Data.
Please tell us HOW you make the Inputs !

2. Wrong Offset.
It looks like your Offset ( You use in script ) is maby wrong.
If this Offset is not "Free" then you try to write it with data ( Altitude e.g.) but same time the regulary Programm that use this Offset ALSO write its Data to it ( in that case Value 0 )
Please tell us what Offset you use for the Problematic Config (including size and typ) .
NOTE: You can use only Free Offsets !
Good Luck !
2019-04-24 13:03
Posts: 91
thank you pizman to effort to help me.
in the lvar the script is very simple and its:

-- LUA Script V 1.0
-- 20.10.2011

function setAirplane(offset, value)

acftname = ipc.readSTR(0x3D00, 35)
ipc.log("Lua script started for Aircraft: " .. acftname .. ":")
handleName = "Error"

-- call the function on startup of Lua
setAirplane(0x3D00, "")

while 1 do

--GLARESHIELD -----------------------------------------------------

master_warn = ipc.readLvar("L:masterwarn_adv1")

master_caut = ipc.readLvar("L:mastercaut_adv1")

md_ipc_ap_alt = ipc.readLvar("L:md_ipc_ap_alt")

md_ipc_ap_spd = ipc.readLvar("L:md_ipc_ap_spd")

md_ipc_ap_hdg = ipc.readLvar("L:md_ipc_ap_hdg")

md_ipc_ap_vs = ipc.readLvar("L:md_ipc_ap_vs")


the offset don't think include input is only to show the value on the 7segment display. For the encoder, I use macro Lua but for the moment is not implement
im testing only moving the virtual encoder on the virtual cockpit.

2. i dont know if is free :( im very poor with logical and test offsets.
2019-04-24 14:57
Posts: 91
I'm also questioning pete dowson,
he tells me that the offsets are occupied by something else,
but I don't understand why if the offset is the one that corresponds to the display correctly it must be occupied by something else.

I don't understand why you are using L:Vars for standard values available direct from P3D in existing offsets.
I have no idea what you "intend", I'm just amazed that you resort to L:Vars when there's no need! Look at the main FSUIPC Offset list!
BTW why are you using offset 68EC? The user offsets are 66C0 to 66FF. Your zero displays might simply be something else using that reserved offset!
2019-04-24 15:46
From: ETSI, Germany
Posts: 5648
:blush: Im proud Pete Dowson ( the God of Homecockpits) also got same idea like me.

About your question.

FSUIPC support us a "little" range of 64 Bytes beginning at Offset 66C0 thats "Free for general Use" . This area would be "normaly" not used from any commercial AddOn.
If you build a script and you need only some bytes its high recommend to use THIS Area.

Your Script work in the commercially Area ( 6700 - 6D60 ---- 1632 Bytes) This area is used for example by PMDG, Jeehell and 3rd Party AddOns like Weather , Flightplaning Tools and so on) . So... Yes. Maby your Maddog itself already support Data via FSUIPC on this Offsets or maby a other AddOn do this.


If Possible please rework your script to make a Test....


md_ipc_ap_alt = ipc.readLvar("L:md_ipc_ap_alt")

md_ipc_ap_spd = ipc.readLvar("L:md_ipc_ap_spd")

md_ipc_ap_hdg = ipc.readLvar("L:md_ipc_ap_hdg")

md_ipc_ap_vs = ipc.readLvar("L:md_ipc_ap_vs")

Without using correct size and productive... Just change the Offsets here into 66C0,66D0,66E0 and 66F0
Then make a test if your Problem is gone.

If Yes then the used Offsets was simply not "free"
Good Luck !
2019-04-24 19:24
Posts: 91

but there is also some lag when turn virtual encoder or maybe sometimes also 000 0r 0000 for the altitude.
I have a reply from maddog team also :

I think it's all backed up by the refresh of the "exposed" variables, he kept it deliberately low for a performance talk
2019-04-24 19:53
From: ETSI, Germany
Posts: 5648
Yeah.... Maby these guys can help you better !

If you like to do some testings "play" with the settings !

1. get sure Mobiflight Logging Mode is OFF ..... With active logging massive Delays occure in Displays.

2. Reduce Mobiflight FSUIPC Poll Rate .... Test 100,200,300,400,500 what is better for you..... I personaly use 400 ( With a real poor computer system)

3. Change the "loop time" .... On last line of your script there is written "ipc.sleep(50)"
This is like a "Wait for 0,05 Seconds" command .... Increase/decrease this value and check if it make feel better.
Good Luck !
2019-04-24 23:17
Posts: 91
Thank you Pizman,
i noted that the encoder and display run very well if i turn 100 in the Poll rate and incredible if i set minimal settings in prepar
with frame passing from 30 llocked to unlimited (about 2-300)
when i lock frame in prepar or add virtual cockpit tc.....the encoder drop down and the 7 segment lag.
2019-04-25 12:19
From: ETSI, Germany
Posts: 5648

Here i´m not professional.... May you should look in google and Cockpitbuilder Forums. But it is no suprise ! FSX ( And also P3D) need a mssive Hardware.

In the Past there was a funny fact. when a new Flightsim was released ( Whatever FS3, FS4 until newer FS9 and FSX there was no existing Hardware on the market.
Means casual Users could play in Min Settings.... High End Computers could play in Medium and Normal Settings..... But for High or Extreme Settings there exist no Hardware at time of release..... After some Years new GPU and CPU came on market but then a new Sim wwith much more Requirements get released and trouble startup again.

So it sounds strange when we talk about a 12 Year old Software ( P3D also based on it) but for a Highend Setting with AddOns, Scenery and a Homecockpit you need also Today a Computer from the upper class. As i know a "perfect" FlightSim PC (Single Setup) costs 2500$ upwards. I Read from Systems in the 5000$+ Class that just reach the Settings and be not overpowerd.
Good Luck !
2019-04-25 17:14
Posts: 91
Hi, now work perfectly all the display, and tune also the performance with this new Lua script.:thumbup: :thumbup:

I'm studying now a way to make this in an advanced system, my friend worked for me in a completely new Lua script.
and also putting the variables on the guidance:
1. under 10,000 meters the symbol "=" (ex = 9000 ...) and under 1000 the double "==" (== 900 ..) li ke ther real guidance show.
2. for Vertical Speed it should be - / + with Zero behind and V S P M for the alphanumerical value if descend or increase the level in the various mode
vertical speed, ias or mach mode.

There are some problems.

1. == don't show in the digit of the altimeter digit
2. for the VSpeed the correct digit need to show 0-100 while come to -1000 is correct ... the digit shows me only -100 without 0 behind -
3. no V S P or M mode (need an alphanumeric output digit, but for the moment need to shows something like it also in a normal digit?)

As for the FGCP being powered a separate Lua is provided with an adjustable timer. (time was 22 seconds)
The FGCP is on the left DC bus and it monitors that regardless on how it gets powered up (l, r gens, ac bus tied or not, apu tied or not etc..)
It must be on a separate lua because of the time delay, otherwise, it would cause the MADDOG_X lua to become unresponsive in that time period.
Use [Auto] in the fsuipc5.ini to have it start automatically.



FGCP POWERED UP = 0x6914 as UD (1 = powered and ready, 0 = not powered)
go to precondition Tab, but I can't set something like:

Vertical speed dont show 0 behind -


its something like it?

How to attach a txt file of my Lua?
very complicated also for the images to attach here :(
[Last edited by pizman82, 2019-04-28 02:05]
2019-04-27 09:06
From: ETSI, Germany
Posts: 5648
Sorry my friend....

Thats all extremly confusing me.

Please understand.... Without see your script (As i said i´m no programmer so i not understand scripts 100% whatever i see them) i can not help you.

About the Display Problems....

Max7219 and 7 Segment Displays are limited... You can not show Things like "V" "M" and so on. P, S is possible whatever a "S" is a 5 finaly.
You can use a 14 Seg Digit NOT directly with Max7219 and Mobiflight. There are tricky solutions for that.... But then we need to rethink your whole System. That need a longer conversation by Mail . Without knowing the MD80 (never used before) i can not figure out the functions to build a solution. There i need help.
The "=" Symbol maby is possible. I Not try out myself. that must be tested.

About the last Links/Pictures
Here i can not understand what you do here or you will do. ... As i said above. Without script i not know what Offset 6914 means Maby you must explane me that via Mail or try again.

I will help you (that will takes longer time i think :P ) but you must tell me STEP BY STEP.... What you need.... How it should work ... What you already done. Then we can find a way.
Good Luck !
2019-04-28 02:16
Posts: 91
i try to explain better.
The Lua made on these days are tested and work perfect but is not receipt by mobiflight limits. Here in attach:

1. In the Maddog there is an alphanumeric output locate from HDG and Vspeed to indicate the profile of rate in vertical mode:
V for vertical speed mode change by pressing VSPD the readout display the example maybe V-1200 (1xalphanumeric and 4digit for the rate per second)
S for IAS mode ...pressing by press the readout display the example maybe S___170 ("_" no numbers)
M and P is not necessary

2. The same problem with special carachters is in the Altitude. Altitude have 5 digit and ==000 to =900 but the digit = is not interpret by= but 0

3. About the Readouts stay off not work while the precondition is offset 0x6914 to zero satisfy with these Lvar:

event.Lvar("L:ovhd_acload_needle1", 100, "L_AC_FGCP")
event.Lvar("ovhd_acload_needle3", 100, "L_AC_FGCP")
event.Lvar("L:ovhd_ac_busxtie_switch1", 100, "L_AC_FGCP")
event.Lvar("ovhd_L_apu_bus_adv1", 100, "L_AC_FGCP")
event.Lvar("ovhd_L_ext_bus_adv1", 100, "L_AC_FGCP")

so. I add a config for the example altitude:
offset 0x6904 value Int Size in Bytes 4 mask value with 0xFFFFFFFF no bcd mode
no compare
display 1 to 5 (use left padding)
precondition if offset (set to another config without devices) is (AND) =1

offset 0x6904 value Int Size in Bytes 4 mask value with 0xFFFFFFFF no bcd mode
no compare
display 1 to 5 (use left padding)
precondition if offset (set to another config without devices) is (AND) =0

strange things:
offset value 0x6914 remain to 0 or 1 don't change anymore following the Lvar status.
If I turn off mobiflight (obviously display go in OFF) and remain off while Maddog is in cold and dark until turn one condition in ON
and display comes up again, but not turn OFF while the condition of one Lvar turn in off.

many thanks!
2019-04-29 01:23
From: ETSI, Germany
Posts: 5648
Hi Again.

At first my email....
Advice my reply time on mails is long. I normaly check my mails only 1-2 times per week.... If much work maby just all 2 weeks.

About Problem....

If there is a 14 Seg Display in your cockpit then the question is.... WHAT does it show overall. If it extremly just show the "V" Character in a special Case then this is easy.... With a bit of wire work we can do this. If the SAME Display must show for example "V" and also " S" then its difficult but maby also possible.
To help i must know....
1. Is this just a ONE DIGGIT Display....
2. What can it show in all possible situations.
3. Is there a readable Indicator WHEN , WHAT thing must be shown.

About "=" Sign... I not test it already. Maby i find time on Thursday.

About the Precondition Problem.
Your System can NOT work

You simly duplicate the Config but you not rework it.

In your example Config 1 work if Indicator ( pretty sure Offset 6914) is 1
And Config 2 work if Indicator is 0
BUT Both Configs do the same !!!! They read Offset 6904 and show its value ( Both in same way) .
So its no matter if C1 or C2 is active aslong they both do the same.

If i understand you correct then the Display should be BLANK if Indicator (6914) is "0"
So the "OFF CONFIG" (Your second) must show "Space Space Space Space Space" on the Display instead of current Altitude Value from 6904
Simply make a Compare and Say If Value = 1 THEN "5 time Space Button" ELSE "5 time Space Button"
So Always ( If Value is 1 or if not 1 means ALWAYS) this config show "5 Empty Diggits"
By the way.... We normaly use here a FAKE Offset to provide Mobiflight of additional work. We use here Offset "0000" by standard.... But thats not required.

Last Note:
Please ask the guy who build this script for you. These difficult workflow with preconditions in Mobiflight is only needed for casual Users they not can scripting and users of AddOns like PMDG that have FSUIPC Offsets.
Your Maddog already need a script to make a communication with Mobiflight possible.
So WHY you not include all this stuff in your script ??

Simple example
((NOTE: I Not know the correct syntax. I Hope thats correct. Please Check this !))

Make a Global Read of The Status .... like : Powerstaus = ipc.readUD(0x6914)
And then include this in a IF ELSE in your Altitude System.
-- (L:md_ipc_ap_alt, number) --> preferred type = UD
function md_ipc_ap_alt (varname, value)
        if Powerstatus = 1 then
	value = math.max(value, 0)
	ipc.writeUD(0x6904, value)
        if Powerstatus= 0 then
	ipc.writeUD(0x6904, 999999)

-- (L:fire_agent_low1_light1, bool) --> preferred type = UB, NOTE - NEW Lvar name for MaddogX  
function agent1_low (varname, value)
        if Powerstatus = 1 then
	ipc.writeUD(0x68E8, value)
        if Powerstatus = 0 then
	ipc.writeUD(0x68E8, 0)


What i mean... You read the "indicator" of your power status "global" and you can use it now in every single Output Script part.
Here you say.... IF Power is ON then write current Value to the Offset.... If Power is OFF then write to LED "0" Zero. ( Whatever Lvar is 1 a.t.m.)
For Displays you say if Power is ON then write current Value.... If Power is OFF then write a fictional numer like 99999
In Mobiflight you can now make ONE Config for Altitude.... And you say in Compare If Value is exaclty 99999 then Blank the Display.... Else Show Value !

Summary. If you still use a script (instead to normal users with standard Aircrafts or famous Addons like PMDG) then i would include all this precondition Stuff in your script !
Thats more Powerfull and easy..... For you Mobiflight is just the "transmitter" to the Displays. All the "work" is done already before mobiflight in your script !

Why is it so difficult in your maddog to define the Power Status with this xx Seconds Sleep Timer ?
Do you realy need this ? Why you not simply say all Displays LED and so on should be ON directly without waiting.... Then you can save the second script !
Good Luck !
2019-04-29 21:59
Posts: 91
Thank you Ietzman a lot for your precious support.
The staff is in working to remodeled the Script.
In the meantime with duplicate config and opposite precondition the display goes in off by adding in comparing
the value if 0 add "space space space space space".

About alphanumeric. In the FGCP there is a 13 segment display to interpret correctly the letter.
From the manual:

Pitch control wheel (PCW).

Permits control of vertical speed, IAS/Mach or pitch attitude depending on engaged pitch mode.
Manually rotating the PCW toward AND (Aircraft Nose Down) or ANU (Aircraft Nose Up) will cause pitch profile readout display to change. When in FD, the pitch bar in the PFD will indicate pitch commands. When the autopilot is engaged, the aircraft will manoeuvre to maintain the pitch reference set by the PCW. Rotating the PCW to centre detent (less than 100 ft/min) will engage the altitude hold mode.

When operating in IAS or Mach hold mode, the IAS or Mach reference value can be adjusted by use of the PCW. The new reference value together with S or M will be displayed in pitch profile readout.

When in turbulence mode, the pitch attitude can be adjusted by use of the PCW. The new value will be displayed on the pitch profile readout.
Pitch profile readout. Above the PCW.
The first window displays the operating mode:
For vertical speed.
M for Mach.
S for IAS.
Por turbulence (Pitch).
The second window displays pitch reference:
Plus (+) for the climb
Minus (-) for the descent.
The remaining windows display appropriate numerical values.

in practice the letters appear when selected:
V for VERT SPD (the classic format V-0100 - V + 0100)
S for IAS (start S"space space"100 and up and down)
M for MACH (if in MACH mode in spd)
P for TURB (P + "space space" 19)

2019-04-30 00:01
From: ETSI, Germany
Posts: 5648
We need to figure out that in the future by talking or maby by email.

Please send a mail to me.... Use Header "sisoffi - Mobiflight" so my spamfilter will not delete it.

I don´t know your main language..... Writing in english is ok. talking in english takes some time until im back in buisnes ;) I Normaly talk english only every 1-2 Years when i´m in vecation in the united states.

Hopefully i find time.... Then we can figure that out. If you have "teamviewer" this would be perfect !
Good Luck !
2019-04-30 00:51
Go to page 1Go to page 012Go to page 2Go to page 2