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

FS2004 Hsi_signal_localiser

Messages
517
Country
austria
I'm playing around with the good old RP B727 panel.
Thanks to Richard he gave us the C-code.

I found "loc_true_var = {HSI_SIGNAL_LOCALISER};"
which is used for starting the GS.

I looked for a var-name in XML and didn't find anything.
Does someone something know??

Thanks!

Edi
 
Bill, thanks.

All this vars in my testgauge

Code:
      %A:HSI SIGNAL LOCALISER,num\t%((A:HSI SIGNAL LOCALISER,number))%!6.2f!\n   <!-- what is going on -->

      %A:HSI HAS LOCALISER,num\t%((A:HSI HAS LOCALIZER,number))%!6.2f!\n

      %A:AUTOPILOT MASTER,bool\t%((A:AUTOPILOT MASTER,bool))%!6.2f!\n
      %A:AUTOPILOT THROTTLE ARM,bool\t%((A:AUTOPILOT THROTTLE ARM,bool))%!6.2f!\n
      %\n
      %A:AUTOPILOT VERTICAL HOLD VAR,ft/min\t%((A:AUTOPILOT VERTICAL HOLD VAR,feet/minute))%!6.2f!\n
      %A:AUTOPILOT VERTICAL HOLD,bool\t%((A:AUTOPILOT VERTICAL HOLD,bool))%!6.2f!\n
      %A:AUTOPILOT ALTITUDE LOCK,bool\t%((A:AUTOPILOT ALTITUDE LOCK,bool))%!6.2f!\n
      %A:AUTOPILOT ALTITUDE LOCK VAR,ft\t%((A:AUTOPILOT ALTITUDE LOCK VAR,feet))%!6.2f!\n
      %A:AUTOPILOT ALTITUDE HOLD,bool\t%((A:AUTOPILOT ALTITUDE HOLD,bool))%!6.2f!\n
      %\n
      %A:VERTICAL SPEED,ft/min\t%((A:VERTICAL SPEED,feet/minute))%!6.2f!\n
      %\n
      %A:AUTOPILOT HEADING LOCK DIR,degree\t%((A:AUTOPILOT HEADING LOCK DIR,degree))%!6.2f!\n
      %A:AUTOPILOT HEADING LOCK,bool\t%((A:AUTOPILOT HEADING LOCK,bool))%!6.2f!\n
      %\n
      %A:AUTOPILOT NAV1 LOCK,bool\t%((A:AUTOPILOT NAV1 LOCK,bool))%!6.2f!\n
      %\n

      %A:AUTOPILOT APPROACH HOLD,bool\t%((A:AUTOPILOT APPROACH HOLD,bool))%!6.2f!\n
      %\n

      %A:HSI TF FLAGS,num\t%((A:HSI TF FLAGS,number))%!6.2f!\n
      %A:HSI GSI NEEDLE VALID,bool\t%((A:HSI GSI NEEDLE VALID,bool))%!6.2f!\n
      %A:HSI GSI NEEDLE,number\t%((A:HSI GSI NEEDLE,number))%!6.2f!\n
      %A:HSI CDI NEEDLE,num\t%((A:HSI CDI needle,number))%!6.2f!\n
      %\n
      %A:NAV1 SIGNAL,num\t%((A:NAV1 SIGNAL,number))%!6.2f!\n
      %A:NAV1 HAS GLIDE SLOPE,num\t%((A:NAV1 HAS GLIDE SLOPE,number))%!6.2f!\n
      %A:NAV HAS LOCALIZER:1,bool\t%((A:NAV HAS LOCALIZER:1,bool))%!6.2f!\n

And here the part of the c-gauges by RP

Code:
if(gs_flag_var.var_value.n == 1 && avionics_voltage_var.var_value.n > 0 &&
    loc_true_var.var_value.n)  // is g/s valid?
    {
    if(gs_needle_var.var_value.n > -1 && !ApGsCaptured)
      {	
      if(ApAltHoldSwitch)
        {
        ApAltHoldSwitch = FALSE;
        }
      if(alt_hold_var.var_value.n)
        {
         trigger_key_event(KEY_AP_ALT_HOLD_OFF, 0);
        }
      if(!ApGsCaptured)
        {
        ApGsCaptured = TRUE;// turn on green APD light
        ApPitchSet = -770; // set - 770 FPM to start
        }
      }
    }

And
Code:
loc_true_var = {HSI_SIGNAL_LOCALISER};

loc_true_var.var_value.n
are the "funny" things.

"loc_true_var.var_value.n" is also used in his RMI and HSI.

The difference can be seen at GS capture.

Edi
 
HSI_SIGNAL_LOCALISER is a valid C variable for FS. It is probably the same as HSI CDI NEEDLE VALID in XML.
 
I added this var

HSI CDI NEEDLE VALID

to my testgauge.
It shows always -1.:confused:

In Richard's c++ gauge it is listed following
Code:
//RADIO & GPS NAVIGATION
MODULE_VAR		gs_needle_var = {VOR1_GS_NEEDLE};
MODULE_VAR		vor1_signal_var = {VOR1_SIGNAL_STRENGTH};
MODULE_VAR		vor2_signal_var = {VOR2_SIGNAL_STRENGTH};
MODULE_VAR		vor1_needle_var = {VOR1_NEEDLE};
MODULE_VAR		vor1_course_var = {VOR1_OBI};
MODULE_VAR		vor2_course_var = {VOR2_OBI};
MODULE_VAR		vor_radial_var = {NAV1_VOR_RADIAL};
MODULE_VAR		tf_var = {VOR1_TF_FLAG};
MODULE_VAR		loc_true_var = {HSI_SIGNAL_LOCALISER};
MODULE_VAR		adf_needle_var = {ADF_NEEDLE};
MODULE_VAR		adf_freq_var = {ADF_FREQUENCY};

and so on....

So let's talk about SDk....:eek:

Edi
 
The advantage of

"loc_true_var = {HSI_SIGNAL_LOCALISER};" is,

that it tells me whether i'm above or below the GS before

(A:HSI GSI NEEDLE,number) becomes activ.

So i'm able to capture the GS from above.
Richard programed it very nice!!

But in reality is a Sperry 77 able to do so??

Edi
 
I added this var

HSI CDI NEEDLE VALID

to my testgauge.
It shows always -1.:confused:

Yes, will always show -1 when a valid signal is returned from a VOR/ILS station, and 0 when is not.

It seems that Richard's code first tested for a valid LOC signal before resolving the GS status.

Actually C++ token vars and XML Avars are not the same, even though some of them share their meanings. Thus A:HSI SIGNAL LOCALISER does not exist, for example.

Tom
 
The advantage of

"loc_true_var = {HSI_SIGNAL_LOCALISER};" is,

that it tells me whether i'm above or below the GS before

(A:HSI GSI NEEDLE,number) becomes activ.

So i'm able to capture the GS from above.
Richard programed it very nice!!

But in reality is a Sperry 77 able to do so??

Edi

Actually it tells you that a LOC valid signal is being received.
And yes, the code commands a pitch down to try capturing the GS from above. I guess there must be another code section that enables the APP full mode.
(btw this if(!ApGsCaptured) evaluation line is redundant)

Tom
 
Tom,

A:HSI SIGNAL LOCALISER was just an idea!
I hoped someone knew the proper name!

But meantime i looked into the SDK.
So (A:NAV GLIDE SLOPE ERROR:1,degree) could help me.
"-" is above, "+" below the GS.
And (A:HSI DISTANCE,nmiles) defines a limited area.

{HSI_SIGNAL_LOCALISER} becomes true, if i'm near the ILS and above or on the GS.

Edi
 
{HSI_SIGNAL_LOCALISER} becomes true, if i'm near the ILS and above or on the GS.

Ok, but probably is valid only for that C token var. The A:HSI CDI NEEDLE VALID xml var has a different behaviour, not strictly related to a presence of a glideslope signal.

Tom
 
What would we do without FS????
We would be bored, we would trink too much beer, we would sleep too much...

My ILS looks to South, my plane is 17 nm away in the western of the airport and i can capture the GS.
Does this make sense???? NO!!

So let me programme it new.
There are enough vars!
Code:
      %A:NAV1 SIGNAL,num\t%((A:NAV1 SIGNAL,number))%!6.2f!\n
      %A:NAV1 HAS GLIDE SLOPE,num\t%((A:NAV1 HAS GLIDE SLOPE,number))%!6.2f!\n
      %A:NAV HAS LOCALIZER:1,bool\t%((A:NAV HAS LOCALIZER:1,bool))%!6.2f!\n
      %A:NAV RADIAL:1,degree\t%((A:NAV RADIAL:1,degree))%!6.2f!\n
      %A:NAV RADIAL ERROR:1,degree\t%((A:NAV RADIAL ERROR:1,degree))%!6.2f!\n
      %A:NAV GLIDE SLOPE ERROR:1,degree\t%((A:NAV GLIDE SLOPE ERROR:1,degree))%!6.2f!\n
      %A:HSI DISTANCE,nmiles\t%((A:HSI DISTANCE,nmiles))%!6.2f!\n

Thanks for your support!

Edi
 
I am concerned that perhaps you are not understanding what his code is trying to accomplish with the variables it is using... so, here's some pseudo-code to hopefully explain it:

Code:
if(we_have_a_glideslope_on_localizer && avionics_is_powered &&
    we_have_a_localizer_signal)  // is g/s valid?
    {
    if(glideslope_needle_value > -1 && have_not_captured_yet)
      {	
      if(holding_current_altitude)
        {
        holding_current_altitude = FALSE;
        }
      if(fs_holding_current_altitude)
        {
         tell_fs_to_stop_holding_current_altitude;
        }
      if(have_not_captured_yet)
        {
        have_not_captured_yet = FALSE;
        initial_vertical_speed = -770;
        }
      }
    }
What that does (code-wise) is ensure you don't attempt to capture the glideslope until
  1. You have captured the localizer
  2. Your localizer actually has a glideslope
  3. Your glideslope needle is "active"
 
Warp,
don't be concerned;)
I totally understand the code:D

But if as stated above your ILS looks to the southern and your plane are a few miles western from the airport and your nose and even the nose of the plane doesn't look to the airport.
So i think you wouldn't be able to capture a GS.
So what is wrong! The logic!
So what can be done?
There is an AP_APPROACH var. Forgotten to test it.
I was to fixed an the code! The GS capture from above tge GS was so nice!

Otherwise there some vars mentioned above to make sure that you are in the area of the ILS antenna.

Conclusion:
First think, then programe!

btw, has someone a description of an Sperry 77.

regards
Edi

PS
{HSI_SIGNAL_LOCALISER} becomes true, if i'm near the ILS and above or on the GS.

"we_have_a_localizer_signal" is different
 
Last edited:
PS
{HSI_SIGNAL_LOCALISER} becomes true, if i'm near the ILS and above or on the GS.

"we_have_a_localizer_signal" is different

Edi,

What Ed stated is true, {HSI_SIGNAL_LOCALISER} means like "we_have_a_localizer_signal"; it is related only to the presence of a LOC signal only, with or without a GS involved. I understand gs_flag_var.var_value.n checks for the presence of a glideslope signal, so the need to test for both vars to be true.

Tom
 
Tom,
i wasted 2 days to understand what's going on. It was a little bit frustrating.
So i know i'm right;)
Try the RP727 - Panel!
But my logic was totally wrong!!

But that's no longer important!!
I mentioned above already:
My ILS beam is 180 degree, my plane is in 270 degree a few miles away from the airport.
So its impossible to get a GS information on the HSI, RMI or ADI and im not able to captured
a GS per AP. It's a sperry 77.
So the logic of some gauges are wrong. I have to check at first whether i'm in the area of the ILS antenna.

Code:
<!-- Start GS Check -->
      (A:NAV RADIAL ERROR:1,degree) abs 8 &gt;
      (A:NAV1 SIGNAL,number) 0 ==
      ||
      (A:HSI GSI NEEDLE VALID,bool) !
      ||
      (A:NAV1 HAS GLIDE SLOPE,number) -1 !=
      ||
      if{
        1 (&gt;L:AP_GS_Auto_Captured,number)  <!-- armed -->
        quit
        }

<!-- GS captured -->
      2 (&gt;L:AP_GS_Auto_Captured,number)  <!-- captured -->

      (L:AP_Alt_Hold_SW,bool)
      if{
        0 (&gt;L:AP_Alt_Hold_SW,bool)
        1 (&gt;L:DSD_TECH_Toggle_Sw_SD,number)
        }

      (A:AUTOPILOT ALTITUDE HOLD,bool)
      if{
        (&gt;K:AP_ALT_HOLD_OFF)
        }

     (A:AUTOPILOT APPROACH HOLD,bool) !
      if{
         (&gt;K:AP_APR_HOLD_ON)      <!-- Turns both AP localizer and glide-slope modes on/armed -->        
        }

This check will be done with
Code:
      (A:NAV RADIAL ERROR:1,degree) abs 8 &gt;

After the capture it's up to you what happend. You only should be in the ILS area.
The code is not tested! So it's a matter of change.

I hope my writing is clear.

Regards
Edi

i'm old fashioned. So you will find &gt; &amp;&amp; and so one..
 
For the record, the Sperry 77 is a very, very primitive autopilot. Don't spend too much time trying to get fancy... :D
 
Yes, but they are "paired" frequencies, meaning that if you tune the localizer frequency on your nav radio, the glideslope frequency is automatically tuned to the correct frequency. :D
 
Back
Top