Jump to content
Sign in to follow this  
Engjell Berisha

FS9 XML FS9GPS.dll

Recommended Posts

I'm trying to set a destination as a direct to if I have no flightplan loaded, I can't understand why the following code doesn't work - but then again I've never done much with the gps module. :(

 (@c:FlightPlanIsActiveFlightPlan) 0 ==  if{ (L:FMC-RTE-DEST-1,number) 64 > (L:FMC-RTE-DEST-4,number) 64 > (L:FMC-RTE-DEST,bool) 0 == and and if{  1 (>C:fs9gps:IcaoSearchStartCursor) (L:FMC-RTE-DEST-1,number) (>C:fs9gps:IcaoSearchEnterChar) (C:fs9gps:IcaoSearchCursorPosition) 1 + (>C:fs9gps:IcaoSearchCursorPosition) (L:FMC-RTE-DEST-2,number) (>C:fs9gps:IcaoSearchEnterChar) (C:fs9gps:IcaoSearchCursorPosition) 1 + (>C:fs9gps:IcaoSearchCursorPosition) (L:FMC-RTE-DEST-3,number) (>C:fs9gps:IcaoSearchEnterChar) (C:fs9gps:IcaoSearchCursorPosition) 1 + (>C:fs9gps:IcaoSearchCursorPosition) (L:FMC-RTE-DEST-4,number) (>C:fs9gps:IcaoSearchEnterChar)  1 (>C:fs9gps:IcaoSearchStopCursor)  1 (>@c:FlightPlanDirectToDestination)  1 (>L:FMC-RTE-DEST,bool) } } 

Any help would be appreciated.Engjell BerishaGood Day!


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites
 (@c:FlightPlanIsActiveFlightPlan) 0 ==  if{ (L:FMC-RTE-DEST-1,number) 64 > (L:FMC-RTE-DEST-4,number) 64 > and if{ 1 (>@c:IcaoSearchStartCursor) (L:FMC-RTE-DEST-1,number) chr (>@c:IcaoSearchEnterChar) (L:FMC-RTE-DEST-2,number) chr (>@c:IcaoSearchEnterChar) (L:FMC-RTE-DEST-3,number) chr (>@c:IcaoSearchEnterChar) (L:FMC-RTE-DEST-4,number) chr (>@c:IcaoSearchEnterChar)  1 (>@c:IcaoSearchStopCursor) (@c:IcaoSearchCurrentIcao) (>@c:FacilityICAO) (@c:FacilityICAO) (>@c:FlightPlanNewWaypointICAO)  1 (>@c:FlightPlanDirectToDestination) } } 

Revised the code a little, I've been looking at many examples and what not but I can't seem to make any progress.I noticed that when I tried to retrieve nearestairportcurrenticao I couldn't get anything to show, I'm not quite sure what that means?I'm really hoping someone is willing to help me with this.


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

Engjell, Maybe give this a try. It is only good for airports , NO nav,adf,rporting points etc... There could be some more checks for multiples and such but this basis code works and is tested to the point of being a valid GPS usable waypoint. When you hit the "enter" button start this code set.

'A' (>C:fs9gps:IcaoSearchStartCursor)31 (>C:fs9gps:enteringInput)(L:FMC-RTE-DEST-1,number) chr (L:FMC-RTE-DEST-2,number) chr scat (L:FMC-RTE-DEST-3,number) chr scat (L:FMC-RTE-DEST-4,number) chr scat (>C:fs9gps:IcaoSearchEnterChar)<!-- THIS DOES NOT CHECK FOR MULTIPLE AIRPORTS! -->(C:fs9gps:IcaoSearchMatchedIcaosNumber) 1 == if{ (C:fs9gps:IcaoSearchCurrentIcao) (>C:fs9gps:WaypointAirportICAO) }<!-- UNKNOWN from this point, but you have a usable airport ICAO to send to "DIRECT TO" -->(C:fs9gps:WaypointAirportICAO) (>C:fs9gps:FlightPlanNewWaypointICAO)<!-- ONLY 1 of the next 3 may/may not work  -->1 (>C:fs9gps:FlightPlanIsDirectTo)<!-- OR -->1 (>C:fs9gps:FlightPlanIsActiveWaypoint)<!-- OR -->1 (>C:fs9gps:FlightPlanDirectToDestination)

To see if this works for the initial airport find, use a string to display the airport name. (C:fs9gps:WaypointAirportName) within the same gauge as the code.This will not show up on the stock GPS as these codes run asynchronous, will just have to test by flying the route with GPS drives NAV1.Hope this may help,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

Hey Roman Thanks a lot, you got me on the right path. I can set all the parameters it seems and I've only got one small problem it seems.Here's the code I've been using:

 (@c:FlightPlanIsActiveFlightPlan) 0 == if{ (L:FMC-RTE-DEST-1,number) 64 > (L:FMC-RTE-DEST-4,number) 64 > and if{ 'A' (>@c:IcaoSearchStartCursor)  31 (>@c:enteringInput)  (L:FMC-RTE-DEST-1,number) chr (L:FMC-RTE-DEST-2,number) chr (L:FMC-RTE-DEST-3,number) chr  (L:FMC-RTE-DEST-4,number) chr scat scat scat (>@c:IcaoSearchEnterChar)  (@c:IcaoSearchMatchedIcaosNumber) 1 == if{ (@c:IcaoSearchCurrentIcao) (>@c:WaypointAirportICAO) (@c:IcaoSearchCurrentIcao) (>@c:FacilityICAO) (@c:FacilityICAO) (>@c:FlightPlanNewWaypointICAO) 1 (>@c:FlightPlanDirectToDestination) @EscapeMenu quit } } } 

The problem is in the last bit of code, the FlightPlanNewWaypointICAO will not set for whatever reason - I use FlightPlanWaypointICAO to see, is this the right variable?The first few times I tried this the Sim crash because everything would set but as soon as the gauge would try and set 1 (>@c:FlightPlanDirectToDestination) the sim would crash giving an error report for panels.dll. I would assume this is because I have no FlightPlanWaypointICAO set to activate a flight plan? So I would omit that piece of code, I added the @EscapeMenu quit piece hoping that would solve the crashing but no avail - I'd seen it in a few gauges.I tried setting flightplanisdirectto but that would not set either, nor would FlightPlanIsActiveWaypoint - I suppose since there was no active waypoint.What I don't understand is why FlightPlanNewWaypointICAO when facilityicao is set and waypointairporticao sets to currenticao, etc..I'm curious as to what enteringinput is? I've seen it used everywhere, but I can not find a single bit of reference from microsoft as to what it is? Also I wonder why I have to start the cursor with 'A'? When I do this it seems to stay there, forever the display would show "A ICAO" the icao being the set ICAO from my variables, maybe I should added a stop cursor afterwards?Thanks for the help so far, it's much appreciated.


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

Engjell, You wrote -- "The problem is in the last bit of code, the FlightPlanNewWaypointICAO will not set for whatever reason - I use FlightPlanWaypointICAO to see, is this the right variable?" This thread http://forums1.avsim.net/index.php?showtopic=268961 may have an answer(s) for maybe all the problems. See Post #5 in the code box I have put a comment. <!-- THESE UPDATES ARE REQUIRED SINCE THE GPS NEEDS 1 CYCLE AFTER ICAO-->WAYPOINT TRANSFER BEFORE ABLE TO ACCESS WAYPOINT DATA -->I have noticed, but not proven why, failure to wait the 1 cycle results in code that just doesn't work. See post #10 on a possible theory on how 31/131 enteringinput works.. Bob (RPMC) had a attachment that dissapeared which just may prove this, good info too. attachment=11441:example_format.jpg in post #1 (PM him for a replacement?)See post #11 for a tool that may help. Tried but my Excel installation is pooched, VB doesn't work.. ( I have to fix that some day :-) )You wrote-- "When I do this it seems to stay there, forever the display would show "A ICAO" the icao being the set ICAO from my variables, maybe I should added a stop cursor afterwards?"Ar you using (C:fs9gps:WaypointAirportName) to display(just for testing)? or something that has ICAO as a suffix for the GPS variable? Maybe use FlightPlanWaypointIdent or something similar w/Ident suffix that fits for your display. That previously mentioned attachment .jpg may show why. IIRC an ICAO suffix sends/reads some/all (depending on when, or how, read) the relevant information about the waypoint (Type, Region, Ident, Name etc...) so it can be processed the core GPS database ??Just some ideas for now, HIH,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

Roman,I should've mentioned I suppose that the code I'm showing you is all wrapped in update - it was just a massive bit that wou'dve been annoying to show. Shouldn't that suffice as for cycles?

%ICAO %((@c:IcaoSearchCurrentIcao))%!s!\t\t\t%WPAP %((@c:WaypointAirportICAO))%!s!\n%FACT %((@c:FacilityICAO))%!s!\t\t%FPWP %((@c:FlightPlanWaypointICAO))%!s!

The above code is what I use to see what's happening with the gps variables. Now for everything but FlightPlanWaypointICAO I get a return of "A PHNL" (lets just say I typed in PHNL as my DEST ARPT). FlightPlanWaypointicao returns nothing, if I am to load a flight plan it works then.I'm disappointed in the search function of the forum! I've tried for months to find something relevant to fs9gps.dll to help me understand some things. That topic was wonderful, thank you.Once again thanks.


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites
Roman,I should've mentioned I suppose that the code I'm showing you is all wrapped in update - it was just a massive bit that wou'dve been annoying to show. Shouldn't that suffice as for cycles?
%ICAO %((@c:IcaoSearchCurrentIcao))%!s!\t\t\t%WPAP %((@c:WaypointAirportICAO))%!s!\n%FACT %((@c:FacilityICAO))%!s!\t\t%FPWP %((@c:FlightPlanWaypointICAO))%!s!

The above code is what I use to see what's happening with the gps variables. Now for everything but FlightPlanWaypointICAO I get a return of "A PHNL" (lets just say I typed in PHNL as my DEST ARPT). FlightPlanWaypointicao returns nothing, if I am to load a flight plan it works then.I'm disappointed in the search function of the forum! I've tried for months to find something relevant to fs9gps.dll to help me understand some things. That topic was wonderful, thank you.Once again thanks.

By Civa INS you can go straight to destination airport.www.simufly.com/insGianfranco

Share this post


Link to post
Share on other sites
By Civa INS you can go straight to destination airport.www.simufly.com/insGianfranco
What is the point of your reply? It has no bearing on the discussion whatsoever... :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
What is the point of your reply? It has no bearing on the discussion whatsoever... :(
The poster declared:"I'm trying to set a destination as a direct to if I have no flightplan loaded".Having the Civa INS installed this is not a problem.Gianfranco

Share this post


Link to post
Share on other sites
The poster declared:"I'm trying to set a destination as a direct to if I have no flightplan loaded".Having the Civa INS installed this is not a problem.Gianfranco
I don't think they were asking for your product.

Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites
The poster declared:"I'm trying to set a destination as a direct to if I have no flightplan loaded".Having the Civa INS installed this is not a problem.Gianfranco
Yes, and with the posting of sample XML script it was pretty obvious that he's trying to write his own gauge... :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Engjell, Did you have any luck? I did, needed to learn a bit about the FlightPlan functions in the GPS anyway for a future project. Here's a stripped down version of what i wrote for DirectTo without an active FlightPlan . Notice I used macros, you should be a ble to do this in an <update> as long as there a some checks to prevent constant firing. I was able to have a DirectTo with a FlightPlan loaded and upon DirectTo cancel it would revert to the last FlightPlan active waypoint. ( donot think the stock GPS does this)This is the same as before.

<Macro Name="FIND">'A' (>C:fs9gps:IcaoSearchStartCursor)31 (>C:fs9gps:enteringInput)"Your 4 Digit ICAO Code" (>C:fs9gps:IcaoSearchEnterChar)(C:fs9gps:IcaoSearchMatchedIcaosNumber) 1 == if{ (C:fs9gps:IcaoSearchCurrentIcao) (>C:fs9gps:FacilityICAO) }</Macro>

In here is the key, when going DirectTo there are 2 waypoints. Index0 = Current AC position @ time of going DirectTo,, Index1 = The DirectTo waypoint ICAO. So you have to set Index to 1 to get the DirectTo to work. Also to display the DirectTo information Index must be @ 1. This macro is controlled by an update below.

Macro Name="DTO">1 (>C:fs9gps:FlightPlanWaypointIndex) (C:fs9gps:FacilityICAO) (>C:fs9gps:FlightPlanNewWaypointICAO) 1 (>C:fs9gps:FlightPlanDirectToDestination)</Macro>

These updates do 2 things, 1st - It keeps the Index locked to current Waypoint. It may not be a good idea to do this in advanced GPS functions such as Waypoint replacement Etc. 2nd - This checks that there is a valid FacilityICAO & that the Facility ICAO is different than FlightPlanWaypointIdent @ index1, if so, do the 1 cycle dilemma I keep getting, then send to @DTO.

Update>(C:fs9gps:FlightPlanActiveWaypoint) (>C:fs9gps:FlightPlanWaypointIndex)(G:Var1) 0 ==  (C:fs9gps:FacilityICAO) slen 3 >  (C:fs9gps:FacilityICAO)  (C:fs9gps:FlightPlanWaypointIdent) scmp 0 == ! & & if{ 1 (>G:Var1) }(G:Var1) 2 == if{ @DTO 0 (>G:Var1) }(G:Var1) 1 == if{ 2 (>G:Var1) }</Update>

This RESET Macro will clear the DirectTo and is only good when there is no FlightPlan loaded. If one is, it will strip 2 waypoints starting at the current Index. It has also locked up FS if there is no waypoints at all, hence the IsDirectTo check.

Macro Name="RESET">' ' (>C:fs9gps:FacilityICAO)(C:fs9gps:FlightPlanIsDirectTo) if{  (>C:fs9gps:FlightPlanCancelDirectTo)(>C:fs9gps:FlightPlanDeleteWaypoint) (>C:fs9gps:FlightPlanDeleteWaypoint) }</Macro>

Here are the variables I used for testing.DirectTo

(C:fs9gps:FlightPlanIsDirectTo)(C:fs9gps:FlightPlanWaypointIdent)(C:fs9gps:FlightPlanWaypointRemainingDistance, Nmile)(C:fs9gps:FlightPlanWaypointMagneticHeading)(C:fs9gps:FlightPlanWaypointEstimatedTimeRemaining, minutes)

GPS Status

C:fs9gps:FacilityIdent)(C:fs9gps:FlightPlanDirectToWaypoint)(C:fs9gps:FlightPlanWaypointsNumber)(C:fs9gps:FlightPlanWaypointIndex)(C:fs9gps:FlightPlanIsActiveFlightPlan)(C:fs9gps:FlightPlanActiveWaypoint)(C:fs9gps:FlightPlanIsActiveWaypoint)

I also noticed that the GPS keeps track of changes that I make using this test gauge.. :-) Maybe because it is on the same window? I assumed that 2 different calls to the GPS would result in 2 actions being separated. (asynchronous???)Hope this can help if you didn't figure it out yourself..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

Roman,I tested it your way, putting the functional code in macros and then running the macros from within update and I understand what ya meant about the cycles now - and that part seems resolved. No the flight plan will set to directtodestination.The only problem that seems to persist is the (C:fs9gps:FacilityICAO) (>C:fs9gps:FlightPlanNewWaypointICAO) flightplannewwaypointicao will not set at all. I can not figure out why. I considered that I do not use the default GPS gauge or any other default gauge in my panel so maybe some code is lacking?FYI, there was no reference to the FIND macro - initiating it - in the update code nor the RESET so I added @FIND in front of @DTO in the update code - it works right, just don't know if it is right. I did not add RESET anywhere though.Thanks for the help you offer, I hope I'm not being too much of a bother. :(


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

Engjell,

The only problem that seems to persist is the (C:fs9gps:FacilityICAO) (>C:fs9gps:FlightPlanNewWaypointICAO) flightplannewwaypointicao will not set at all. I can not figure out why. I considered that I do not use the default GPS gauge or any other default gauge in my panel so maybe some code is lacking?
Just FYI in case you're trying.. FlightPlanNewWaypointICAO is not readable.FlightPlanWaypointIndex 0 = current LAT/LON at time of DirectTo activation. So FlightPlanWaypointIndex 1 is the DirectTo waypoint.This writes FlightPlanWaypointIndex to 1 so I can put the waypoint there at that index.
1 (>C:fs9gps:FlightPlanWaypointIndex) (C:fs9gps:FacilityICAO) (>C:fs9gps:FlightPlanNewWaypointICAO) 1 (>C:fs9gps:FlightPlanDirectToDestination)

FacilityICAO is now an active waypoint. This writes FlightPlanWaypointIndex to 1 so I can now read the new waypoint at that Index.

1 (>C:fs9gps:FlightPlanWaypointIndex)%(C:fs9gps:FlightPlanWaypointIdent)%!s!%

, there was no reference to the FIND macro - initiating it - in the update code nor the RESET so I added @FIND in front of @DTO in the update code - it works right, just don't know if it is right. I did not add RESET anywhere though.
Me bad - The call to @FIND originates in a part of code that I didn't provide, The keyboard/Mousewheel/Drag functions I use to select the ICAO code. Once that code reaches 4 digits it formats then sends to @FIND to start the whole deal. I know macros are used for multiple calls and such to save space, brevity etcc. I use them to put specific chunks of code into, ones that do a specific purpose - that way I can easily find the offending code. (which is alot, LOL) @RESET is called from the "CANCEL" button.. It was put in a macro just for ease of editing in my code.. Yes this thing could be rewritten to a "proper" syntax set, but it's just a test gauge after all. Keep pluggin at it, Hope this helps,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

It seems I've come to the end of my wits again.I will try to explain whats happening in my gauge better, hopefully to get to the bottom of this once and for all.I've set up the code just as you recommended, the three macros, the G:Var triggers wrapped in update - within which I've included code to set the flightplan index to 1 as in the macro it won't stay at 1 it only goes to one for a second and then back - and I've added the @find into the mouse click.Three macros:

<Macro Name="FIND">'A' (>@c:IcaoSearchStartCursor)31 (>@c:enteringInput)(L:FMC-RTE-DEST-1,number) chr (L:FMC-RTE-DEST-2,number) chr (L:FMC-RTE-DEST-3,number) chr  (L:FMC-RTE-DEST-4,number) chr scat scat scat (>@c:IcaoSearchEnterChar) (@c:IcaoSearchMatchedIcaosNumber) 1 == if{ (@c:IcaoSearchCurrentIcao) (>@c:FacilityICAO) } </Macro><Macro Name="DTO">(@c:FacilityICAO) (>@c:FlightPlanNewWaypointICAO) <!--== 1 (>@c:FlightPlanDirectToDestination) ==--></Macro><Macro Name="RESET">' ' (>@c:FacilityICAO)(@c:FlightPlanIsDirectTo) if{ (>@c:FlightPlanCancelDirectTo)(>@c:FlightPlanDeleteWaypoint) (>@c:FlightPlanDeleteWaypoint) }</Macro>

In @DTO I've excluded 1 (>@c:FlightPlanDirectToDestination) because when it's included the sim crashes right when @DTO is triggered, and I get a error report for panels.dll.I use the following code wrapped in a bigger string to see what the variables are doing:

%ICAO %((@c:IcaoSearchCurrentIcao))%!s!\t\t\t%WPID %((@c:FlightPlanWaypointIndex))%!s!\n%FACT %((@c:FacilityICAO))%!s!\t\t%FPWP %((@c:FlightPlanWaypointIdent))%!s!

And this is the code in update:

1 (>@c:FlightPlanWaypointIndex) 5 (>@g:blinkingField) (G:Var1) 0 ==  (@c:FacilityICAO) slen 3 > (@c:FacilityICAO) (@c:FlightPlanWaypointIdent) scmp 0 == ! and and if{ 1 (>G:Var1) }(G:Var1) 2 == if{ @DTO 0 (>G:Var1) }(G:Var1) 1 == if{ 2 (>G:Var1) }

Now I would start the aircraft, align the IRU's, then go to the Route page enter in my destination in this below case "PHOG" as I was in PHMK, so then the ICAO-icao sets and the Facility ICAO sets, the Flight plan waypoint does not set, it has never set. I'm trying everything to set it but I can't understand why it will not.FMC-C-MK-T1.jpgFMC-C-MK-T2.jpgFMC-C-MK-T3.jpgI've been trying to understand how to work my way around this by studying the default GPS, but I've gotten no where.Any help would be much appreciated.


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

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