Jump to content
Sign in to follow this  
Guest rpmc

Duplicate VORs in fs9gps search

Recommended Posts

Guest rpmc

Don't know what happened to the thread we had going, but to add a little to the fs9gps search topic...I made a few format discoveries that I hope lead to some progress. If the following is posted elsewhere in this forum, my apologies for not finding it. Here are some MS (ACES) fs9gps format examples of Region, Type, Ident, and the ACES version of Icao:It appears that the unique navaid identifier in the fs9gps database is the MS (ACES) format Icao string. The ambiguity I had in my search resulted from starting only with the navaid ident, which is not necessarily unique. I may be able to search by specifying the ACES Icao, which would be unique, if I know Region ahead of time. I'll work on that.Thank you to Ed (WarpD) and Roman (spokes2112) -- your suggestions in the previous thread gave me ideas of how to think about this.Rgds,Bob

Share this post


Link to post
Share on other sites

I was wondering where the other thread went myself.RegardsBob ScottColonel, USAF (ret)ATP IMEL Gulfstream II-III-IV-VColorado Springs, CO


Bob Scott | President and CEO, AVSIM Inc
ATP Gulfstream II-III-IV-V

System1 (P3Dv5/v4): i9-13900KS @ 6.0GHz, water 2x360mm, ASUS Z790 Hero, 32GB GSkill 7800MHz CAS36, ASUS RTX4090
Samsung 55" JS8500 4K TV@30Hz,
3x 2TB WD SN850X 1x 4TB Crucial P3 M.2 NVME SSD, EVGA 1600T2 PSU, 1.2Gbps internet
Fiber link to Yamaha RX-V467 Home Theater Receiver, Polk/Klipsch 6" bookshelf speakers, Polk 12" subwoofer, 12.9" iPad Pro
PFC yoke/throttle quad/pedals with custom Hall sensor retrofit, Thermaltake View 71 case, Stream Deck XL button box

Sys2 (MSFS/XPlane): i9-10900K @ 5.1GHz, 32GB 3600/15, nVidia RTX4090FE, Alienware AW3821DW 38" 21:9 GSync, EVGA 1000P2
Thrustmaster TCA Boeing Yoke, TCA Airbus Sidestick, 2x TCA Airbus Throttle quads, PFC Cirrus Pedals, Coolermaster HAF932 case

Portable Sys3 (P3Dv4/FSX/DCS): i9-9900K @ 5.0 Ghz, Noctua NH-D15, 32GB 3200/16, EVGA RTX3090, Dell S2417DG 24" GSync
Corsair RM850x PSU, TM TCA Officer Pack, Saitek combat pedals, TM Warthog HOTAS, Coolermaster HAF XB case

Share this post


Link to post
Share on other sites

Someone posted a spam message in the other thread... I have no idea why the entire thread was deleted for that.


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites
Guest rpmc

Hello Bob,I don't know if you saw my reply to your post on the previous thread before it disappeared, but I tried the pure trig approach to the HOLD navaid first. As well, Tom (taguilo) suggested a nav swapping solution, and you suggested yet another solution. Those posts are from Nov 2008 in this forum.I dug my heels in on the fs9gps database search just because I wanted to try to figure it out. I feel as if I made some progress (for me) by beginning to understand the format detail inside fs9gps. More trial and error to come, but I may figure it out eventually.Regards,Bob

Share this post


Link to post
Share on other sites

Bob, Sorry about the lateness, couldn't do anything on the computer for a week and a half. Anyhow SUCCESS! I hope. I wish there was a listing of duplicate stations.. Maybe I'll make some afcads with my own named duplicates.. Cannot do any more today though. It tested well with CVO. Anyway hope this helps.Roman PS I realize that this code can be "cleaned up" nicely but for easier understanding i left it with the simplest of coding.

<Macro Name="REQUEST"><!-- SAVE STATION IDENT BASED ON WHICH STATION TO HOLD -->(L:Kdi572_Hold, Number) 0 == if{ (A:Nav Ident:1, String) s18 } els{ (A:Nav Ident:2, String) s18 } 'V' (>C:fs9gps:IcaoSearchStartCursor) 31 (>C:fs9gps:enteringInput)<!-- ONLY DO THE FOLLOWING ON THE FIRST SEARCH --> (L:Kdi572_Test_Type, number) 0 == if{ 0 (>C:fs9gps:IcaoSearchMatchedIcao) }l18 (>C:fs9gps:IcaoSearchEnterChar)<!-- ONLY DO THE FOLLOWING IF THE FIRST SEARCH DID NOT MATCH STATION NAME IE CYCLE FOUND ICAOs-->(L:Kdi572_Test_Type, number) 2 == if{ (C:fs9gps:IcaoSearchMatchedIcao) ++ (C:fs9gps:IcaoSearchMatchedIcaosNumber) -- min (>C:fs9gps:IcaoSearchMatchedIcao) }<!-- TRANSFER ICAO TO WAYPOINT AND INITIATE STATION NAME TEST -->(C:fs9gps:IcaoSearchMatchedIcaosNumber) 0 > if{ (C:fs9gps:IcaoSearchCurrentIcao) (>C:fs9gps:WaypointVorICAO) 1 (>L:Kdi572_Test_Type, number) }   </Macro><Macro Name="TEST"><!-- SAVE STATION NAME BASED ON WHICH STATION TO HOLD -->(L:Kdi572_Hold, Number) 0 == if{ (A:NAV NAME:1, string) s18 } els{ (A:NAV NAME:2, string) s18 }<!-- COMPARE STATION NAME TO WAYPOINT NAME, IF NOT FOUND INITIATE A NEW REQUEST WITH A CYCLE OF SELECTED ICAO IE LOOP --> (C:fs9gps:WaypointVorName) l18 scmp 0 == if{ 1 (>L:Kdi572_Station_Found, Boo1) 0 (>L:Kdi572_Test_Type, number) } els{ 2 (>L:Kdi572_Test_Type, number) }</Macro><!-- THESE UPDATES ARE REQUIRED SINCE THE GPS NEEDS 1 CYCLE AFTER ICAO-->WAYPOINT TRANSFER BEFORE ABLE TO ACCESS WAYPOINT DATA --><Update>(L:Kdi572_Test_Type, number) 1 == if{ @TEST } els{ (L:Kdi572_Test_Type, number) 2 == if{ @REQUEST } } (>L:Kdi572_Station_Found, Bool) 0 != if{ 0 (>L:Kdi572_Station_Found, Bool) <!-- START DOING STUFF I.E. SAVE LAT/LON/ALT --> }</Update><!-- CHECK THAT STATIONS HAVE DME/RECEPTION BEFORE SEARCHING --><Area Name="DECREASEKNOB HOLD NAV2" Left="XX" Top="YY" Width="WW" Height="HH"><Cursor Type="DownArrow"/><Click>(A:Nav Has Dme:2, Bool) if{ 1 (>L:Kdi572_Hold, Number) @REQUEST }</Click></Area><Area Name="INCREASEKNOB HOLD NAV1" Left="XX" Top="YY" Width="WW" Height="HH"><Cursor Type="UpArrow"/><Click>(A:Nav Has Dme:1, Bool) if{ 0 (>L:Kdi572_Hold, Number) @REQUEST }</Click></Area>

Edited by spokes2112

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites
Guest rpmc

Roman,Thanks!! I can't wait to try this. You know, I have been trying to figure out how to weed out duplicate VOR matches for a little over a year... After a very quick read through your code, I see:

(L:Kdi572_Test_Type, number) 2 == if{ (C:fs9gps:IcaoSearchMatchedIcao) ++ (C:fs9gps:IcaoSearchMatchedIcaosNumber) -- min (>C:fs9gps:IcaoSearchMatchedIcao) }

I guess that is the part that increments the search ... this was something I was never going to figure out on my own, I'm afraid.Question ... is it imperative to include, 31 (>C:fs9gps:enteringInput) ? Too bad there is no documentation regarding these fs9gps functions (the @g functions)...Again, thanks so much!Regards,Bob

Share this post


Link to post
Share on other sites

Bob, Same here, over a year with the same problem..Yes, the code you listed is the increment of the found ICAOs. Yes it is imperative to include 31 (>C:fs9gps:enteringInput) it tells GPS that you're doing an Ident search, if it was 131 (>C:fs9gps:enteringInput) you would be doing a name search.The @g and @c functions are exactly the same. See lines 40 & 41 of the stock GPS530 code."Too bad there is no documentation regarding these functions fs9gps functions"I just check the stock GPS code, easier said than done though LOL!Happy testing,Roman


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites
Bob, Same here, over a year with the same problem..Yes, the code you listed is the increment of the found ICAOs. Yes it is imperative to include 31 (>C:fs9gps:enteringInput) it tells GPS that you're doing an Ident search, if it was 131 (>C:fs9gps:enteringInput) you would be doing a name search.The @g and @c functions are exactly the same. See lines 40 & 41 of the stock GPS530 code."Too bad there is no documentation regarding these functions fs9gps functions"I just check the stock GPS code, easier said than done though LOL!Happy testing,Roman
AHHH the thread has returnedI use(@c:IcaoSearchCursorPosition) 1 >= & (@c:IcaoSearchMatchedIcaosNumber) 2 >= & if{ open the display duplicate text page I posted in the first thread }Where (@c:IcaoSearchCursorPosition) 1 >= Checks if you put anything in the ICAO search field. (@c:IcaoSearchMatchedIcaosNumber) 2 >= Checks if there are more than one navaid with the same Ident and opens the page with using (@g:popupMenuMaxElements) to list them in the page code.

Paul EGLD

Share this post


Link to post
Share on other sites
Guest rpmc

Roman,I understand that @c and @g mean the same thing. I was referring to the function itself, such as enteringInput. There are over 80 used in the gps. I'm curious about these, that's all. I can see that many have names which are self explanatory, and I know there is no documentation provided by MS ... just lamenting...

Share this post


Link to post
Share on other sites

Bob, Sorry, may have misinterpreted the question about @C @G.. But anyway a very dim light just might have gone off...This is just a theory. 31 (>C:fs9gps:enteringInput) & 131 (>C:fs9gps:enteringInput) donot seem exactly what they are. More of a case of the following example from a project in VB2008 xpress.Length = LineOfText.IndexOf(";")ISpeed = LineOfText.Substring(0, Length)LineOfText = LineOfText.Remove(0, Length + 2)Where, according to your well made test chart..ICAO search = 31 = IndexOf 3 Start input @ 1NAME Search = 131 = IndexOf 13 Start input @ 1 - Name is suppressed unless called under WAYPOINTBecause after testing I found that a full ICAO in WAYPOINT including suppressed name equalsTRRIIIIIIIIIIIIINNNNNNNNNNNNNNNNT= TypeR= RegionI = IdentN = NameIt fits perfectly! now how to exploit 31 (>C:fs9gps:enteringInput) = IDENT SEARCHTRRIIIIIIIIIIIIINNNNNNNNNNNNNNNN123 <--- Shift __01 <--- Start indexequals 31131 (>C:fs9gps:enteringInput) = NAME SEARCHTRRIIIIIIIIIIIIINNNNNNNNNNNNNNNN1234567890123 <--- Shift____________01 <--- Start indexequals 131Can bet apples to apples that this is the reason. It fits a standard string workings, C++ too i bet. But the problem remains where(>C:fs9gps:IcaoSearchStartCursor) = 'V'What happens if if the input to START CURSOR = 'AVNWM' OR, AM I DIGGING A BIG HOLE?Anyhow - too much coffee equals bad coding LOL!BTW did any of the previous code work for you?PS my little chart doesn't fit due to the fonts.Roman


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites
Guest rpmc

Hi Roman,Your last post is very interesting. A little more about the gps module comes into focus for me.Actually, I have not yet tried your duplicate search solution. Instead, I spent some time working on a utility that generates xml code to display gps.dll information while flying.It is called GPS Viewer 1.0 Beta.xls and is uploaded to the FS9/2004 Utilities section of AVSIM files.

GPS Viewer 1.0 BetaA companion to BlackBox2, GPS Viewer is a simple utility that generates xml code to display selected Microsoft Flight Simulator GPS variables while flying. It does not create a stand-alone gauge. Instead, the generated code must be pasted into the xml code of a host gauge that communicates with the gps.dll module.GPS Viewer generates xml code in either FS9 or ACES format, and can be used with either FS9 / 2004 or FSX. It is a Microsoft Excel 2003 application that contains macros to drive Excel User Forms. It requires the fixed-width font, Courier New, which should be standard in a Windows installation. Follow directions on the Instructions worksheet.
I learn about MSFS gauge development by participating in this forum and by experimentation. The BlackBox and GPS Viewer utilities help with the experimentation. Please feel free to let me know what you think about GPS Viewer.Now, I am about ready to turn attention back to the KDI572 and your gps search solution.Sawasdee Pi Mai, Selamat Tahun Baru (Happy New Year),Bob

Share this post


Link to post
Share on other sites
Guest rpmc

I think I finally have a solution. Thanks to all who helped steer me in the right direction - I have been stumped by this for a long time. Roman's last post which helped me understand @c:IcaoSearchMatchedIcao was key. Now after working through cycle timing issues, I have code that appears to work although I'm sure it is not the most efficient way to do it.

<Gauge Name="KDI 572 rpmc" Version="4.1"><Image Name="KDI572 OFF.bmp" ImageSizes="300,117"/>	<Macro Name="c">C:fs9gps</Macro>	<Macro Name="g">C:fs9gps</Macro>				<Macro Name="SearchICAO">			0 (>L:ICAO Found,number) 			'V' (>@c:IcaoSearchStartCursor) 			<!-- 31 (>@g:enteringInput) -->			0 (>@c:IcaoSearchMatchedIcao) 						(L:HoldingNav,number) 1 == 				if{ 					(A:NAV1 Ident,string) (>C:fs9gps:IcaoSearchEnterChar) 							(A:NAV1 ACTIVE FREQUENCY, hz) (>L:HoldingFrequency, hz)				} 			(L:HoldingNav,number) 2 == 					if{ 									(A:NAV2 Ident,string) (>C:fs9gps:IcaoSearchEnterChar)			  					(A:NAV2 ACTIVE FREQUENCY, hz) (>L:HoldingFrequency, hz)									} 									(@c:IcaoSearchMatchedIcaosNumber, enum) 0 >  				if{ 					(@c:IcaoSearchCurrentIcao) (>@c:WaypointVorICAO) 						(@c:WaypointVORFrequency, hz) (L:HoldingFrequency, hz) == if{ 1 (>L:FrequencyMatch, bool) } els{ 0 (>L:FrequencyMatch, bool) } 					1 (>L:ICAO Found,number)				} 				els{ 0 (>L:ICAO Found,number) } 									</Macro>			<Macro Name="RetrieveVOR">		  			(@c:WaypointVorLatitude,degrees) (>@c:GeoCalcLatitude2,degrees)			(@c:WaypointVorLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)			(@c:WaypointVorElevation,nmiles) (>L:My_VOR_Elev,number)			</Macro>		<Macro Name="IterateSearch">			(>@c:IcaoSearchMatchedIcao, enum) ++ (>@c:IcaoSearchMatchedIcao, enum)			(@c:IcaoSearchCurrentIcao) (>@c:WaypointVorICAO) 			(@c:WaypointVORFrequency, hz) (L:HoldingFrequency, hz) == if{ 1 (>L:FrequencyMatch, bool) } els{ 0 (>L:FrequencyMatch, bool) }			</Macro><Update>		(L:HoldVORChanged,bool) 1 == 			if{ 						(L:HoldVORCycleCounter,number) ++ (>L:HoldVORCycleCounter,number)								<!-- The initial search.  Three cycles duration -->				(L:HoldVORCycleCounter,number) 4 <				if{ 					@SearchICAO 					(L:ICAO Found,number) 1 == 						if{ 							2 (>L:ICAO Found,number) 						} 				}								<!-- Increment @c:IcaoSearchMatchedIcao if frequency was not matched.  Do this after Initial Search (which is limited to 3 cycles) -->				(L:HoldVORCycleCounter,number) 4 >= 				if{ 					(L:FrequencyMatch, bool) 0 ==   						if{ 							@IterateSearch							(L:ICAO Found,number) 1 == 								if{ 									2 (>L:ICAO Found,number) 								} 						}										}								<!-- Retrieve Waypoint VOR Lat, Lon and Elev -->				(L:ICAO Found,number) 2 == 					if{ 						@RetrieveVOR 					} 							}						<!-- Reset HOLDVORChanged and Cycle Counter -->			(L:HoldVORCycleCounter,number) 6 > 			if{ 				0 (>L:HoldVORChanged,bool) 				0 (>L:HoldVORCycleCounter,number) 			}				(A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees)	(A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees)			(A:PLANE ALTITUDE,nmiles) (L:My_VOR_Elev,number) - (>L:AltAboveMyVOR,number)			(@c:GeoCalcDistance,nmiles) sqr (L:AltAboveMyVOR,number) sqr + sqrt (>G:Var4)	<!-- KNOTS and MIN to HOLDING VOR -->	<!-- GVar3 is a timer/counter -->	<!-- (L:HoldVORDistance, number) = G:Var4 -->	<!-- (L:HoldVORDistance_old, number) = G:Var5 -->	<!-- (L:HoldVORSpeed, number) is G:Var6 -->	<!-- (L:HoldVORTime, number) is G:Var7 -->	0 54 (G:Var3) rng if{ (G:Var3) ++ (>G:Var3) } els{ 0 (>G:Var3) } 	(G:Var3) 0 == if{ (G:Var4) (>G:Var5) } 	(G:Var3) 54 == 			if{ 			   (G:Var4) (G:Var5) - abs 1200 * (>G:Var6) 			   			   (G:Var4) (G:Var6) / 60 * near 99 min (>G:Var7) 			}			</Update>

Now, the ICAO search has found the Corvallis VOR with ident CVO and frequency 115.4 MHz, not the one in Cairo, Eqypt (CVO, 115.2 MHz). Note that my code presumes that within the fs9gps module, there are no duplicates of both ident and frequency ......Bob

Share this post


Link to post
Share on other sites

Hi BobI got your code working good. I never used this DME type before, I think it holds the last selected fequency distance from 1 or 2 in the HD position allowing the use of the nav 1 and 2 for other things. So in fact you have 3 nav. channels is this correct?


Paul EGLD

Share this post


Link to post
Share on other sites

Yes, But for this app we're using it for a 3rd DME, used on the Bendix/King KDI 572 as DME hold. I am sure that it could be used as a full NAV 3 Reciever (Hold). That would require a whole bunch more of coding, displaying it on a HSI/VOR indicator may be a daunting task but I still believe it could be done.Roman


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

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