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.

Go to page 1Go to page 012Go to page 2Go to page 2
Avatar
Moosch
Posts: 3
Need some help here guys!

I have almost finished my C172 sim build using this excellent Mobiflight software however I'm not clued up with FSCUIP and I am struggling to get the caution panel working
Does any have a script they could share or give me any information as how to get the LEDs working please ? (P3D)
2019-10-13 20:57
Avatar
DocMoebiuz
Moderator
From: EDSH, Germany
Posts: 1516
What C172 are you using?
Have a great day!
Sebastian

MobiFlight - Simply build your own home cockpit for your favorite flight sim - MSFS2020, FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2019-10-13 22:38
Avatar
Moosch
Posts: 3
At the moment I'm using the default FSX Cessna in P3D
2019-10-13 22:57
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
HI

As i know ( and i´m not professional with C172) those warning panel have no "existing" Offsets for standard C172,
Maby for AddOns this would be available.
BUT
It´s basicly possible to read other offsets and build a row of indicators to let the led light in realstic conditions.

You should talk to "hannes" ..... A C172 Builder from Austria who already set a lot if those Outputs.
Hopefully he will reply and open a personal contact to you.
Also all other C172 Advanced users are welcome to help "moosch" !!!


*******
Basic idea.....

If you know the exact conditions for a warning light...... then you can build it..... whatever there exist no real offset for it.
For example if you know the OIL PRES Warning light will be ON aslong Mater Battery is on.... AND.... Oil Presure of Engine 1 is below value xxxxx but above value yyyyyy ..... AND.... Rmp of N1 Engine 1 is above value zzzzzz ..... then we can read this single "indicators" and can make a config that include all values ( in a if condition) and light the LED in 100% correct logic.

Summary.... There exist no offsets i think..... But there exit all needed values to "rebuild" what you need.
So simply explane me "when" your warning lights should be ON and OFF..... Then i can think about a combination of available Offsets to controll those LED´s.
Good Luck !
2019-10-14 00:39
Avatar
krono
Posts: 27
Hi

Here is a copy of the ipcready lua I used for the A2A Annunciators. You will have to make your own output addresses as you can see here. I hope this helps you.

if string.sub(AIRCRAFT,1,4) == "C172" then

-- A2A Local Vars
-- Engine
RPM_E = ipc.readLvar("L:Eng1_RPM")
HOBHR4 = ipc.readLvar("L:e1Hour4")
HOBHR3 = ipc.readLvar("L:e1Hour3")
HOBHR2 = ipc.readLvar("L:e1Hour2")
HOBHR1 = ipc.readLvar("L:e1Hour1")
HOBMN1 = ipc.readLvar("L:e1HourFract1")
HOBHR = (HOBHR4 / 10 * 1000) + (HOBHR3 /10 * 100) + (HOBHR2 / 10 * 10) + (HOBHR1 / 10)
HOBMN = 60 * (HOBMN1 / 10)
FFL = ipc.readLvar("L:Eng1_GPH")
EGT = ipc.readLvar("L:Eng1_EGTGauge")
OPRE = ipc.readLvar("L:Eng1_OilPressure")
OTMP = ipc.readLvar("L:Eng1_OilTemp")
FUELL = ipc.readLvar("L:FuelLeftWingTank")
FUELR = ipc.readLvar("L:FuelRightWingTank")
FUELSEL = ipc.readLvar("L:FSelC172State")
BATAMP = ipc.readLvar("L:Ammeter1")
-- Speeds
IAS = ipc.readLvar("L:AirspeedIndicatedNeedle")
-- Annunciaters
ANNVACL = ipc.readLvar("L:VacLLight")
ANNVACR = ipc.readLvar("L:VacRLight")
ANNVAC = ipc.readLvar("L:VacLight")
ANNFUELL = ipc.readLvar("L:FuelLLight")
ANNFUELR = ipc.readLvar("L:FuelRLight")
ANNFUEL = ipc.readLvar("L:FuelLight")
ANNOIL = ipc.readLvar("L:OilPressLight")
ANNVOLTS = ipc.readLvar("L:VoltsLight")
ANNPITCHT = ipc.readLvar("L:PitchTrimLight")
NAVLIGHT = ipc.readLvar("L:NavModeLight")
GPSLIGHT = ipc.readLvar("L:GpsModeLight")

-- Write to custom offsets (Allowable Range: x66C0 to x66FF)
-- Engine
ipc.writeFLT(0X66C0, RPM_E)
ipc.writeFLT(0X66C4, FFL)
ipc.writeFLT(0X66C8, EGT)
ipc.writeFLT(0X66CC, OPRE)
ipc.writeFLT(0X66D0, OTMP)
ipc.writeFLT(0X66D4, FUELL)
ipc.writeFLT(0X66D8, FUELR)
ipc.writeFLT(0X66DC, BATAMP)
ipc.writeFLT(0X66E0, HOBHR)
ipc.writeFLT(0X66E4, HOBMN)
ipc.writeFLT(0X66E8, FUELSEL)
-- Speeds
ipc.writeFLT(0X66EC, IAS)
-- Annunciators
ipc.writeUB(0x66F0, ANNFUELL)
ipc.writeUB(0x66F1, ANNFUEL)
ipc.writeUB(0x66F2, ANNFUELR)
ipc.writeUB(0x66F3, ANNVACL)
ipc.writeUB(0x66F4, ANNVAC)
ipc.writeUB(0x66F5, ANNVACR)
ipc.writeUB(0x66F6, ANNVOLTS)
ipc.writeUB(0x66F7, ANNOIL)
ipc.writeUB(0x66F8, ANNPITCHT)
ipc.writeUB(0x66F9, NAVLIGHT)
ipc.writeUB(0x66FA, GPSLIGHT)


Ken
2019-10-14 05:34
Avatar
krono
Posts: 27
Sorry for the imoges they added themselves in. They should read
"L:OilPressLight" and "L:PitchTrimLight" OilPressLight PitchTrimLight
2019-10-14 05:39
Avatar
Hannes
From: Austria
Posts: 164
Supporter
Here are my settings for the warning panel on my Cessna 172.
Here I do not use offsets of warning lamps, but the actual values ​​such as: the volt of the battery voltage. With comparison I then set the correct limits.


Funktion Offset Wert Typ Bytes Mask Vergleichen Vorbedingung
Warning Low Fuel 0x0B7C Int 4 0xFFFFFFFF Wenn Wert >= 1800000 dann setze 0 sonst 1 Avionic Master = 1
Warning Oil Pressure 0x08BA Int 2 0xFFFF Wenn Wert >= 6500 dann setze 0 sonst 1 Avionic Master = 1
Warning Battery voltage 0x2834 Int 8 0xFFFFFFFFFFFFFFFF Wenn Wert >= 23,9 dann setze 0 sonst 1 Avionic Master = 1
Warning VAC 0x28C8 Int 8 0xFFFFFFFFFFFFFFFF Wenn Wert <= 1350 dann setze 1 sonst 0 Avionic Master = 1
Warning Line 0x0B78 Int 4 0xFFFFFFFF nicht in Verwendung Avionic Master = 1


iconCode:
<MobiflightConnector>
  <outputs>
    <config guid="9a14c96e-05ce-4aff-8e9e-dc7d75ccf430">
      <active>true</active>
      <description>Warning Low Fuel</description>
      <settings msdata:InstanceType="MobiFlight.OutputConfigItem, MFConnector, Version=7.5.2.0, Culture=neutral, PublicKeyToken=null" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <source type="FSUIPC" offset="0x0B7C" offsetType="Integer" size="4" mask="0xFFFFFFFF" bcdMode="False" />
        <comparison active="True" value="1800000" operand=">=" ifValue="0" elseValue="1" />
        <display type="Pin" serial="INSTRUMENT/ SN-60b-a2e" trigger="normal" pin="FUEL" pinBrightness="255" />
        <preconditions>
          <precondition type="config" active="true" ref="583f40e8-a3c8-4beb-9491-64ac762b30b6" operand="=" value="0" logic="and" />
          <precondition type="config" active="false" ref="1632b36b-a471-4f7c-ae4c-febb0b37a3a8" operand="=" value="1" logic="and" />
        </preconditions>
        <transformation active="False" expression="$*(128*65536)" substrStart="0" substrEnd="7" />
        <configrefs />
      </settings>
    </config>
    <config guid="d4979980-4e68-4d1f-a966-217909c87269">
      <active>true</active>
      <description>Warning Line</description>
      <settings msdata:InstanceType="MobiFlight.OutputConfigItem, MFConnector, Version=7.5.2.0, Culture=neutral, PublicKeyToken=null" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <source type="FSUIPC" offset="0x0B78" offsetType="Integer" size="4" mask="0xFFFFFFFF" bcdMode="False" />
        <comparison active="False" value="" operand="" ifValue="" elseValue="" />
        <display type="Pin" serial="INSTRUMENT/ SN-60b-a2e" trigger="normal" pin="LINE" pinBrightness="255" />
        <preconditions>
          <precondition type="config" active="true" ref="024f8a20-416e-4b9f-878a-e0a5c6416f27" operand="=" value="0" logic="and" />
          <precondition type="config" active="false" ref="1632b36b-a471-4f7c-ae4c-febb0b37a3a8" operand="=" value="1" logic="and" />
        </preconditions>
        <transformation active="False" expression="$" substrStart="0" substrEnd="7" />
        <configrefs />
      </settings>
    </config>
    <config guid="fa734a27-945d-4861-8c8a-0db6f69a1c7b">
      <active>true</active>
      <description>Warning Oil Pressure</description>
      <settings msdata:InstanceType="MobiFlight.OutputConfigItem, MFConnector, Version=7.5.2.0, Culture=neutral, PublicKeyToken=null" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <source type="FSUIPC" offset="0x08BA" offsetType="Integer" size="2" mask="0xFFFF" bcdMode="False" />
        <comparison active="True" value="6500" operand=">=" ifValue="0" elseValue="1" />
        <display type="Pin" serial="INSTRUMENT/ SN-60b-a2e" trigger="normal" pin="OIL" pinBrightness="255" />
        <preconditions>
          <precondition type="config" active="true" ref="19486dd0-11cc-4fa4-938a-348ea2b1ebf7" operand="=" value="0" logic="and" />
          <precondition type="config" active="false" ref="1632b36b-a471-4f7c-ae4c-febb0b37a3a8" operand="=" value="1" logic="and" />
        </preconditions>
        <transformation active="False" expression="$" substrStart="0" substrEnd="7" />
        <configrefs />
      </settings>
    </config>
    <config guid="23dfa103-edef-4318-b510-f1cbfd82e98e">
      <active>true</active>
      <description>Warning Battery voltage</description>
      <settings msdata:InstanceType="MobiFlight.OutputConfigItem, MFConnector, Version=7.5.2.0, Culture=neutral, PublicKeyToken=null" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <source type="FSUIPC" offset="0x2834" offsetType="Integer" size="8" mask="0xFFFFFFFFFFFFFFFF" bcdMode="False" />
        <comparison active="True" value="23,9" operand=">=" ifValue="0" elseValue="1" />
        <display type="Pin" serial="INSTRUMENT/ SN-60b-a2e" trigger="normal" pin="VOLT" pinBrightness="255" />
        <preconditions>
          <precondition type="config" active="true" ref="1c9413b0-424f-4ed0-9be4-82276ce26853" operand="=" value="0" logic="and" />
          <precondition type="config" active="false" ref="1632b36b-a471-4f7c-ae4c-febb0b37a3a8" operand="=" value="1" logic="and" />
        </preconditions>
        <transformation active="False" expression="if($<24,1,0)" substrStart="0" substrEnd="7" />
        <configrefs />
      </settings>
    </config>
    <config guid="698a2cd9-92e0-49e6-898a-ab10aee8e832">
      <active>true</active>
      <description>Warning VAC</description>
      <settings msdata:InstanceType="MobiFlight.OutputConfigItem, MFConnector, Version=7.5.2.0, Culture=neutral, PublicKeyToken=null" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <source type="FSUIPC" offset="0x28C8" offsetType="Integer" size="8" mask="0xFFFFFFFFFFFFFFFF" bcdMode="False" />
        <comparison active="True" value="1350" operand="<=" ifValue="1" elseValue="0" />
        <display type="Pin" serial="INSTRUMENT/ SN-60b-a2e" trigger="normal" pin="VAC" pinBrightness="255" />
        <preconditions>
          <precondition type="config" active="true" ref="a1451a56-c6c7-441d-aa55-8963da6ed488" operand="=" value="0" logic="and" />
          <precondition type="config" active="false" ref="1632b36b-a471-4f7c-ae4c-febb0b37a3a8" operand="=" value="1" logic="and" />
        </preconditions>
        <transformation active="False" expression="$" substrStart="0" substrEnd="7" />
        <configrefs />
      </settings>
    </config>
www.modellbau-technik.at
hannes.dobersberger@modellbau-technik.at
2019-10-14 10:25
Avatar
Bazbeaumont
Posts: 11
Hi Hannes,

I am helping Moosch configure his warning annunciators, as well as needing to do it for my own build, so thanks for posting your config script for which I think I understand the logic.

However for each output you have made some references in the precondition tab which I do not quite understand. For instance in the Low Fuel warning you have: -

<precondition type="config" active="true" ref="583f40e8-a3c8-4beb-9491-64ac762b30b6" operand="=" value="0" logic="and" />
<precondition type="config" active="false" ref="1632b36b-a471-4f7c-ae4c-febb0b37a3a8" operand="=" value="1" logic="and" />

I am assuming they are linked to parameters within the C172 but not sure which reference to make.

Could you please provide the names of each of the references for all the warning outputs or point me in the right direction. I have tried copying and pasting your script to a .mcc file but I get a syntax error when I try to load it in Mobiflight (which I cannot find) so I cannot check the names of the pre-conditions.

Many thanks and regards

Ron B
2019-10-14 12:06
Avatar
Hannes
From: Austria
Posts: 164
Supporter
So if you just adjust the settings such as offset and the comparison, then the warning should ever work. My shortcuts then refer only to certain switches that must be active before, so that the warning lamp is released at all. For example: battery, Avionic, …

It would be best if you first light the lamps and only then make additional dependencies on it. When the engine is off, the lights must be on. When engine is started, turn off the lights because the values ​​from the aircraft are OK. If that works so far you can do the test switch from the warning panel etc.
www.modellbau-technik.at
hannes.dobersberger@modellbau-technik.at
2019-10-14 12:29
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
to avoid confusion i will tell you a bit more about "hannes" preconditions.

iconCode:
<source type="FSUIPC" offset="0x0B7C" offsetType="Integer" size="4" mask="0xFFFFFFFF" bcdMode="False" />
        <comparison active="True" value="1800000" operand=">=" ifValue="0" elseValue="1" />


This part is the basic "recalculation" of the fuel warning .... (Warning Low Fuel 0x0B7C Int 4 0xFFFFFFFF Wenn Wert >= 1800000 dann setze 0 sonst 1)

The "Preconditions" you see are a including of other things.... Like he pretty sure use the "Master Battery switch" and say something like " If Master Battery is OFF then Disable the Warning LED, whatever it should be ON in case of the Fuel Capacity calculation"

What you NOT see in his little code example is the "other" Config that is also controlled the SAME LED that time.

For Preconditioning we just activate or disable a full config with that indicator condition. That means config start/stop controlling the LED ....ONLY.... if the condition is TRUE.
But this not mean it will disable the LED automaticly.
So here we normaly build TWO Configs that controll the same LED with "opposit" Preconditions.

In that example he had another Config for that LED that have a fixed Value of 0 (zero) and it have the opposit precondition that say "Only work aslong Master Battery is OFF"
So..... If Battery is ON the orignal Config calculate the fuel level and light the LED ...... If Battery is OFF that config stops and the "always zero" config start working and disable the LED all time.

NOTE: Since Mobiflight 7.6 we include the "Placeholder variable tool" where you can also inclode those stuff in the formula without using double configs and Precondition tab.
You not need to use this tool...... but its helpfull.
Good Luck !
2019-10-14 12:57
Avatar
Bazbeaumont
Posts: 11
Hi Guys,

Thanks for that and yes I realise that the Master Batt Sw has to be on with the engine RPM = 0 for say the Low Oil P light to be on.

However I am having difficulty in understanding how to set the precondition. This is the code from my file: -

<config guid="22dedff2-cf0b-491e-ba06-68e7e42db8b3">
<active>true</active>
<description>Master Batt Sw (pre Con)</description>
<settings msdata:InstanceType="MobiFlight.OutputConfigItem, MFConnector, Version=7.7.0.0, Culture=neutral, PublicKeyToken=null" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<source type="FSUIPC" offset="0x281C" offsetType="Integer" size="4" mask="0xFFFFFFFF" bcdMode="False" />
<comparison active="False" value="" operand="" ifValue="" elseValue="" />
<display type="Display Module" serial="-" trigger="normal" ledAddress="COM1Display" ledConnector="1" ledModuleSize="8" ledPadding="True" ledPaddingChar="0" ledDigits="2,3,4,5,6" ledDecimalPoints="4" />
<preconditions />
<transformation active="False" expression="$" substrStart="0" substrEnd="7" />
<configrefs>
<configref active="False" ref="f6357e9c-a230-43ee-983d-b0134ac4beda" placeholder="§" />
<configref active="False" ref="6257b2f1-e13d-47a1-955b-34937e776727" placeholder="#" />
</configrefs>
</settings>
</config>

I have looked at the example for the C172 Homecockpit and it makes no sense to me at the moment. One thing I have not done is added the Master Batt Sw to the Configured Module list in "Settings". Do I need to do that?

I would be grateful if you could post the code for say the Master Batt Sw precondition so that I can understand it better.

Also my knowledge of German is almost zero so terms in English would be preferred

Many thanks.
2019-10-14 13:42
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi again.
Sorry my english is not the best.... But i hope you understand.

Your problem is your thinking one step to far ;) ( maby cause your a advanced builder)

Mobiflight got one big disadvantage.... It can NOT read a status of a Real Input device. All Actions from switches, buttons and so on are just momentary commands.
So the Arduino "see" a moving of a switch..... Tell this to Mobiflight Software ..... And Mobiflgiht finaly execute a command to the sim. BUT Mobiflight itself not know at any time what position our real switches have at the moment in the cockpit..... it just note temporary if a switch is moved but not "remember" the psoition.
So.... Its not possible to say " Do something aslong my Real Master Battery switch is ON" .... Cause Mobiflight not know this.

What we do here is the "other way" .... We not check our switches.... We check the "internal" sim switches..... Cause those elements in sim all have a Offset we can read and work with.

In your example you must create a Output Config.....: This config NOT need a device like a LED.... Cause we use this config just for "preconditioning" So make a Output Config that read the Offset of the Virtual Battery Master Switch.
(I not know cessna myself..... So find the Offset in the list) ...... Mostly this is Boolean..... So 0 means Swttch is OFF .... 1 ( or above) means switch is ON.

*****

With this "indicator" you can now work. Whatever you use the placeholder logic or you work with preconditions.

Simple example.....
You make a Config for the battery switch and call it "BATTERY"

You make a config for the LED of Fuel Warning.
Here you use your Compare like Hannes Said.
In the Precondition Tab you say...... Only work if Config "BATTERY" have the value =1 (If its 1 while on..... Try out before)

As i said above the problem here is that the precondition just "disable" the config but not the LED itself.
So you need a second Config ( call it for example "Fuel Warning OFF" )
Here you use transform field and say "0" ..... Cause this config must be ZERO at all time. ( The used offset is not important cause we make it to zero.... You can use 0000 or every other)
Finaly in this config you now need the "opposit" Precondition... Like " Only work if Config "BATTERY" = 0

Result: Alsong Battery is ON the original Config work and show LED Status...... If Battery is OFF the "other" Config workes and show "zero" on LED means it is OFF now.

*******
With "Variable Placeholder tool" its a bit more advanced but finaly much more easy.

Here you also need the "Read" Config BATTERY like above.
Then you create ONE Config that read the Fuel and is set to your LED..... You use the same Compare like above to define the Fuel level for Warning LED.
Now you choose in lower FSUIPC Tab a Placeholder.... Checkmark it ...... Choose "BATTERY" from Dropdown and give it a symbol...... For example "a"
In Transform field you write the follow .... if(a=0,0,$)
That means.... IF the Value of "a" (Battery status) is "0" (OFF) THEN show always "0" ..... ELSE show "$" ( The value of Fuel )

Result is the same like before..... But now you not need a additional "OFF Config" and Preconditions..... All of the work is done in this little line of code.

By the way.... If you need more advanced things like including light test switch, avionic switch and lots of other things.... This code line can be much more longer and more complex. You can do nearly everything with this technic.

**************
I hope i can give you the needed impuls..... Appollogy i have no "example files" i can share.
If you need more help..... Simply ask.
By the way..... I recommend to test this with something that is clear and easy like Parking Brake LED...... If you understand the technic THERE..... Then it work also in complex situations like Fuel Warning LED.
Good Luck !
2019-10-14 15:58
Avatar
Bazbeaumont
Posts: 11
Hi,

Thanks for the explanation and, trust me, your English is much better than my German :)

I have a full size, 100% functional B737-800 here at my house using Prosim as the interface along with SIOC for some parts, so I have a small knowledge of programing.

I am using Air Manager and Mobiflight for my C172 which I have found very easy to use. The annunciators are the last item to be completed.

I have it partially working - I am concentrating on the Low Oil Press LED at the moment and I can get the LED to turn ON when I put the Batt switch to ON, but it does not turn OFF when I move the Batt switch to OFF.

I understand about reading the offsets from the sim, I don't have a physical Batt switch at the moment anyway, so I will continue with my quest.

From what you have stated I need 2 pre-conditions, one for the Batt Sw ON with a value =1 and one for the Batt SW OFF with a value =0.

Thanks again.

Ron B
2019-10-14 18:12
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Yes.... If you use he "old" System with preconditions you need in that case TWO Configs and each config need a Precondition.

Lets say it a bit more easy.....

You Build "situations" ...... Every Situation must be done by a own config.

In Situation A (Bat Switch is ON) the Config of Your warning light should read the Value ( from Oil pressure e.g.) and it should show the result on the LED.
In Situation B (Bat Switch is OFF) a Config should controll the LED and should set it to ZERO ( Means LED is OFF)

So you need 2 Configs for this LED ( And a "global" Config that reads battery switch.... whatever this would be finaly used for all other Warning lights, too)

The final job is to build Preconditions that exactly hit the situations you need.

In your example Config A need to work in Situation A ( So always if Battery is ON) ... And thats what you say in Precondition.... Only work if Config "Battery" = 1
The other Config B must work in the B Situation..... (Always if battery is OFF) .... So you use that Precondition here.
Important is.... If a Config controll the LED the OTHER must be disabled that moment..... and also reversed. If 2 Configs work same time then your system can not work and LED starting flickering.

**************
Pretty sure you check this with some testings. Realy hard will be if you need more complex stuff..... For example if you include Lighttest Switch. Then you need 3 Situations...... And alos 3 Configs for each LED. OR if you include the Avionic switch or maby the voltage of Battery Power.
As more Indicators you use as more Configs and preconditions are needed.
If you just need Battery switch the precondition System is fine, too. But if you going more advanced i highly recommend the Variable tool.
Good Luck !
2019-10-14 22:22
Avatar
Bazbeaumont
Posts: 11
Hi Guys,

I am still struggling with this placeholder philosophy.

I have set up the code for the Low Oil Pressure LED and also set up an output config for the Battery Master Switch. All the logic is correct, the value is "0" when switch is off and "1" when it is on.
I have tried using the transform line in the Low Oil Pressure config as described above and here in the forum but I cannot get the Low Oil Press light to go OFF when the battery is switched OFF or ON when the battery switch is ON. I have given the Battery placeholder the value "A"


Below is my code, can somebody please explain what I am doing wrong because I cannot get it to work.

<outputs>
<config guid="0c50f75b-b298-4308-a138-f5bfd1df2635">
<active>true</active>
<description>Master Battery Switch</description>
<settings msdata:InstanceType="MobiFlight.OutputConfigItem, MFConnector, Version=7.7.0.0, Culture=neutral, PublicKeyToken=null" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<source type="FSUIPC" offset="0x281C" offsetType="Integer" size="4" mask="0xFFFFFFFF" bcdMode="False" />
<comparison active="False" value="0" operand="=" ifValue="0" elseValue="1" />
<display type="" serial="MobiFlight Mega/ SN-157-2f2" trigger="normal" pin="" pinBrightness="255" />
<preconditions />
<transformation active="False" expression="$" substrStart="0" substrEnd="7" />
<configrefs>
<configref active="False" ref="7b22b067-1fdf-4208-83dd-25b52af93a94" placeholder="§" />
<configref active="False" ref="c755b9b9-95e8-46dd-8c17-80b84eb20e7c" placeholder="#" />
<configref active="False" ref="7b22b067-1fdf-4208-83dd-25b52af93a94" placeholder="§" />
<configref active="False" ref="c755b9b9-95e8-46dd-8c17-80b84eb20e7c" placeholder="#" />
</configrefs>
</settings>
</config>
<config guid="c755b9b9-95e8-46dd-8c17-80b84eb20e7c">
<active>true</active>
<description>Oil Pressure Warning</description>
<settings msdata:InstanceType="MobiFlight.OutputConfigItem, MFConnector, Version=7.7.0.0, Culture=neutral, PublicKeyToken=null" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<source type="FSUIPC" offset="0x08BA" offsetType="Integer" size="2" mask="0xFFFF" bcdMode="False" />
<comparison active="True" value="5900" operand="<=" ifValue="1" elseValue="0" />
<display type="Pin" serial="MobiFlight Mega/ SN-157-2f2" trigger="normal" pin="Oil P" pinBrightness="255" />
<preconditions>
<precondition type="config" active="false" ref="0c50f75b-b298-4308-a138-f5bfd1df2635" operand="=" value="0" logic="and" />
</preconditions>
<transformation active="True" expression="if(A=0,0,$)" substrStart="0" substrEnd="7" />
<configrefs>
<configref active="False" ref="0c50f75b-b298-4308-a138-f5bfd1df2635" placeholder="#" />
<configref active="False" ref="0c50f75b-b298-4308-a138-f5bfd1df2635" placeholder="#" />
<configref active="False" ref="0c50f75b-b298-4308-a138-f5bfd1df2635" placeholder="#" />
<configref active="True" ref="0c50f75b-b298-4308-a138-f5bfd1df2635" placeholder="A" />
</configrefs>
</settings>
</config>

Thanks
Ron B
2019-10-21 23:05
Go to page 1Go to page 012Go to page 2Go to page 2