• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Low voltage warning light default Cessna 152

Messages
8
Country
ca-quebec
Does anyone know how the low voltage warning light is managed? Trying to add it to the bottom of an XML ammeter gauge.
DUIkOYZ.png


The only thing I found in the SDK is a variable in the TOKEN section. Somehow I doubt we have access to those from XML gauges.
jaXp7jd.png


Robert
 
Off hand, not really. It's a bit complicated too because there isn't a direct variable for a voltage warning.

This is the code I use for my amps gauge:

Code:
(A:ELECTRICAL TOTAL LOAD AMPS,amps) (A:ELECTRICAL BATTERY BUS AMPS,amps) + -1 *

Now, the warning light is going to depend on what it is coded to. It could be something like the above code but the light comes on when it's less than 0 (which indicates the battery is not charging). There's not going to be one particular variable. You are going to need to figure out the code that the plane uses to display the warning light.

The easiest way is to read the code (I don't even know what plane that is). The harder way is to open the electrical debug panel and figure out under what conditions the light comes on. Which is how I came up the code above.

Click on systems under Behavior Debug on the right of this screen:

 
Well, the heading on the debug panel says "discharging when GT zero".

So, unless someone knowledgeable pops up and gives me the proper (or close approximation) of how this warning light is controlled, I'm going to keep things simple and use that as a test for the low voltage warning light.

I better add "is the battery ON" (can't light up without the battery after all).

Discharging:
gS6eX1i.png


Charging:
GZgVPF8.png


It might not be perfect, but it should give a decent approximation.

Thanks for the pointer!

Robert
 
Thanks!

Charging:
h6hq7Wh.png


Discharging:
TwzSnCv.png


Used these lights from google:

Robert
 

Attachments

  • Red_light_OFF.png
    Red_light_OFF.png
    1.6 KB · Views: 210
  • Red_light_ON.png
    Red_light_ON.png
    1.8 KB · Views: 221
If it's the C152 then this looks like it's the code for the light:

Code:
            <UseTemplate Name="ASOBO_SAFETY_Indicator_Battery_Template">
                <NODE_ID>Safety_Indicator_LowVolt</NODE_ID>
                <THRESHOLD_LOAD>0</THRESHOLD_LOAD>
                <ONLY_CHECK_DISCHARGE>True</ONLY_CHECK_DISCHARGE>
            </UseTemplate>

From Official\OneStore\asobo-aircraft-c152\SimObjects\Airplanes\Asobo_C152\model\Cessna152_interior.XML

As that code is just a call to a template you can search for the template name (ASOBO_SAFETY_Indicator_Battery_Template) in the SDK documentation which gives you:

Code:
<Template Name="ASOBO_SAFETY_Indicator_Battery_Template">
    <Parameters Type="Default">
        <NODE_ID>SAFETY_Indicator_Battery</NODE_ID>
        <THRESHOLD_VOLTAGE>23</THRESHOLD_VOLTAGE>
        <THRESHOLD_LOAD>5</THRESHOLD_LOAD>
        <MIN_RPM>500</MIN_RPM>
        <ID>1</ID>
    </Parameters>
    <Parameters Type="Override">
        <Condition Valid="ONLY_CHECK_DISCHARGE">
            <True>
                <EMISSIVE_CODE>
                        (A:ELECTRICAL BATTERY LOAD:#ID#, amp) #THRESHOLD_LOAD# &gt;
                    </EMISSIVE_CODE>
            </True>
            <False>
                <EMISSIVE_CODE>
                        (A:ELECTRICAL BATTERY VOLTAGE:#ID#, volt) #THRESHOLD_VOLTAGE# &lt;
                        (A:ELECTRICAL BATTERY LOAD:#ID#, amp) #THRESHOLD_LOAD# &gt; (A:GENERAL ENG RPM:#ID#, rpm) #MIN_RPM# &gt; and
                        or
                    </EMISSIVE_CODE>
            </False>
        </Condition>
    </Parameters>
    <UseTemplate Name="ASOBO_SAFETY_Indicator_Caution_Template"/>
</Template>

As the ONLY_CHECK_DISCHARGE flag is set to True the code (once resolved for macros (ID is 1 and THRESHOLD_LOAD is 0) would be:

Code:
(A:ELECTRICAL BATTERY LOAD:1, amp) 0 &gt;

So your code should work exactly as the gauge in the cockpit.
 
I've never seen templates before, I poked and prodded in the DEBUG panels but didn't really know what I was looking for (yet).

So if I understand this properly, by setting THRESHOLD_LOAD to 0 results in the system ignoring the default values listed in the template?
I wouldn't have understood it that way. :D

And that EMISSIVE logic would explain how I saw a video of a C-152 have the low voltage warning light turn OFF after a certain amount of time (he was idling). I bet he's fudging the template or has some mod running.

Thanks!

Robert
"not as dumb as yesterday, but stupider than tomorrow..."
 
The stuff in capitals (like THRESHOLD_LOAD) are macros. So, anytime you see the macro name in hashes MSFS will replace it with the value of the macro.

Under Parameters THRESHOLD_LOAD is set to 5 by default. When the C152 calls the template it sets THRESHOLD_LOAD to a new value of 0.

Then in emissive code section the #THRESHOLD_LOAD# inserts the value of THRESHOLD_LOAD, which in this case is 0.

The test is then: If Electrical Battery Load is greater than 0 and that will return either true (1) or not true (0). At that point you have to go into the ASOBO_SAFETY_Indicator_Caution_Template template and figure out what EMISSIVE_CODE does because that is also a macro (it's in capitals). It's likely that ASOBO_SAFETY_Indicator_Caution_Template has some more code in there to control the emissive.

As you can see, you can end up doing some serious deep diving through various bits of code trying to follow all the macros and templates to figure out what it does as whole.
 
This is the video I was walking about.

He starts his engine at 4:20, but his low voltage warning light only turned off at 5:50 after the engine has had time to rev up and let the alternator do its job.
My light comes off the instant I turn on the alternator with the engine running. That's why I think he has some mod running that uses the EMISSIVE logic with the engine RPM and 5amp threshold.

Robert

EDIT: unless EMISSIVE is triggered by an in-game setting that I might have disabled (I was sure I had it set for realistic flight, some sort of setting like that possibly).
And yeah, I'm not going down that rabbithole. My gauge works good enough and I'm going to leave it at that and move on to the next task of my project.
 
Back
Top