Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FS9 XML FMC NAVIGATION SYS

Featured Replies

This should help although it is an example of how to get the keys from the keyboard. To find which number represents a letter, use the example below & monitor the "(L:char#,number)" for the result. The only keys that work ( from memory, may be slightly off ) 1-0 (not numpad), +/-, Backspace, A-Z, Spacebar. In the example there a 2 ways to display the resulting screen. <!-- Commented ->I used this great tutorial to make a keyboard direct entry gauge that controls radios and AP similar to the adventure module GPWS98 for FS98/00. RomanThe example below is from a post by Arne Bartels, Kudos :( to him, one of the best "teachers" ever for gauges.****************************************************************************************************************Some time ago I was asked how to access keystrokes by XMLgauges. The only answer I could have given, would be to builda C-gauge using Dinput and passing to L: variables. Butrecently I discovered something new in the GPS codes: thereis a genuine key access section in the XML possible, evensimpler as in C the <Keys>..</Keys> section. Iwas searching for something completely different ( "Canthe C:fs9gps:... syntax also used in C? In the otherdirection: Can TrafficInfo be read from XML?"), but Ifound this.In the Keys section two different accesses can be made, a"processed keys" or "listen" mode, wherethe keypresses, joystick buttons and gauge actions arepreprocessed and mapped to the corresponding (K:...) actions(<On Event="..."> ... </On>), the"Event" is still executed.The second method is direct keyboard access where you"steal" the raw codes away from FS. The raw method only works if the <On> section is"visible", the gauge itself has to be visible, andoptionally also a <Visible> section in the <On>Section (NOTE gauges in the VC are always visible, in the 2Dpanel only if their panel window is visible). To the example:Slaving the Aircraft exit to the AP switch is pretty dump,but it's for demonstrating purposes. The second example readsthe last pressed key and draws it to a string of fourcharacters. First the keyscan has to be activated by clickingon the gauge. Since L: vars can't hold strings, the numericvalues are stored in one L: variable per char and thendisplayed.The keyscan code itself is "(M:Key)". I shifted allother chars before, then store it with"(>L:char1,number)". "(M:Key) chr"would convert the keycode to the corresponding char, but L:can't hold chars and strings, so I do the conversion only forthe display (multiple use of "chr"). The both <String> lines have the same effect, but dosomething different, the first, commented one, just displaysthe last four scancodes as four chars("!s!....!s!"). The second version converts the scancodes to chars("chr") and then adds them to a complete string oneby one ("scat"), at last the complete string isdisplayed ("!s!"). BTW the inverse to "chr" is "ord".A bit complicated, but OK I think. Arne Bartels****************************************************************************************************************

<Gauge Name="keyaccess1" Version="1.0"> <Size X="100" Y="100" /> <Element Name="ShowRect">  <Position X="10" Y="10"/>  <Rectangle Width="80" Height="20" LineWidth="1" Color="0xF0D0D0"  FillColor="#2A76E8" Bright="Yes"/> </Element> <Element Name="ShowText">  <Position X="15" Y="15" />    <Text X="70" Y="15" Length="10" Fixed="Yes" Font="Courier" Adjust="Center" VerticalAdjust="Center" Color="0xF0D0D0" Bright="Yes"><!-- VERSION 1 COMMENTED OUT --><!--        <String>%( (L:char1,number) chr (L:char2,number) chr (L:char3,number) chr (L:char4,number) chr )%!s!%!s!%!s!%!s!%</String> --><!-- VERSION 2 ACTIVE -->        <String>%( (L:char1,number) chr (L:char2,number) chr scat (L:char3,number) chr scat (L:char4,number) chr scat )%!s!%</String>      </Text></Element> <Mouse>   <Tooltip>%Key Test%</Tooltip>    <Area Top="00" Left="00" Width="100" Height="100">    <Cursor Type="Hand" />     <Click Kind="LeftSingle">    (L:key_track, bool) ! (>L:key_track, bool)     </Click>    </Area> </Mouse> <Keys><!-- PROCESSED KEYS EXAMPLE COMMENTED OUT --><!--   <On Event="AP_MASTER">(>K:TOGGLE_AIRCRAFT_EXIT)</On>-->  <On Key="Ascii">   <Visible>(L:key_track, bool)</Visible>   (L:char3,number) (>L:char4,number)   (L:char2,number) (>L:char3,number)   (L:char1,number) (>L:char2,number)   (M:Key) (>L:char1,number)  </On> </Keys></Gauge>

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

 

  • Author
  • Commercial Member

Okay, figured some things out - not enough to have it all up and running for the purposes which I need it but enough not to go insane!I figured out that A-Z are equivalent to the values of 65-90 with 65=A and 90=Z. Also I've figured out how to display at least two different chr using the string code you showed me.The problems that persist are; I don't know how to display them appropriatley, when I click my "A" key all four letters equal "A" or "65" - I know this is just a fault in the way I've coded this, but I lack the understanding to code it properly. And I am limited to only being able to assign the first to letters, so if I were to click "A" then "B" I would be a stuck with "ABBB" and those last two BB I can't change.One thing I do not understand at all is this section of code which you provided me with, I don't understand what it's for and how to use it:

 <Keys>  <On Key="Ascii">   (L:KEY-3,number) (>L:KEY-4,number)   (L:KEY-2,number) (>L:KEY-3,number)   (L:KEY-1,number) (>L:KEY-2,number)   (M:Key) (>L:KEY-1,number)  </On> </Keys>

I altered it slightly using my own Lvars and removing the visible section.Another thing I don't understand is once I've done all this how do I input that value into c:fs9gps to set things such as ICAO search and what have you?Here's what I'm using as far as code goes:

 <Element>  <Position X="40" Y="385" />   <Text X="200" Y="10" Bright="Yes" FontSize="10" Length="10" Font="Verdana" Color="#aeff00" Adjust="Left" VerticalAdjust="Center" Multiline="No" Bold="Yes"><String>%((L:KEY-1,number) chr (L:KEY-2,number) chr scat (L:KEY-3,number) chr scat (L:KEY-4,number) chr scat)%!s!%</String>    </Text> </Element>  <Element>   <Select>   <Value>(L:KEY,bool) 1 > if{ (L:KEY-1,number) 0 == if{ (L:KEY,bool) (>L:KEY-1,number) } (L:KEY-1,number) 1 > if{ (L:KEY,bool) (>L:KEY-2,number) } (L:KEY-2,number) 1 > if{ (L:KEY,bool) (>L:KEY-3,number) } (L:KEY-3,number) 1 > if{ (L:KEY,bool) (>L:KEY-4,number) } }   </Value>   </Select>  </Element> <Keys>  <On Key="Ascii">   (L:KEY-3,number) (>L:KEY-4,number)   (L:KEY-2,number) (>L:KEY-3,number)   (L:KEY-1,number) (>L:KEY-2,number)   (M:Key) (>L:KEY-1,number)  </On> </Keys>

Thanks once again Roman!

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

One thing I do not understand at all is this section of code which you provided me with, I don't understand what it's for and how to use it:I altered it slightly using my own Lvars and removing the visible section.
R4=0, R3=0, R2=0, R1=0Now you press a fmc button ("Z" = 90 ) or use the keyboard thenR4=0, R3=0, R2=0, R1=90 Now press  another FMC button ("A" = 65 ) then the register(s) shfts to the left and fills R1 with the press.R4=0, R3=0, R2=90, R1=65 Now press  another FMC button ("P" = 81 ) then the register(s) shfts to the left and fills R1 with the press.R4=0, R3=90, R2=65, R1=81Now press  another FMC button ("O" = 80 ) then the register(s) shfts to the left and fills R1 with the press. R4=90, R3=65, R2=81, R1=80after doing the chr(s) scat(s) routine it will = "ZAPO" 

A shift register and chr(s)/scat(s) routine would be a perfect fit for MACRO(s).ONE THING YOU MENTIONED IS THAT YOU TOOK OUT THE VISIBLE TAGS... THATS A NO-NO! AS THIS CODE WILL STEAL ALL THE CODES FROM FS! I.E. "G"=LANDING GEAR WILL NOT WORK ANYMORE.

Here's what I'm using as far as code goes:
Not sure what you're trying to do here. Kinda looks like a "RESET" routine, but it seems to me that it is destructive. Anytime a key is pressed it looks like (L:Key,bool) gets thrown into the registers.. Dunno.
   <Element>   <Select>   <Value>(L:KEY,bool) 1 > if{ (L:KEY-1,number) 0 == if{ (L:KEY,bool) (>L:KEY-1,number) } (L:KEY-1,number) 1 > if{ (L:KEY,bool) (>L:KEY-2,number) } (L:KEY-2,number) 1 > if{ (L:KEY,bool) (>L:KEY-3,number) } (L:KEY-3,number) 1 > if{ (L:KEY,bool) (>L:KEY-4,number) } }   </Value>   </Select>  </Element>

Another thing I don't understand is once I've done all this how do I input that value into c:fs9gps to set things such as ICAO search and what have you?
From this point, every time you hit a FMC key & the registers shift is when you want to do the GPS search. ( If someone can chime in here (( donot remember)) do s0-s49, l0-l49 store strings? )See:http://forums1.avsim.net/index.php?showtop...0&hl=KDI572 See the 23rd post.realize that in this line the whole string is pushed into the search --- (A:NAV1 Ident,string) (>C:fs9gps:IcaoSearchEnterChar), so each time the registers shift, and the chr(s),scat(s) routine is done you push it into the search. GPS Search parameters are needed prior. (getting out of my league)See: http://msdn.microsoft.com/en-us/library/cc526954.aspx & the stock GPS for all the goodies. I hope this can get you going, i've contemplated doing a FMC but I'd like to keep what hair I have. This is about as far as I can help. There is a gentleman here that has done one for a 757 i believe. I think it is Jan "phjvh" or another one named Jan. Good LuckRoman

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

 

  • Author
  • Commercial Member

I've realized that you'd already done what I was trying to do, I just failed to realize it.The <Keys> code you provided me with does what I was trying to do with my <Element> code, and it uses more appropriate code to do so.No I understand how it works, and why and how to use the <Visible> section of the <Keys> code.s0 stores said value and l0 loads said value.I understand what a shift register is, because I was trying to create one not realizing you'd already done so.I also know how to make the FS9GPS search for an ICAO string as you should in the example below, what I was unclear about is seeing as - I'll use your example - "ZAPO" is derived using 4 different vars then how do I run a search on all those vars together which in this example equate to "ZAPO". It seems that you want to use sX and lX.Now another crucial thing I don't understand is what to set my click code for each chr to? For the code that I created I used this:

<Click>65 (>L:KEY,bool)</Click>

I would assume that using your examples I set it to:

<Click>65 (>L:KEY-1,number)</Click>

Or does (M:Key) have to be set?I have all the GPS Variables and the link to that site, it is very useful. But I can't wrap my head around how I would get the series of four vars to equate to one value that I then can set the ICAO search to.Thank You for all your help Roman, I apologize if I'm bogging you done. You've been a tremendous help! :(

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

  • Moderator

Observe the default GPS in action to understand how this works...You do know that if you click once when the input field is selected (any input field, not just the "Airport" box!), you can then type in the characters with the keyboard.After EACH character is typed, it is sent to the GPS search engine. You can see the results instantly in the GPS results window.We do not have to wait until the entire query is completed before sending it to the GPS search engine.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
Thank You for all your help Roman, I apologize if I'm bogging you done. You've been a tremendous help! :(
No problem whatsoever... One thing I have is summer. FS is one thing i get into deeply in the winter/snow months. I MUST get outa the house in the summer months. I haven't even fired up FS9 since the the World Race in Feb. No appoligies needed! I took what i had in code/text/notes etc.... Took it and that was/is my reply. Just for another tip.. The Fs9 GPS sys is a bitter girl, she needs to know WHO, WHAT, WHERE, WHEN, HOW & WHY before giving back anything! AND that is just the start! Good luck again! If I finally get some bad WX ( I.E. RAIN! ) then could setup a KB/FMC input deal as an ex. . Roman

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

 

Hi,Left FS9 since computercrash a year ago.Lost all of my code, but found an older copy of the FMC on a floppy.If you are interested send me an e-mail on:[email protected] and i will send you that copy.May be there is some code in there that you can use.Jan

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • 3 months later...
  • Author
  • Commercial Member

Hey guys thanks for all your help with this it is greatly appreciated, I've made significant progress on all of it since the last post.I thought I'd post updates of what I had done since then, just in-case anyone was curious or looking for the same thing.Here is the logic I used to control my IRU alignment and what not, it works very well:

      	<!--========================FMC-IRU-LOGIC========================-->      	<!--========================FMC-IRU-LOGIC========================-->      	<!--========================FMC-IRU-LOGIC========================--> <Element>  <Select>   <Value>(L:PWR,bool) 0 == if{ (A:PLANE LATITUDE,degrees) (>L:FMC-IRU-POS-LAT-LAST,degrees) (A:PLANE LONGITUDE,degrees) (>L:FMC-IRU-POS-LON-LAST,degrees) (L:FMC-IRU-POS-LAT-LAST,degrees) (L:FMC-IRU-POS-LON-LAST,degrees) + (>L:FMC-IRU-POS-LAST,degrees) 0 (>L:FMC-IRU-POS,degrees) 0 (>L:FMC-IRU-POS-SET,bool) 0 (>L:FMC-IRU-ALIGNED,bool) 0 (>L:FMC-IRU-ALIGN,number) }  (L:FMC-IRU-POS-LAST,degrees) near (L:FMC-IRU-POS,degrees) == (L:FMC-IRU-POS-LAST,degrees) abs near (L:FMC-IRU-POS,degrees) near abs == || if{ 1 (>L:FMC-IRU-POS-SET,bool) } els{ 0 (>L:FMC-IRU-POS-SET,bool) }  (L:IRU-1,bool) 0 == || (L:IRU-2,bool) 0 == || (L:IRU-3,bool) 0 == || (L:IRU-4,bool) 0 == || if{ 0 (>L:FMC-IRU-POS-SET,bool) }  (L:FMC-IRU-POS-SET,bool) 1 == if{ (L:FMC-IRU-ALIGN,number) 10 < if{ (L:FMC-IRU-ALIGN,number) 0.0015 + (>L:FMC-IRU-ALIGN,number) } } els{ (L:FMC-IRU-ALIGN,number) 0.0 > if{ (L:FMC-IRU-ALIGN,number) 0.75 - (>L:FMC-IRU-ALIGN,number) } }  (L:FMC-IRU-ALIGN,number) 7 < (A:GPS GROUND SPEED,knots) 1 > and if{ (L:FMC-IRU-ALIGN,number) 0.1 > if{ (L:FMC-IRU-ALIGN,number) 0.75 - (>L:FMC-IRU-ALIGN,number) } }  (L:FMC-IRU-ALIGN,number) 8 > if{ 1 (>L:FMC-IRU-ALIGNED,bool) } els{ 0 (>L:FMC-IRU-ALIGNED,bool) }</Value>  </Select> </Element>      	<!--========================/FMC-IRU-LOGIC========================-->      	<!--========================/FMC-IRU-LOGIC========================-->      	<!--========================/FMC-IRU-LOGIC========================-->

I ended up creating my own shift register with the advice from Roman, Jan's FMC, and Bill. Although it is an un-orthodox rendition of a shift register it does the job I was wanting in the manner I wanted it done, the only trouble is that it needs to be costomized for ever UNIT A-Z 0-9 / + - etc. What I did is I add the below piece of code to ever UNIT CLICK code and so every time it is evaluated and I end up with resulting text that does not have to dictated my flight simulator restrictions as long as I contend to build my own database of sorts where as the below txt would be applicable if not it's nothing more than eye candy - even then I'm quite proud.

      (L:FMC-UNIT-1,number) 0 == if{ 65 (>L:FMC-UNIT-1,number) } els{ (L:FMC-UNIT-1,number) (L:FMC-UNIT-2,number) > (L:FMC-UNIT-2,number) 0 == and if{ 65 (>L:FMC-UNIT-2,number) }  els{ (L:FMC-UNIT-2,number) (L:FMC-UNIT-3,number) > (L:FMC-UNIT-3,number) 0 == and if{ 65 (>L:FMC-UNIT-3,number) }  els{ (L:FMC-UNIT-3,number) (L:FMC-UNIT-4,number) > (L:FMC-UNIT-4,number) 0 == and if{ 65 (>L:FMC-UNIT-4,number) }  els{ (L:FMC-UNIT-4,number) (L:FMC-UNIT-5,number) > (L:FMC-UNIT-5,number) 0 == and if{ 65 (>L:FMC-UNIT-5,number) }  els{ (L:FMC-UNIT-5,number) (L:FMC-UNIT-6,number) > (L:FMC-UNIT-6,number) 0 == and if{ 65 (>L:FMC-UNIT-6,number) }  els{ (L:FMC-UNIT-6,number) (L:FMC-UNIT-7,number) > (L:FMC-UNIT-7,number) 0 == and if{ 65 (>L:FMC-UNIT-7,number) }  els{ (L:FMC-UNIT-7,number) (L:FMC-UNIT-8,number) > (L:FMC-UNIT-8,number) 0 == and if{ 65 (>L:FMC-UNIT-8,number) }  els{ (L:FMC-UNIT-8,number) (L:FMC-UNIT-9,number) > (L:FMC-UNIT-9,number) 0 == and if{ 65 (>L:FMC-UNIT-9,number) }  els{ (L:FMC-UNIT-9,number) (L:FMC-UNIT-10,number) > (L:FMC-UNIT-10,number) 0 == and if{ 65 (>L:FMC-UNIT-10,number) }  els{ (L:FMC-UNIT-10,number) (L:FMC-UNIT-11,number) > (L:FMC-UNIT-11,number) 0 == and if{ 65 (>L:FMC-UNIT-11,number) }  els{ (L:FMC-UNIT-11,number) (L:FMC-UNIT-12,number) > (L:FMC-UNIT-12,number) 0 == and if{ 65 (>L:FMC-UNIT-12,number) }  els{ (L:FMC-UNIT-12,number) (L:FMC-UNIT-13,number) > (L:FMC-UNIT-13,number) 0 == and if{ 65 (>L:FMC-UNIT-13,number) }  els{ (L:FMC-UNIT-13,number) (L:FMC-UNIT-14,number) > (L:FMC-UNIT-14,number) 0 == and if{ 65 (>L:FMC-UNIT-14,number) }  els{ (L:FMC-UNIT-14,number) (L:FMC-UNIT-15,number) > (L:FMC-UNIT-15,number) 0 == and if{ 65 (>L:FMC-UNIT-15,number) }  els{ (L:FMC-UNIT-15,number) (L:FMC-UNIT-16,number) > (L:FMC-UNIT-16,number) 0 == and if{ 65 (>L:FMC-UNIT-16,number) }  els{ (L:FMC-UNIT-16,number) (L:FMC-UNIT-17,number) > (L:FMC-UNIT-17,number) 0 == and if{ 65 (>L:FMC-UNIT-17,number) }  els{ (L:FMC-UNIT-17,number) (L:FMC-UNIT-18,number) > (L:FMC-UNIT-18,number) 0 == and if{ 65 (>L:FMC-UNIT-18,number) }  els{ (L:FMC-UNIT-18,number) (L:FMC-UNIT-19,number) > (L:FMC-UNIT-19,number) 0 == and if{ 65 (>L:FMC-UNIT-19,number) }  els{ (L:FMC-UNIT-19,number) (L:FMC-UNIT-20,number) > (L:FMC-UNIT-20,number) 0 == and if{ 65 (>L:FMC-UNIT-20,number) }   els{ (L:FMC-UNIT-20,number) (L:FMC-UNIT-21,number) > (L:FMC-UNIT-21,number) 0 == and if{ 65 (>L:FMC-UNIT-21,number) }  els{ (L:FMC-UNIT-21,number) (L:FMC-UNIT-22,number) > (L:FMC-UNIT-22,number) 0 == and if{ 65 (>L:FMC-UNIT-22,number) }  els{ (L:FMC-UNIT-22,number) (L:FMC-UNIT-23,number) > (L:FMC-UNIT-23,number) 0 == and if{ 65 (>L:FMC-UNIT-23,number) }  els{ (L:FMC-UNIT-23,number) (L:FMC-UNIT-24,number) > (L:FMC-UNIT-24,number) 0 == and if{ 65 (>L:FMC-UNIT-24,number) } } } } } } } } } } } } } } } } } } } } } } } }

Jan I have to thank you greatly, what you provided me - although it didn't work at first as you had some unclosed pieces of code - once I got it to work it was wonderful and so insightful. I learned how to provide true FMC functions as apposed to botching them just enough so they work. I've completely rebuilt a 767 FMC from your model although I've still a while to go before I'm done.Once again thx everyone.

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.