Jump to content
Sign in to follow this  
n4gix

ADF Gauge Help

Recommended Posts

Guest greenco

I have made a " ADF " digital gauge, that shows me the direction to the NDB. I have a radio stack that, I use to tune in the various radio frequencies. The ADF gauge works great, however if I am not within range of the NDB or I do not have a frequency tuned in, the gauge always reads 90 degrees (i guess this is the default). I would like for the gauge to display a few dashes, if I do not have a frequency tuned in. If I am tuned to a ADF frequency, then I want the gauge to show me the direction to the NDB.Here is the code that I am using for the gauge. I can't find any combination of "IF" "ELSE" statements that work. Is there a boolean value that could be used to check on the ADF status. There must be a simple solution, but I haven't found it.(A:Circuit general panel on, bool)(G:Var2) 0 == (A:Avionics master switch, bool) &&%(360 (A: Plane heading degrees gyro, degrees) (A:ADF1 Radial,degrees) + dnor near d 0 == ?)%!03d!° To NDB Thanks greenco

Share this post


Link to post
Share on other sites

I believe you might want to check the value in ADF SIGNAL STRENGTH.


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites
Guest greenco

Thanks, that did it. I was trying to place some code inside of the gauge "elements" and all I neede to do was use this line of code:(A:ADF1 SIGNAL, bool)If I don't have a signal tuned in, the gauge is blank. That is OK because when I get a reading I know I am in range of the NDB that I have tuned.Thanks again

Share this post


Link to post
Share on other sites
Guest greenco

I am still trying to get my ADF gauge to display "dashes" when I am not tuned to a ADF frequency. Why does this code not work?if(A:ADF1 SIGNAL, bool){ %(360 (A: Plane heading degrees gyro, degrees) (A:ADF1 Radial,degrees) + dnor near d 0 == ?)%!03d! }els{ - - - }If I omit the last line with the "els" condition it works like this. If I DO have a frequency tuned it it shows me the direction to the NDB. If I DO NOT have a frequency tuned in, it displays " 090 " . If I leave the last line with the "els" condition in the code, the gauge displays - - - ,all the time, regardless if I have a frequency tuned or not.

Share this post


Link to post
Share on other sites

You have your if in the wrong place! You have to think "in reverse..."(A:ADF1 SIGNAL, bool)if{ %(360 (A: Plane heading degrees gyro,degrees) (A:ADF1 Radial,degrees) + dnor near d 0 ==?)%!03d! }els{ - - - }


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

Try this%((A:ADF1 SIGNAL, bool))%{if}%( 360 (A:Plane heading degrees gyro,degrees) (A:ADF1 Radial,degrees) + dnor near d 0 == ?)%!03d!%{else}-------%{end}


Paul EGLD

Share this post


Link to post
Share on other sites
Guest greenco

Thanks Bill and pve.Bill I could not get your example to work. It displayed "dashes" all the time, regardless if a frequency was tuned in or not.pve, your example worked great! I have placed the code into my XML archive for future reference.

Share this post


Link to post
Share on other sites

>Thanks Bill and pve.>>Bill I could not get your example to work.That's not too surprising, as I suck at XML myself... ;)I'm a dyed-in-the-wool C coder...


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

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