Jump to content
Sign in to follow this  
phjvh

Using L Variables Between XML Gauges

Recommended Posts

Guest

I am designing a EIS (Engine Information System) for my ultralight (after those by Grand Rapids Tech). I want this unit to have master warning light. This light needs to come on when the EIS detects an alarm condition. I want the light to be a seperate gauge so that it can be placed anywhere on the panel for maximum visibility.Most of the examples in the Beech and 747 XML warning and annunciator gauges have left me confused.Most warning lights are independent gauges. Each gauge monitors a simulation value and lights up if it exceeds some parameter.The master warning light is also an independent gauge. However, it has a "many to one" relationship with the the flight display. It looks at (apparently) the mask status for the annunciator, which is just a bunch of complex gibberish to me.Here is my alarm code:

<Gauge Name="alarm" Version="1.0">   <Container/>   <Update Frequency="6"/>   <Image Name="eis_alarm_off.bmp" Bright="Yes" ImageSizes="27,25,27,25"/><!-- alarm for use with eis --><Element>	  <Select>		 <Value>(L:EIS Alarm, bool)</Value>		 <Case Value="1">			 <Image Name="eis_alarm_on.bmp" Bright="Yes" ImageSizes="27,25,27,25"/>		 </Case>	  </Select>	  <Failures>			<SYSTEM_ELECTRICAL_PANELS Action="0"/>		 </Failures>	  </Element> <!-- end low altitude alarm --><Mouse>	  <Help ID="HELPID_GAUGE_MASTER_CAUTION_LIGHT"/>	  <Cursor Type="Hand"/></Mouse></Gauge>

This essentialy is supposed to monitor a flag, L:EIS Alarm across gauges (the EIS gauge). When the EIS sets the flag the light should come on.The EIS code is too long to post here, it's three pages of readouts. But at the top I have code:

<Gauge Name="EIS" Version="1.0">   <Container/>   <Update Frequency="6"/>   <Image Name="eis_background.bmp" ImageSizes="170,88,170,88"/><!-- alarms --><Element>	  <Select>		 <Value>(A:indicated altitude, feet) 250 <=</Value>		 <Case Value="1">		   1 (>L:EIS Alarm)		 </Case>	 </Select></Element>... rest of EIS displays ...

This should tell the light to come on by setting L:FIS Alarm to one (true).But I get nothing.Here is a picture of it running. The light on the left is an independent low alt gauge to measure the EIS gauge by.Thanks,Steve

Share this post


Link to post
Share on other sites
Guest

Hi!In the EIS-Gauge you shouldn't forget the unit! (>L:EIS Alarm,BOOL)Then it should work!I've made this error also sometimes, so this is the first thing i look for! :-)regards,Franz

Share this post


Link to post
Share on other sites
Guest

Good catch! Thanks.I made the correction, but the warning light still does not come on.To debug this I made a simplifed version of the gauge. If the code itself does not work, then I know the problem is not with the linkage. Changing the L: to a G: var (because it appears that L: do not have scope within a gauge) and putting the two elements in one file resulted in the following code:

<Gauge Name="alarm3" Version="1.0">   <Container/>   <Update Frequency="6"/>   <Image Name="eis_alarm_off.bmp" Bright="Yes" ImageSizes="27,25,27,25"/><!-- test --><Element>	  <Select>		 <Value>(A:indicated altitude, feet) 250 <=</Value>		 <Case Value="1">		   1 (>G:Var1, bool)		 </Case>	 </Select></Element><Element>	  <Select>		 <Value>(G:Var1, bool)</Value>		 <Case Value="1">			 <Image Name="eis_alarm_on.bmp" Bright="Yes" ImageSizes="27,25,27,25"/>		 </Case>	  </Select>	  <Failures>			<SYSTEM_ELECTRICAL_PANELS Action="0"/>		 </Failures>	  </Element><Mouse>	  <Help ID="HELPID_GAUGE_MASTER_CAUTION_LIGHT"/>	  <Cursor Type="Hand"/></Mouse></Gauge>

It does not work. Unless I substitute the altitude expression for the variable retrieve in the second select element. There must be something wrong with my logic.Steve

Share this post


Link to post
Share on other sites
Guest

Hi!Another idea!You could write:(A:indicated altitude, feet) 250 > (A:indicated altitude, feet) 251 < That's a little bit shorter, i think it should work!regards,Franz

Share this post


Link to post
Share on other sites
Guest

Thanks. I really want the warning light to be activated by linked variables, but I will try substituting VISIBLE for the SELECT CASE logic.Steve

Share this post


Link to post
Share on other sites
Guest

Okay, I seem to have found a solution.The L: variable does work between gauges as intended. I made a mouse click even to flip flop the boolean value and the light responds.The problem was that the value was not being set or changed properly in the first gauge. After poking about in the 747 gauges I tried placing the store value to variable command in a TEXT element instead of a SELECT element (as you can see in the 747 gauges).

<Element> <Visible>0</Visible><Text Bright="Yes" X="60" Y="12" Length="10" Fixed="Yes" Font="Quartz" BackgroundColor="Black" Color="Red" Adjust="Center" VerticalAdjust="Center">			<String>%((A:indicated altitude, feet) 250 <= if{ 1 (>L:EIS Alarm, bool) } els{  0 (>L:EIS Alarm, bool) } )%!+3d!</String>		 </Text></Element><!-- Low Fuel --><Element><Visible>0</Visible><Text Bright="Yes" X="60" Y="12" Length="10" Fixed="Yes" Font="Quartz" BackgroundColor="Black" Color="Red" Adjust="Center" VerticalAdjust="Center">			<String>%((A:fuel total quantity, gallons) 2 <= if{ 1 (>L:EIS Alarm, bool) })%!+3d!</String>		 </Text></Element>

I had to restart FS before it would work. And I had to add an else clause to reset the flag for it to work reliably. Other alarms do not seem to require the reset else clause.Steve

Share this post


Link to post
Share on other sites
Guest Eugen

Hi,Maybe this will be of some help I am uisng in it two gauges that are linked.BrgdsEugenGauge 1 (L:ILS Mode,bool)(L:ILS Mode, bool) ! (>L:ILS Mode, bool)Gauge 2 (L:ILS Mode,bool)

Share this post


Link to post
Share on other sites

Hi all,I use this one:It warns with a FLASHING orange light (ALTITUDE) when drifting >200 ft + OR - from the altitude set in the autopilot; it stops when more than 500 feet away:(A:Autopilot altitude lock var, feet) (A:Indicated altitude, feet) - abs d 200 >= r 500 <= && (* left condition - right blink generator*) (P:absolute time, number) 1 % 0.5 > *

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