November 13, 200817 yr Maybe try this because I believe in previous testing that when querying the GPS it must be done in the same gauge read so change # #(L:Async,bool) #if{ #(@c:WaypointVorElevation,feet) (>L:My_VOR_Elev,feet) #(@c:WaypointVorLatitude,radians) (>L:My_VOR_Lat,radians) #(@c:WaypointVorLongitude,radians) (>L:My_VOR_Lon,radians) #0 (>L:Async,bool) #}#Change to - (L:Async,bool) 1 ==if{ 0 (A:NAV1 IDENT,string) (A:NAV2 IDENT,string) 3 (L:HoldingNav,number) case (>@c:WaypointVorICAO) (@c:WaypointVorElevation,feet) (>L:My_VOR_Elev,feet) (@c:WaypointVorLatitude,radians) (>L:My_VOR_Lat,radians) (@c:WaypointVorLongitude,radians) (>L:My_VOR_Lon,radians) 0 (>L:Async,bool) }And change mouse to this -(L:TestGPSKnob,number) -- 0 max (>L:TestGPSKnob,number) (L:TestGPSKnob,number) 2 == if{ 2 (>L:HoldingNav,number) 1 (>L:Async,bool) } (L:TestGPSKnob,number) ++ 3 min (>L:TestGPSKnob,number) (L:TestGPSKnob,number) 2 == if{ 1 (>L:HoldingNav,number) 1 (>L:Async,bool) } Doing this will do the full query / store on the "next" gauge read only and only once. The problem remains if there are more than 1 of the same VOR idents.. Even if it does work ????? Good luckRomanProud "TEAM AVSIM" RTW race member. FS RTWR SHRS F-111 JoinFS Little Navmap
November 13, 200817 yr DISREGARD ABOVE POST !!! I remember now how to get data from GPS, you cannot directly set (>@c:WaypointVorICAO) because it's not a string that is readable but more so a hashcode or database ID designator ( contains facility areas and such), the reason is there could be more than one. The only way is through "NameSearch", "IcaoSearch" or "Nearest",(just like using the GPS) then select the correct one to send to (>@c:WaypointVorICAO). Then you can get the data.Working on an example now using the "Nearest" way. Roman FS RTWR SHRS F-111 JoinFS Little Navmap
November 13, 200817 yr This works --- EXCEPT it will only pick up VORs no ILSs, didn't try TACANs or DMEs. The ICAO search solution would be the best way as ILSs are included ( will work on it ). Caution!!! The display elements are different than yours.C:fs9gps 0 (>G:Var1) 0 (>G:Var2) 0 (>L:My_VOR_Lat,radians) 0 (>L:My_VOR_Lon,radians) 0 (>L:My_VOR_Elev,feet)(A:GPS POSITION LAT, Radians) (>@c:NearestVorCurrentLatitude, Radians) (A:GPS POSITION LON, Radians) (>@c:NearestVorCurrentLongitude, Radians) 289 (>@c:NearestVorMaximumDistance, NMiles) 150 (>@c:NearestVorMaximumItems) @nearestVor (@c:NearestVorItemsNumber) 0 != if{ (G:Var1) (>@c:NearestVorCurrentLine) (@c:NearestVorCurrentICAO) (>@c:WaypointVorICAO) 1 (>G:Var2) @identVor } els{ @reset } 0 (>G:Var2) (G:Var1) ++ s1 (>G:Var1) l1 (@c:NearestVorItemsNumber) 1 - > if{ @reset }(@c:WaypointVorIdent) slen 0 != (G:Var2) 1 == and if{ (L:HoldingNav,number) 1 == if{ (A:NAV1 IDENT,String) } els{ (A:NAV2 IDENT,String) } (@c:WaypointVorIdent) scmp 0 == if{ @set } els{ @increment } }0 (>L:Async,bool) 0 (>G:Var1) 0 (>G:Var2) (@c:WaypointVorLatitude, radians) (>L:My_VOR_Lat,radians) (@c:WaypointVorLongitude, radians) (>L:My_VOR_Lon,radians) (@c:WaypointVorElevation, feet) (>L:My_VOR_Elev,feet)(L:Async,bool) if{ @initialSearch }(L:TestGPSKnob,number) 0 !=Ident = %((C:fs9gps:WaypointVorIdent) )%!s!Lon. = %((L:My_VOR_Lon,radians) )%!9.6f!Lat. = %((L:My_VOR_Lat,radians) )%!9.6f!Alt. = %((L:My_VOR_Elev,feet) )%!9.2f!(L:TestGPSKnob,number) -- 0 max (>L:TestGPSKnob,number) (L:TestGPSKnob,number) 2 == if{ 2 (>L:HoldingNav,number) 1 (>L:Async,bool) } (L:TestGPSKnob,number) ++ 3 min (>L:TestGPSKnob,number) (L:TestGPSKnob,number) 2 == if{ 1 (>L:HoldingNav,number) 1 (>L:Async,bool) } Roman FS RTWR SHRS F-111 JoinFS Little Navmap
November 14, 200817 yr Oh. I think I know what's wrong...Roman,I copied your VORRetrieveTEST gauge into my aircraft. No success. I just get null values, the same result I have been getting for months each and every time I attempt gps associated code. Frustrating as h___.You said your code works and I believed you. So, I put your gauge in the default Baron, and... well, now both of us know your code works just fine...The difference? Maybe it's this: I have Reality-XP GNS 530 & 430 (FS9 vintage) installed in my a/c and I'd guess that the MSFS gps.dll is either deactivated when using these RXP gauges, or the RXP configuration needs editing to make the gps code work.I don't know, but I'll search through the SimForums RXP site to see if there is anything to learn there.Thanks a million for the help. I really appreciate it.BobTom: thanks very, very much for your assistance, too. Looks like your Nav swapping has always been the right solution for the DME HOLD problem!!
November 16, 200817 yr All:Apologies for the false alarm. There appears to be no conflict with RXP GNS gauges.Roman's code works, but in my a/c there must be another issue that I'll need to track down.
November 16, 200817 yr Still working on a more efficient way to do it and include ILS/DME (fingers crossed on that one). If the ILS/DME data cannot be found the "workaround way" is going to be airport location ;-( RomanProud "TEAM AVSIM" RTW race member.http://forums.avsim.net/user_files/194377.jpg FS RTWR SHRS F-111 JoinFS Little Navmap
November 23, 200817 yr It's turning out well.. Got the ILS part working well.. Tried ICAO search ( about 23 hours worth, no hair left ), so going back to nearest search.The ICAO code format for VORs is'VK5 GRB' -or-'VK5 KGRBIGRB' -or-'V KGRBMNO' etc...The result can be different due to basically a poorly executed AFCAD2 modification.. But the ICAO search only does the last characters during the search. I just could't get the search routine to spawn.. I got the inputs in though. RomanProud "TEAM AVSIM" RTW race member. FS RTWR SHRS F-111 JoinFS Little Navmap
November 24, 200817 yr Hi Bob,If you still want to use the gps functions to retrieve NAV coordinates and altitude, it's very simple :-)1) Do an ICAOSearch using Avar nav info: 0 (>L:ICAO Found,number) 0 (>L:ICAO NoMatch,bool)'V' (>@c:IcaoSearchStartCursor)31 (>@g:enteringInput)0 (>@c:IcaoSearchMatchedIcao)(A:NAV1 Ident,string) (>C:fs9gps:IcaoSearchEnterChar)(@c:IcaoSearchMatchedIcaosNumber) 0 > if{ (@c:IcaoSearchCurrentIcao) (>@c:FacilityICAO) 1 (>L:ICAO Found,number) } els{ 0 (>L:ICAO Found,number) } (@c:FacilityICAO) (>@c:WaypointVorICAO)(@c:WaypointVorLatitude,degrees) (>L:YOurLat,degrees)(@c:WaypointVorLongitude,degrees) (>L:YOurLon,degrees)(@c:WaypointVorElevation,feet) (>L:YourAlt,feet)Then, somewhere on the code ..NAV1 changedif{ @SearchICAO }(L:ICAO Found,number) 1 == if{ 2 (>L:ICAO Found,number) }(L:ICAO Found,number) 2 == if{ @RetrieveVOR }etc etcNow you can use those Lat/Lon/Alt vars combined with Plane Lat, Plane Lon and Plane alt via geocalc functions to find the proper distance to the VOR at any moment.Good luck! :-)Tom
November 24, 200817 yr Tom, Thanx alot!! I barked up the same tree, almost exact. But it never worked. Since you made it work, I thought I'd give it another try. It didn't work again !! But found the problem --- I had constantly firing Vars inside looping macros -- BAD, BAD, BAD!!! Got rid of both and voila ;-) Got rid of a boatload of code!:-beerchug Thanx,RomanProud "TEAM AVSIM" RTW race member. FS RTWR SHRS F-111 JoinFS Little Navmap
Create an account or sign in to comment