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! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
Floh124
From: between EDDL and EDDK, Germany
Posts: 10
Hello,
I searched for an answer already but didn't find the right thing:

Is it possible to link a switch position fix to a "function". I mean on my "panel" I have a lot of latching switches but if they are not at the correct position during start of MF it works in the opposite way. Is it possible to include any check of switch position during start up?

I'm often in real full flight simulators (mainly on the B777) and if you start up a new scenario (or power it up) it will advice you (with a note on the instructor station) that the flap lever does not fit to the selected scenario (just as a example / if you do landing training and repeat it always in the final approach phase the flaps and LG must be in landing configuration). If you start it up on ground or power it up generally only some limited number of switches are checked (e.g. fuel control switch).

Wouldn't it be a nice feature if MF could also do such a check (maybe also user configurable). I know (or better to say I see), the busy light on the mega only flashed on when a lacthed switch is switched but I think it would be possible to read really if the switch is (technically) closed op opened.

Best regards
Florian
2021-01-06 14:45
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

This is a complex thematic.... And to explane all posibilitys and disadvantages this take me a lot of time.

Basic awnser.... NO. ( not directly)
There is no "active" data request from The Software (PC) to the MEGA.... As you stil find out... Only if a switch is moved ( change of signal on the Pin) the Firmware will send the status of this single switch to the PC.

There are some ways we can use.... But not fully like you expected.
Maybe i can offert you a good solution.... Or we can make a brainstorming to rquest for a new feature. I still got a idea. maybe you got some new input for me.

I see your from Germany. If you like join Discord and write me there. On my next free spot we can talk together.
Good Luck !
2021-01-07 17:11
Avatar
Floh124
From: between EDDL and EDDK, Germany
Posts: 10
Hello,
for sure we can "talk" about it. (But to be honest, I never used discord at all, so maybe I need some time to "find you" there)

I also have another idea, which is upcoming on my layout: Wouldn't it be nice, if separate mcc files would be automatically loaded when a specified airplane is loaded in the sim (or does this function already exist). I have a pretty unspecified control panel and using it for separate airplanes (not only Boeing, but also Airbus, Bombardier and BAe) so I have to load these files manually...

Best regards
Floh
2021-01-15 21:06
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Shame on me :blink:

In the past i spent everday 1-3 Hours on Discord to support other users...... But in case of Covid19 my buisness (Restaurant) is closed. So i got many free time and i startup some old hobby projects (not flightsim) ..... In that case i stop using Discord and just read there only a couple of minutes per week.
I realy looking forward to increase my online time in the future..... But for the moment i enjoy to do other hobbys, too. Apollogy for that !

About question:

This is not possible directly.....
You still find out.... You can controll with Mobiflight lots of different Systems ( Sims, Aircrafts, AddOns or so) by loading a other MCC File. ( Each Setup simply use its own mcc)
A "Autoload" in case of used/loaded Aircraft is not implement.

In Theory it would be possible to build a Config file that include ALL Configs for e.g. 2 Aircrafts ( So all Configs are exist twice) and you got a Precondition each that read the "Current used Aircraft Offset" ..... In Precon you say something like " Only work if Current Used Aircraft Offset = Cessna" and on the other half of configs you use Precondition " Only work if it = boeing737"
But this is not profitable.

Basicly we say.... 95% of Mobiflight Users fly only ONE Aircraft. Most users build a 1:1 realistic Cockpit e.g for a Boeing.... So they use it just with the same Boing everytime.
the other 5 % use multiple Aircrafts..... BUT they not change them like they change there underware ( old german speach).
So.... If you fly your boeing for 2-4 Hours.... and then you like to fly a Cessna.... Then you need to load the Cessna in the Sim. We think its no big deal to also click on FILE-LOAD-Cessna.mcc for this rare situations.
Good Luck !
2021-01-15 23:11
Avatar
krono
Posts: 27
Hi Floh

You can have information for each plane that is loaded by using a LUA file. All my planes are loaded this way so that each plane has its own setting.
Here is an example of the LUA for an A2A 182

while 1 do-- read first 16 characters from aircraft title (Aircraft.cfg file)
AIRCRAFT = ipc.readSTR(0x3D00, 16)
if string.sub(AIRCRAFT,1,8) == "A2A C182" then
--Panel Lights
BattSw = ipc.readLvar("L:BATTERY1SWITCH")
PanelSW = ipc.readUB(0x2E80) -- reading simconnect AvionicsMaster
if ( BattSw ~= 0 and PanelSW ~= 0 ) then
PANELLIGHT = 1
else
PANELLIGHT = 0
end
--PANELLIGHT = ipc.readLvar("L:BATTERY1SWITCH")
--Heading Indicator
COMP = ipc.readDBL(0x2B00)
GYOBEAR = ipc.readUW(0x07CC)
GYROHEAD = (360 - COMP) + ((GYOBEAR * 360) / 65536)
-- AttIndBank --
AttitudeIndicatorBank = ipc.readDBL(0x2F78)
if AttitudeIndicatorBank <= 0 then
AttIndBank = (360 + AttitudeIndicatorBank)
else
AttIndBank = AttitudeIndicatorBank
end
-- IndPitch --
AttitudeIndicatorPitch = ipc.readDBL(0x2F70)
if AttitudeIndicatorPitch <= -26 then1
IndPitch = -26
elseif AttitudeIndicatorPitch >= 26 then
IndPitch = 26
else IndPitch = AttitudeIndicatorPitch
end



-- Write to custom offsets (Allowable Range: x66C0 to x66FF using 6640 192 offsets )
-- Gauge --
ipc.writeUB(0x6660, PANELLIGHT)
ipc.writeDBL(0x6640, COMP)
ipc.writeUD(0x6694, GYROHEAD)
ipc.writeDBL(0x667C, AttIndBank )
ipc.writeDBL(0x6684, IndPitch)
end
-- DELAY
--ipc.sleep(500)
end


Ken
2021-01-16 02:30
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi krono.

Thanks for share your code.
Basicly that is the Offset i talk about..... So my Logic with a "large" Mobiflight Config-MCC File that include for each Element multiple configs and a Precondition logic that use that "aircraft name String" as indication based on the same system.

And sure.... If you need a Lua Code then its logical to include the Aircraft Typ here.... So the code must only run if Aircraft is selected.

BUT

The User basicly ask ( as i understand) if he can load a Mobiflight MCC file automaticly in case of loaded Aircraft ! And thats not possible.
Good Luck !
2021-01-17 02:19
Avatar
Floh124
From: between EDDL and EDDK, Germany
Posts: 10
Hello,
yes pizman82, you were right. My question would be in the direction, that at aircraft selection separate MCC files could be loaded. But as you already answered, it's not possible.

So maybe we can "discuss" later about a switch checkup at simulator startup (like in real world simulators).

And Krono, I like to thank you for sharing your code. It helps me a lot (as I'm a beginner in LUA scripting) and I'm making progress. May I address just one further question? At the moment I'm using separate LUA files for each input (i.e. on the FSLabs Airbus I only need 9 additional files (1 macro for the engine master switches and 8 lua files) due to the fact that all other commands work quite well with the rotorbrake commands) and one LUA files for the outputs. Maybe it is stupid, but I'm worrying about slowing down things, if I would intergrate everything in one single LUA file (which will be relatively large if all commands and also all aircraft's will be includes) which continuously runs/loops in the background. But maybe we can "talk"/write about this in the other "thread" where I addressed a question more specific to this https://www.mobiflight.com/forum/topic/2721.html.

Best regards
Florian
2021-01-19 15:04
icon