#Cont. electrical logic
1 messages ยท Page 1 of 1 (latest)
@open mason So I don't really understand anything in that article
The thing is that i need a light to come on only when my battery switch is on and never else
the basic logic with everything in MobiFlight is, that we always treat the simulator as the source of "truth".
so a switch sets the battery switch on in the simulator
and we create an output config that reads the battery state back
Right
in this way all possible sim failures or other factors like drained battery will work
Got it
what sim is this?
MSFS2020
and what aircraft?
DA42 by COWS
ok so there are a few layers to this
first we need to have the battery state
so that we read it from the sim and it is 1 when the battery is on and 0 when it is off
also, alternator also usually supplies power so this can get complicated unless we find a sim variable that does the work for us
one possibility is to test Microsoft / Generic / CIRCUIT GENERAL PANEL ON
and try if that reacts also in COWS
So how do I open a menu for these?
Nothing, I don't know how to open a menu for the battery state
like, how do i add the battery state value
ok, it will be helpful to watch the "getting started" video on youtube, but lets see
select the output configs tab
and click the empty line to add "battery state"
then click the edit on the right edge
Right where do I go from here
it pops up a dialog
oh so just like connecting a switch? got it
select simconnect (MSFS) to read from msfs, and usually the Generic aircraft events work for most planes
just like ocnnecting switch but for output yeah
Okay it's done
then test it
press OK right?
Right
and press "run" and test if you get a value on "Flight sim value" column
So i test if the value works now?
yeah
we need to have it working first or nothing else will really work ๐
but basically this is like a led indicator
but we just dont define a led output for it
I mean we could but we dont need it
we just want the value
Just an output value from the sim got it
so CIRCUIT GENERAL PANEL ON should usually work unless the plane vendor has created a fully custom logic for everything
By the way COWS has an LVAR list if this one doesn't work
yeah that is good to know too
so that would be another option
and maybe even better then
but lets see once you have something that reacts to the panel power state
it might be even better since it might have some custom logic for the Diamond's backup battery etc
not sure how the DA42 electrical system is exactly wired
ok good
so if you wanted to make your gear indicators only work when panel has power
lets open one of them
Alright
and open the modify tab
click "add reference"
And battery state?
so yeah, whatever you named it, select it
now this means # represents the value of your battery state config
yes it is 1 if it is on
and 0 if it is off
now add modifier -> Transform
and you can likely see what we are after
$ is our gear state for the led, we multiply with # so it is either $*1 or $*0
Ohh
so config references let you bring other values into your configs
close it
with OK
if you turn battery off, your led should turn off
because the multiplication of anything x 0 is 0
It does work indeed
so when the batt variable turns 0, also the led transform results in a 0
You helped me to understand config references now too
yeah, also if you have the gear leds in PWM enabled pins
you can also use config references to dim your panel lights
No dimmer for gear indicators in DA42 afaik
ok then it is not a big deal, but for cockpit lights if you have other leds or flood light etc
you can read the panel light dimmer value from sim, and use Interpolate modifier to make it 0-255 range and then use that in the transform to set the brightness if you want
but one thing at a time ๐ config references are pretty useful for a lot of things
Very useful indeed, been looking for this, i think i can apply this to different things myself now too?
yeah
Thank you Tuomas very helpful
you're welcome
Nevermind, found a solution...