• 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.

XML Electrical System

Messages
75
Country
unitedstates
Hey everyone I am still working on my APU but right now I am making the electrical system for the aircraft here is what I have so far:

BATTERIES:
Code:
(L:BATT1 ON, bool) 0 !=
(L:BATT1 TOTAL TIME, seconds) 1 <
	if{
		44(>L:BATT1 AMPS, amps)
		24(>L:BATT1 VOLTS, volts)
	}
(L:BATT2 ON, bool) 0 !=
(L:BATT2 TOTAL TIME, seconds) 1 <
	if{
		44(>L:BATT2 AMPS, amps)
		24(>L:BATT2 VOLTS, volts)
	}
I will not be doing any voltage drop calculations because the batteries will be NiCd and they do not experience a voltage drop as they discharge.
LOAD:
Code:
(L:BATT1 ON, bool) 0 !=
	if{ 
		(P:Absolute time, seconds) (L:BATT1 TIME, seconds) - 
                (>L:BATT1 TOTAL TIME, seconds) 
	} 
	els{ 
	        (P:Absolute time, seconds) (L:BATT1 TOTAL TIME,seconds) - 
                (>L:BATT1 TIME,seconds) 
	}
I borrowed that from the stopwatch xml in the sdk but I do not know if that is correct for what I need. That is supposed to be a timer which will store how much time the battery has been on and thus calculate the amps remaining in the battery

eventually i would like it to implement the timer with the drain code
Code:
<!--This gives the drain in amp-seconds--!>
(L:ELEC LOAD, amps) 3600 / (>L:BATT1 AMPSECS, amps)
<!--This is the actual battery drain--!>
(L:BATT1 AMPS , amps) (L:BATT1 TIME) (L:BATT1 AMPSECS , amps) * - 
(>L:BATT1 AMPS, amps)

any help with the timer would be awesome. For some reason it is the most difficult for me to grasp.

Thanks in advance for the help.
 
Last edited:
Counter

I did a search for some timers and I am still having a hard time understanding how to make a counter in FSX.

I tried
Code:
(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) 5 >
if{
(E:ABSOLUTE TIME, seconds) (>L:OLD TIME, seconds)
(E:ABSOLUTE TIME, seconds) (L:OLD TIME, seconds) - (>L:TIME DIFF, seconds)
}
But I get a 0 value. The display I am using is the default fuel pressure readout changed to (L:TIME DIFF, seconds). I either get a 0.00 or 0..(-0$%@ kind of readout. All I need to a timer that counts up from 0 using the real sim time, not the update section.

Thanks for any help!
 
Absolute Time

Well I made my own absolute time variable

Code:
(E:ZULU YEAR, number) 1 - 31556926 * (E:ZULU DAY OF YEAR, number) 1 - 86400 * + 
(E:ZULU TIME, seconds) +

and I still get the same result as if I had used (E:ABSOLUTE TIME, seconds) using this readout

Code:
<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document
        Type="AceXML"
        version="1,0"
        id="Counter">
    <Descr>AceXML Document</Descr>
    <Filename>25.xml</Filename>
    <SimGauge.Gauge id="Gauge" ArtDirectory="C:\Program Files\Microsoft Games
\Microsoft Flight Simulator X SDK\SDK\SimObject Creation Kit
\Panels and Gauges SDK\XML Gauge samples">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Size>100,80</Size>
        <Element id="Element">
            <FloatPosition>0.000,00.000</FloatPosition>
            <Rectangle id="Rectangle">
                <LineWidth>1</LineWidth>
                <Width>90</Width>
                <Height>24</Height>
                <LineColor>darkslateblue</LineColor>
                <FillColor>black</FillColor>
            </Rectangle>
        </Element>
        <Element id="Element">
            <FloatPosition>0.000,0.000</FloatPosition>
        </Element>
        <Element id="Element">
            <FloatPosition>5.000,0.000</FloatPosition>
            <GaugeText id="GaugeText">
                <FontColor>red</FontColor>
                <FontFace>COURIER</FontFace>
                <FontHeight>16</FontHeight>
                <GaugeString>
		%((E:ZULU YEAR, number) 1 - 31556926 * 
                  (E:ZULU DAY OF YEAR, number) 1 - 86400 * + 
                  (E:ZULU TIME, seconds) + )%!14f!
				</GaugeString>
                <Length>2</Length>
                <Size>90,18</Size>
                <Transparent>True</Transparent>
                <VerticalAlign>CENTER</VerticalAlign>
            </GaugeText>
        </Element>
    </SimGauge.Gauge>
</SimBase.Document>

I am getting .,(-*,(

I have no idea what that means but it can't be good. I calculated the absolute time for 10/4/2009 0000z to be 63390240208 seconds.
 
Back
Top