• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Setting Radio Nav frequency

Messages
39
Country
france
Hi all,

is it possible to set a radio nav frequency using the event NAV1_STBY_SET using XML and how ? (FSX SP2)

Thank you
 
L:Nav2Freq,number) (>K:NAV1_STBY_SET)

You will, of course, have to set the initial value for L:Nav2Freq,number yourself, and also add/subtract 0.50 as needed.
 
thank's for the tip.
i tried that
Code:
 <Script>
  1 (&gt;G:Var1)
  111 (&gt;L:MYNAV1,number)
  (L:MYNAV1,number) (&gt;K:NAV1_STBY_SET)
</Script>
but it seems not working...i displayed the result of (A:NAV STANDBY FREQUENCY:1, Megahertz) and the value dosen't change...
 
Did you configure your aircraft.cfg to ALLOW for standby NAV radios?

[Radios]
// Radio Type = availiable, standby frequency, has glide slope
Audio.1 = 1
Com.1 = 1, 0
Com.2 = 1, 0
Nav.1 = 1, 1, 1
Nav.2 = 1, 1, 1
Adf.1 = 1,0
Transponder.1 = 1
Marker.1 = 1
 
Well N4gix, you were right for the aircraft.cfg, but it seems that the event only switch from nav active to nav stby...because when i change the frequency with the buttons, the stby frequency change.
the value i pass is not given to the frequency...or there's a problem with the value i give...i did something like 111, probably i have to give 11100 or 111.00, because the SDK says "NAV1_STBY_SET Sets NAV 1 standby frequency (BCD Hz)"
 
[solved]

N4gix, you gave me the way...
i understood what was wrong...in fact the aircraft.cfg is to change if you use stdby freq for flights...for me it is used but in background, not for flying...so the value is set to 0 in this file (Nav.1=1,0,0)
the problem for the event key is to give the right value, with the right format...here it's BCD...
so you have to give something like 0x11130 for the freq 111.30
then everything works...which is for example
Code:
0x11130 (>K:NAV1_STBY_SET)

Thank's for your help and answers even if i found the problem myself...asking and speaking helps everytime for everything...it's brainstorming !

See you for other questions and problems.
 
No problem, Fred. Yes, if you wish to tune the active COM or NAV freqs directly, you do need to set the section in aircraft.cfg file to zero for the standby radios.

Then to tune the standby freqs you need to use the _SET key events as you've done.

I've only done this in a C gauge (which is honestly much more difficult), but understand the basic XML syntax. I did forget to mention the requirement to encode in BCD format... <oops!> :duck:

Here then is a <Macro> that will make life a bit simpler...

Code:
<Macro id="NAV1StbySet" Name="NAV1StbySet">
 <MacroValue>
	100 * 10000 % int (* 123.45 to 2345 *)
	d 10 % r 10 / int (* stack: 234 -&gt; 5 *)
	d 10 % r 10 / int (* stack: 23 -&gt; 4 -&gt; 5 *)
	d 10 % r 10 / int (* stack: 2 -&gt; 3 -&gt; 4 -&gt; 5 *)
	16 * + (* stack: 2*16+3 -&gt; 4 -&gt; 5 *)
	16 * + (* stack: (2*16+3)*16+4 -&gt; 5 *)
	16 * + (* stack: ((2*16+3)*16+4)*16+5 *)
     (&gt;K:NAV1_STBY_SET) 
  </MacroValue>
</Macro>


@NAV1StbySet(L:NAV1StandbyFreq,number)

Place the <Macro> script within your <Gauge> section. To use it, simply use @NAV1StbySet(L:NAV1StandbyFreq,number).

Set (L:NAV1StandbyFreq,number) in a <Mouse> routine and increment/decrement as you desire. :teacher:
 
Back
Top