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

FSX GS Lock light (2d Gauge)

Messages
76
Country
unitedkingdom
Hi all,

Sorry me again happily charging through a new panel and I am stuck on this one. Looked at Simulation Variables and 3D Cockpit has gauge but cant this one to work.
Sometimes I think I am getting this damn code then I cant fix it.

Code below basically want a light to go on when aircraft coupled to the approach on auto.

XML:
<Gauge Name="GSLOC" Version="1.0">
 <Image Name="1greenoff.bmp"/>
<Element>
 <Visible>(A:CIRCUIT GENERAL PANEL ON, bool) (A:CIRCUIT AVIONICS ON, bool) (A:ELECTRICAL MASTER BATTERY, bool) &&&</Visible>
<Element>
<Select>
 <Value>(A:NAV HAS GLIDE SLOPE:1, bool)</Value>
<Failures>
 <SYSTEM_ELECTRICAL_PANELS Action="0"/>
 </Failures>
<Case Value="0">
 <Image Name="1greenoff.bmp" Bright="Yes"/>
 </Case>
<Case Value="1">
 <Image Name="1greenon.bmp" Bright="Yes"/>
 </Case>
 </Select>
 </Element>
 </Element>

Thanks a million
Matt
 
Hi

I have never seen "&&&" being used. I would have put just "and and" as in
XML:
<Visible>(A:CIRCUIT GENERAL PANEL ON, bool) (A:CIRCUIT AVIONICS ON, bool) (A:ELECTRICAL MASTER BATTERY, bool) and and </Visible>
 
I agree, the &&& is odd. If you wanted to and all of that, there's only two steps & & not three & & & and I don't know that they should be up against each other. Also, using 'and' instead of & may be easier to read.
 
Or you could use:

XML:
<Visible>(A:CIRCUIT GENERAL PANEL ON, bool) (A:CIRCUIT AVIONICS ON, bool) (A:ELECTRICAL MASTER BATTERY, bool) &gt; &gt; </Visible>
 
thank you all will give it a try
is <Value>(A:NAV HAS GLIDE SLOPE:1, bool)</Value> correct ?
 
Well, NAV HAS GLIDE SLOPE only tells you if the nav you're tuned to has a glideslope present. It doesn't mean you've got a good signal.
 
That's all I am after Warp just trying to match up a gauge on pre-existing panel basically comes on when ac auto is locked on GS.
However I have done the changes and it is still not working so I am kinda of stuck accorong to the SDK it needs to be indexed and that's why I put number 1 there
but think that is problem changed code below.

Thanks all

XML:
<Gauge Name="GSLOC" Version="1.0">
 <Image Name="1greenoff.bmp"/>
<Element>
 <Visible>(A:CIRCUIT GENERAL PANEL ON, bool) (A:CIRCUIT AVIONICS ON, bool) (A:ELECTRICAL MASTER BATTERY, bool) &gt; &gt;</Visible>
<Element>
<Select>
 <Value>(A:NAV HAS GLIDE SLOPE:1, bool)</Value>
<Failures>
 <SYSTEM_ELECTRICAL_PANELS Action="0"/>
 </Failures>
<Case Value="0">
 <Image Name="1greenoff.bmp" Bright="Yes"/>
 </Case>
<Case Value="1">
 <Image Name="1greenon.bmp" Bright="Yes"/>
 </Case>
 </Select>
 </Element>
 </Element>
<Mouse>
 <Help ID="HELPID_GAUGE_GS_LIGHT"/>
 </Mouse>
 </Gauge>
 
Hi Walter,

Well the 1greenon Light is the bright bmp so when it is locked on GS that bmp should come on but it doesn't.
The one in the 3d Cockpit goes bright but mine doesn't.

1greenoff
5OVD5Zv.png


1greenon
ql7idXI.png



Cheers
Matt
 
Matt,

the 1greenoff light should be dark at the start of the scenario and then go bright when all the circuits and battery are on. If it does go bright then it means that the Visible condition is working fine. Just a way of eliminating problems...
 
Last edited:
Not really as Just want to go on when it has Nav 1 is locked on Glideslope but should the electric go out I wanted light to go out aswell so it was more realistic.
 
A couple of things:

First, try (A:NAV1 HAS GLIDESLOPE, bool) .

Second, test A:Var bools for equal to zero, or not equal to zero. Don't test them for equal to one. We sometimes assume that if Nav 1 has glideslope, the bool will return 1, but the value returned depends on the source. It's 1 when the signal comes from the GPS, or -1 when it comes from a radio source, and 0 when invalid or no signal.

Third, use a 'debug' utility such as BlackBox3 (Robbie McElrath), LocalVarsLogger in XMLTOOLS (Tom Aguilo), or the XML Var debug utility from Doug Dawson's website. It is a tremendous help to see the value that A:Vars or L:Vars are actually returning as you create a gauge.

Bob
 
Last edited:
Hi Bob

Thank you I will download those and see if they help me. Although I did get the gauge wrong basically it only comes on and when locked on approach with autopilot however should deviate from the approach to much it will go out. So it is not just seeing if Nav 1 has Glide Slope I have gone through the SDK and cant see anything that resembles what this gauge is actually doing. I have put a a screen shot below so you can see it working in action it is just above the Artificial Horizon. So know I am at a bit of a loss second to last gauge made 35 of the things only to stumble on last two.

fVikIHR.png
 
Try using (A:HSI CDI needle, number) and/or (A:HSI GSI needle, number) together with (A:NAV1 HAS GLIDESLOPE, bool). When (A:HSI CDI needle, number) or (A:HSI GSI needle, number) exceed a certain value, the light goes off.
 
I use

Code:
      (A:NAV HAS GLIDE SLOPE:1,bool) -1 ==

and this works.

<!-- **** Macro Glideslope alive min 119 max 119 **** -->
-118 118 (L:HSI_GSI_NEEDLE,number) rng


<!-- **** Macro Localizer alive max 127 min 127 **** -->
-125 125 (L:HSI_CDI_NEEDLE,number) rng
 
I don't understand how he will use L: variables? The previous A: variable might work, though.
 
Ähh sorry:(
this an excerpt from a gauges.

Of course i meant the A: variable!!

Code:
(A:HSI CDI NEEDLE,number)

(A:HSI GSI NEEDLE,number)

Sorry again
 
Hi Matt,

Some additional comment, apart from that posted above by other people.

First off (assuming this aircraft uses the default FSX AP functions): FSX has NO direct A:var that indicates that the AP has actually intercepted/is-locked-onto the Glideslope.
Which is, I assume, the purpose of this gauge.
So a GlideSlope-Lock gauge can only be derived from the state/value of other A:var's.

Best bet is to test for the condition:
(A:HSI GSI NEEDLE VALID,bool) being True, AND (A:HSI GSI NEEDLE,number) staying within certain values (min. -119 to max. +119); so like between -40 and +40 or so.

That said:
The only other criterium I know of, that actually tells you that the FSX AP function intercepts/starts-to-follow the GlideSlope, is:
Assuming that you are doing an approach with (A:AUTOPILOT APPROACH HOLD,bool) On, and (A:AUTOPILOT ALTITUDE LOCK,bool) On (so you are flying on AP "into" the GlideSlope), is that the FSX AP will set (A:AUTOPILOT ALTITUDE LOCK,bool) to Off at the point where it intercepts the Glideslope.
But, again, this test is only usefull for the point-of-interception; to monitor if it holds the GlideSlope you have to build in a test on (A:HSI GSI NEEDLE,number) values.


Rob
 
Back
Top