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

  • Commercial Member

Back again, with another probelm.I've been making a FMC for my panel through XML for FS9, now I've come to a problem. I've modeled the FMC after the typical Boeing FMC's - the 76 in particular - now the only difference concerned here is that I've used an IRU instead of IRS but that has nothing to do but graphics really.In the FMC the first page of relating to POSITION is the POS INIT page, in this page I want to display the LAST POS or the position in LAT/LON that the aircraft was shut down at. I've tried to accomplish this using the following code:

  <Element>   <Select>   <Value>(L:PWR,bool) 0 == if{ (A:PLANE LATITUDE,degrees) (>L:FMC-IRU-POS-LAT-LAST,degrees) }   </Value>   </Select>  </Element>  <Element>   <Select>   <Value>(L:PWR,bool) 0 == if{ (A:PLANE LONGITUDE,degrees) (>L:FMC-IRU-POS-LON-LAST,degrees) }   </Value>   </Select>  </Element>  <Element>   <Select>   <Value>(L:PWR,bool) 0 == if{ (A:PLANE LATITUDE,degrees) (A:PLANE LONGITUDE,degrees) + (>L:FMC-IRU-POS-LAST,degrees) }   </Value>   </Select>  </Element>

Now that should theoretically provide me with what I need. But when I go to display that bit of code, I got no value what so ever, not a "0" or anything.This is how I'm trying to display it:

  <Element>   <Position X="115" Y="17"/>   <Visible>(L:FMC-IRU-ALIGNED,bool) 1 ==</Visible>   <Text X="50" Y="10" Bright="Yes" FontSize="10" Length="10" Font="Verdana" Color="#aeff00" Adjust="Left" VerticalAdjust="Center" Multiline="No" Bold="Yes">	<String>%((L:FMC-IRU-POS-LAT-LAST,degrees) d 0 >= s0 r abs d 3600 * 60 % r d 60 * 60 % flr r flr 'N' 'S' l0 ? ))%!s!</String>   </Text>  </Element>  <Element>   <Position X="165" Y="17"/>   <Visible>(L:FMC-IRU-ALIGNED,bool) 1 ==</Visible>   <Text X="50" Y="10" Bright="Yes" FontSize="10" Length="10" Font="Verdana" Color="#aeff00" Adjust="Left" VerticalAdjust="Center" Multiline="No" Bold="Yes">	<String>%((L:FMC-IRU-POS-LON-LAST,degrees) d 0 >= s0 r abs d 3600 * 60 % r d 60 * 60 % flr r flr 'E' 'W' l0 ? ))%!s!</String>   </Text>  </Element>

(L:FMC-IRU-POS-LAST,degrees) is a variable I created to give me a unique number that represents a specific LAT/LON position, I can use this number to set my current position for aligning the IRU. If the value input into the SET IRU POS field is that same as the POS-LAST value then my IRU begins aligning and after 10 minutes-ish it is aligned.But I'll cross that bridge once I get there, first thing is I need to know what is wrong with the initial code?As I wait for the enlightened one that will show me the way I will be praying to the XML gods. :( :( :( B)

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Back again, with another probelm.I've been making a FMC for my panel through XML for FS9, now I've come to a problem. I've modeled the FMC after the typical Boeing FMC's - the 76 in particular - now the only difference concerned here is that I've used an IRU instead of IRS but that has nothing to do but graphics really.In the FMC the first page of relating to POSITION is the POS INIT page, in this page I want to display the LAST POS or the position in LAT/LON that the aircraft was shut down at. I've tried to accomplish this using the following code:
  <Element>   <Select>   <Value>(L:PWR,bool) 0 == if{ (A:PLANE LATITUDE,degrees) (>L:FMC-IRU-POS-LAT-LAST,degrees) }   </Value>   </Select>  </Element>  <Element>   <Select>   <Value>(L:PWR,bool) 0 == if{ (A:PLANE LONGITUDE,degrees) (>L:FMC-IRU-POS-LON-LAST,degrees) }   </Value>   </Select>  </Element>  <Element>   <Select>   <Value>(L:PWR,bool) 0 == if{ (A:PLANE LATITUDE,degrees) (A:PLANE LONGITUDE,degrees) + (>L:FMC-IRU-POS-LAST,degrees) }   </Value>   </Select>  </Element>

Now that should theoretically provide me with what I need. But when I go to display that bit of code, I got no value what so ever, not a "0" or anything.This is how I'm trying to display it:

  <Element>   <Position X="115" Y="17"/>   <Visible>(L:FMC-IRU-ALIGNED,bool) 1 ==</Visible>   <Text X="50" Y="10" Bright="Yes" FontSize="10" Length="10" Font="Verdana" Color="#aeff00" Adjust="Left" VerticalAdjust="Center" Multiline="No" Bold="Yes">	<String>%((L:FMC-IRU-POS-LAT-LAST,degrees) d 0 >= s0 r abs d 3600 * 60 % r d 60 * 60 % flr r flr 'N' 'S' l0 ? ))%!s!</String>   </Text>  </Element>  <Element>   <Position X="165" Y="17"/>   <Visible>(L:FMC-IRU-ALIGNED,bool) 1 ==</Visible>   <Text X="50" Y="10" Bright="Yes" FontSize="10" Length="10" Font="Verdana" Color="#aeff00" Adjust="Left" VerticalAdjust="Center" Multiline="No" Bold="Yes">	<String>%((L:FMC-IRU-POS-LON-LAST,degrees) d 0 >= s0 r abs d 3600 * 60 % r d 60 * 60 % flr r flr 'E' 'W' l0 ? ))%!s!</String>   </Text>  </Element>

(L:FMC-IRU-POS-LAST,degrees) is a variable I created to give me a unique number that represents a specific LAT/LON position, I can use this number to set my current position for aligning the IRU. If the value input into the SET IRU POS field is that same as the POS-LAST value then my IRU begins aligning and after 10 minutes-ish it is aligned.But I'll cross that bridge once I get there, first thing is I need to know what is wrong with the initial code?As I wait for the enlightened one that will show me the way I will be praying to the XML gods. :im Not Worthy: :im Not Worthy: :im Not Worthy: :im Not Worthy:

HelloYou can't store Lvarslike that, If you change the aircraft or load a new flight they all will be reset to 0.

Paul EGLD

  • Author
  • Commercial Member

I'm aware of that. I want them to be reset if the aircraft or flight is changed. :(

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

I'm aware of that. I want them to be reset if the aircraft or flight is changed. :(
I had a look at your code and at first sight everything seems to be ok. So the mistake seems not to be so obvious. Maybe something in the math is wrong, maybe one of the several attributes of the text-element, who knows... I'd suggest to use a working text element (from any other gauge) and to replace the used variable of that gauge by your (L:FMC-IRU-POS-LON-LAST,degrees) only. No math, no custimized text attributes, no nothing else. If then you still get nothing,the mistake must be in the first part of your code. But if you get something, try to change - step by step - the default text-element to what you want it to look like. Then the math, and somewhen it should work.Hope this helps,Herbert
  • Author
  • Commercial Member

Thanks for your reply Herbert, but that is exactly the process I was trying to avoid by posting on here - in hopes that someone would see my problem right away, particularly someone who done this before - programed an FMC that is. :( Once again thanks.

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

  • Moderator
I'm aware of that. I want them to be reset if the aircraft or flight is changed. :(
But that's the entire point! The contents of L:vars can not be saved during a reset or flight reload...Several years ago I coded a "blackbox" C gauge that allows me to write custom XML variables to a data file, then read them in during initial panel load or a reset. That truly is the only way this may be accomplished.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
  • Commercial Member

But I have no intent on reseting or reloading the flight at any time during the time of the flight. The way I've got it figured is if you want to fly it, you fly it from the beginning to the end and then do what you will, but you can not do just load the flight at anytime. I've not invisioned that capability yet, and don't really feel as I need it yet.Now if that's the only approach, seeing as I have almost no C gauge experience would it be terribly difficult to create? Is there a way to do that through XML? :(

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

But I have no intent on reseting or reloading the flight at any time during the time of the flight. The way I've got it figured is if you want to fly it, you fly it from the beginning to the end and then do what you will, but you can not do just load the flight at anytime. I've not invisioned that capability yet, and don't really feel as I need it yet.Now if that's the only approach, seeing as I have almost no C gauge experience would it be terribly difficult to create? Is there a way to do that through XML? :(
HelloYou asked:In the FMC the first page of relating to POSITION is the POS INIT page, in this page I want to display the LAST POS or the position in LAT/LON that the aircraft was shut down at. From which flight is the last shutdown?

Paul EGLD

But I have no intent on reseting or reloading the flight at any time during the time of the flight. The way I've got it figured is if you want to fly it, you fly it from the beginning to the end and then do what you will, but you can not do just load the flight at anytime. I've not invisioned that capability yet, and don't really feel as I need it yet.Now if that's the only approach, seeing as I have almost no C gauge experience would it be terribly difficult to create? Is there a way to do that through XML? :(
In theory what you want should work. The situation remains , the aircraft is still loaded, all you've done is shut down the systems (ie Engines, avionics etc) so the Lvars should keep their value. I see no reasonwhy this can not be done in XML so I don't think that's the issue.The XML gauges are not my area of expertise, so I can't comment on the correctness of your syntax.If I'm reading your code correctly, its assigning the current lat/lon when the PWR is zero.So wouldn't you be getting the lat/lon value at the time just before the power came back on, ratherthan the lat/lon at the time the power was last shut off ??Regards.Ernie.
ea_avsim_sig.jpg
  • Author
  • Commercial Member

WOW! I'm terrible sorry I feel like such an idiot, I failed to properly explain my code. :( Ernie you're right, (L:PWR,bool) 0 == is like that right when I load the aircraft. It's an LVar I created to tell me when the aircraft is powered, (if the APU is on, EXT PWR Connected, Engines started and their appropriate switches on to provide power, or the RAT is out and spinning at appropriate RPM's).So essentially I want it to capture the LAT/LON of where I am right before I turn the aircraft on/power it up - while it's cold an dark. This is to make it easier for the user to be able to enter the IRU LAT/LON when he/she starts the aircraft up and is ready to align the IRU's. The LAST POS will theoretically give you the current POS you're at and so if I enter that it would align appropriatley.There's a bit of code I did not post, that says if the enter position for alignment is close to the LAST POS then you align, but if it's way off then it doesn't align and produces a invalid entry message.It is important that the LAST POS value doesn't change while the aircraft is powered so I can't just put APLANE LAT/LON on a string and pos it there. Also I need LAT/LON to be equivalent to one specific value and that's why I needed that variable.I hope this helps you all understand what I'm trying to do with that bit of code.

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

  • Moderator

You want the init routine to be done once, and only once.Try placing your init scripts in an <Update Hidden="Yes"> statement, along with an init variable:

<Update Hidden="Yes">		(L:init,bool) == 0		(L:PWR,bool) 0 == 		and		if{			  (A:PLANE LATITUDE,degrees) (>L:FMC-IRU-POS-LAT-LAST,degrees)			  (A:PLANE LONGITUDE,degrees) (>L:FMC-IRU-POS-LON-LAST,degrees) 			  1 (>L:init,bool)		  }</Update>

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
  • Commercial Member

Thx Bill, that really helped I figured out a lot!The only thing that is proving difficult now is that, I need to derive the minutes from the entire degree value, so here's some math that I figured so far.Example:S7.3119

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

  • Author
  • Commercial Member

Ok new development, I'm trying to code characters - letters - in my FMC.I'm using the GPS Variable IcaoSearchEnterChar and I need to know a few things- I don't know all the correspond #'s that are equivalent to their letters I just know that 65 = A, there isn't any other source out there where I can find this information from I've been searching a lot.- <Click>65 chr (>@c:IcaoSearchEnterChar)</Click> - Is that the proper way to set up the code? I have a macro where name C that directs to FS9gps so that explains the missing FS9GPS in the front.- How do I display the string? So I know what I'm typing and such? :(

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

  • Author
  • Commercial Member

Roman, to be honest the code didn't really do much for me - I guess it's because I don't know enough to understand what that code is trying to do and how it is going about doing it?I still don't know whether to input a Alpha Character I need to input a number or the character itself into (>@C:IcaoSearchEnterChar)?And if it's a # representing the particular character, how am I supposed to know what # represents what character?And once that's all said and done how do I display the string?

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.