Jump to content
Sign in to follow this  
Slammer

DME to active ILS/LOC freq

Recommended Posts

Hello all,

 

I want to show DME to active ILS/LOC freq. I've read a few posts concerning this subject, but all are in C++. Does anybody have the solution in XML. I've tried with NearestVorCurrentDistance which works but the problem is that there are to many airfields in the direct vicinity so DME goes bazerk.

 

Thanks in advance for helping me out.

 

Slammer

Share this post


Link to post
Share on other sites

It's an untried suggestion, but couldn't you test NAV HAS LOCALIZER:index and NAV HAS LOCALIZER:index to check that it's an ILS and has DME before getting the distance from NAV DME:index ?

Share this post


Link to post
Share on other sites

mgh,

 

Thanks for your quick reply, but how should i do this. Don't know how to get the result out of the database.

 

Slammer

Share this post


Link to post
Share on other sites

Maybe its possible with the database from Bob McElrath because lat/lon of the ILS should be somewhere in here. Then do a calculation via GeoCalc, but how?

Share this post


Link to post
Share on other sites

Thanks for your quick reply, but how should i do this. Don't know how to get the result out of the database.

 

Again unchecked and untested, but something like

 

(A:NAV HAS LOCALIZER:index, Bool) (A:NAV HAS DME:index, Bool) and
 if{ (A:NAV DME:index, Nautical Miles ) (> L:MyDMEDistance, Number) }

 

should save DME distance in ( L:MyDMEDistance, Number) where index is 1 or 2 depending on whether NAV1 or NAV2 is the active frequency,

 

E&OE

Share this post


Link to post
Share on other sites

Maybe its possible with the database from Bob McElrath because lat/lon of the ILS should be somewhere in here. Then do a calculation via GeoCalc, but how?

 

Firstly, I would do what mgh has posted above. In my opinion, it's the logical, simplest approach, and correct for this situation, and mgh is an expert so always take his advice :good: .

 

Beyond that, sure, it is possible to retrieve the lat/lon of any single point facility in the gps database, and knowing that, compute the map distance from aircraft to the facility using GeoCalcDistance.

 

If you want to know the lat/lon of the active ILS, then here is one approach:

  • You know the Ident of the active ILS – it is an A:Var, A:NAV IDENT:index
  • Set up an ICAO search of that Ident to retrieve its 12 character ICAO id.
  • ICAO transfer into the WaypointVOR group to get WaypointVOR Latitude and Longitude
  • Use GeoCalcDistance to determine map distance where GeoCalcLatitude1 / Longitude1 is A:PLANE LATITUDE, A:PLANE LONGITUDE, and GeoCalcLatitude2 / Longitude2 is the WaypointVOR lat/lon.

How to do an ICAO search and ICAO transfer is discussed in the guidebook. It is possible that there are duplicate ILS idents in the database (there certainly are many examples of duplicate VOR idents) in which case you need to resolve multiple ICAO search matches. One way to do this is covered on pages 34-36 of the guidebook. As a suggestion, set L:NumberOfCyclesToSkip to minimum of 3.

 

Lastly, GeoCalcDistance is a horizontal map distance, not slant line like DME distance. So to be more accurate, take into account the difference between WaypointVORElevation and the aircraft altitude using Pythagorean Theorem.

 

You can search this forum for KDI572, or Third Nav for more discussion. Creating a KDI572 gauge for FS requires the approach above to get the DME for the HOLD VOR.

 

Although the XML code is not lengthy, in my opinion finding lat/lon and DME distance of a VOR in the database is a rather advanced gps topic as it involves understanding ICAO search, ICAO transfer, cycle skipping and resolving multiple ICAO matches. But once you understand this, you can do quite a lot with the gps module.

 

Regards,

 

Bob

Share this post


Link to post
Share on other sites

Try to use the AFCAD 2.21 to insert a LOC+GP+DME . Another try should be to read by the AFCAD2.21 the coordinates of LOC and insert in the same position a DME Regards G.Franco

Share this post


Link to post
Share on other sites

mgh is an expert so always take his advice

 

Kind of you to say so but there those here who know far more than me about gauges than I do.

Share this post


Link to post
Share on other sites

Mgh & Bob,

 

Both thanks for your replies! I'm having trouble to implement Mgh's statement. I'm probably doing the wrong things at the wrong places. The way i implemented it, it returns 000 on the DME. Here are two codes. The first code gives DME to the NearestVorCurrentDistance which works but as i said before, it switches DME readings of nearby facilities. The second code is mgh his code but returns 000 on the DME.

 

//-----
 <Element>
   <!--Visible>(A:NAV1 HAS DME, bool) (L:Steering Control, enum) 0 == &&</Visible-->
   <Visible>(A:NAV1 HAS DME, bool) (L:AVCS-UFC,bool) 1 == & (L:HSI-MODE,enum) 3 == (L:ILS Switch, bool) 0 == &&</Visible>
   <Position X="13" Y="6"/>
   <Text Bright="Yes" X="62" Y="20" Length="8" Font="arialbold" Color="#010101" Adjust="Left" VerticalAdjust="Center" Multiline="No" Fixed="No">
 <String>%((A:NAV HAS LOCALIZER) (A:HSI DISTANCE, nmiles))%{if}%((C:fs9gps:NearestVorCurrentDistance, nmiles))%!05.1f!%{else}%((A:NAV1 DME, nmiles))%!05.1f!%</String>
   </Text>
  </Element>

 

Second code:

 

 <Element>
   <Visible>(A:NAV1 HAS DME, bool) (L:AVCS-UFC,bool) 1 == & (L:HSI-MODE,enum) 3 == (L:ILS Switch, bool) 0 == &&</Visible>
   <Position X="100" Y="150"/>
   <Text X="62" Y="18" Bright="Yes" Length="7" Font="arial" Color="#ffffff" Adjust="Left" VerticalAdjust="Center" Multiline="No" Fixed="No">
 <String>%((A:NAV HAS LOCALIZER:1, Bool) (A:NAV HAS DME:1, Bool) and
	 if{ (A:NAV DME:1, nmiles) (> L:MyDMEDistance, Number) } (L:MyDMEDistance, Number))%!03d!</String>
   </Text>
  </Element>

 

Question is: is this the correct place to put mgh's code or should it be in a value, macro, string or other statement. Sorry for not quit understanding what you ment.

 

Slammer

Share this post


Link to post
Share on other sites

<Element>
<Visible>(A:NAV1 HAS DME, bool) (L:AVCS-UFC,bool) 1 == & (L:HSI-MODE,enum) 3 == (L:ILS Switch, bool) 0 == &&</Visible>
<Position X="100" Y="150"/>
<Text X="62" Y="18" Bright="Yes" Length="7" Font="arial" Color="#ffffff" Adjust="Left" VerticalAdjust="Center" Multiline="No" Fixed="No">
 <String>%((A:NAV HAS LOCALIZER:1, Bool) (A:NAV HAS DME:1, Bool) and
	 if{ (A:NAV DME:1, nmiles) (> L:MyDMEDistance, Number) } (L:MyDMEDistance, Number))%!03d!</String>
</Text>
</Element>

 

Question is: is this the correct place to put mgh's code or should it be in a value, macro, string or other statement. Sorry for not quit understanding what you ment.

 

Slammer

 

You can do this in a string and the second code version is the one you want, not NearestVorCurrentDistance.

 

You probably just have a syntax issue. The indexing syntax could be incorrect (you are using FSX?) and maybe also the conditional statement syntax within the <String>. I would need to play around with it to be sure. If Bill or Jan or others read this, then they will set you straight.

 

As well, you will not need to store A:NAV DME into an L:Var and then display the L:Var ... just display A:NAV DME.

 

Bob

Share this post


Link to post
Share on other sites

May be too much space

 

<String>........

if{ (A:NAV DME:1, nmiles) (> L:MyDMEDistance, Number) } (L:MyDMEDistance, Number))%!03d!</String>

 

Should be:

..............(>L:MyDMEDistance,number)....or

..............(>L:MyDMEDistance,number)... ?

 

and i advice to use formattedtext.

Share this post


Link to post
Share on other sites

(A:NAV DME:index, Nautical Miles) returns the DME distance of the navaid selected by NAVindex if it has a DME and 0 otherwise.

 

(A:NAV HAS LOCALIZER:index, Bool) returns 1 if that navaid has a localizer and 0 otherwise. Testing for a localizer is sufficient to find if the navaid's an ILS - I know of any glide-slop[e only ILS.

 

The problem is that ((A:NAV HAS DME:index, Bool )returns -1 if that navaid has a DME and 0 otherwise.

Share this post


Link to post
Share on other sites

(A:NAV DME:index, Nautical Miles) returns the DME distance of the navaid selected by NAVindex if it has a DME and 0 otherwise.

 

(A:NAV HAS LOCALIZER:index, Bool) returns 1 if that navaid has a localizer and 0 otherwise. Testing for a localizer is sufficient to find if the navaid's an ILS - I know of any glide-slop[e only ILS.

 

The problem is that ((A:NAV HAS DME:index, Bool )returns -1 if that navaid has a DME and 0 otherwise.

 

That is the simplest way and should work Ok.

 

For example:

 

(A:NAV HAS LOCALIZER:n], Bool) (A:NAV HAS DME:n, Bool) abs and
if{ (A:NAV DME:n, Nautical Miles) -> to any LVar }

 

abs -> Should work without this operator as well, because testing (A:NAV HAS DME:index, Bool) only will give true even though it returns -1

In FSX scripts, any value >= 1 and <= -1 is considered TRUE in the evaluations.

 

Tom

Share this post


Link to post
Share on other sites

All who have replied,

 

Thank you very much helping me out, it works fine only not all ILS frequencies are recognized. For instance 108.55 SBO (ILS27 Soesterberg, the Netherlands) works fine but 110.75 VLO (ILS24 Volkel, the Netherlands) is not recognized. Maybe this is due to the Scenery (NL2000).

 

Thanks again, a happy Slammer

Share this post


Link to post
Share on other sites

VLO gives a DME range with the default scenery.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...