FSDeveloper Community

Go Back   FSDeveloper Community > FSDeveloper Wiki

XML: Set ADF Frequency

From FSDeveloper Wiki

[edit] XML: Set ADF Frequency

We need to convert the desired ADF Frequency (KHz) to BCD format. This simple @Macro will do the job painlessly for us.

Note the use of lower case L in l0 and l2, this is not a number 1:

e.g., s2 l0 10 / flr 10 % 16 * l2 +

<Macro Name="SetADF">
       (* UPDATE ADF FREQUENCY *)
       @1 10000 * s0 10 %
       s2 l0 10 / flr 10 % 16 * l2 +
       s2 l0 100 / flr 10 % 256 * l2 +
       s2 l0 1000 / flr 10 % 4096 * l2 +
       s2 l0 10000 / flr 10 % 65536 * l2 +
       s2 l0 100000 / flr 10 % 1048576 * l2 +
       s2 l0 1000000 / flr 10 % 16777216 * l2 +
       s2 l0 10000000 / flr 10 % 268435456 * l2 +
       s2 (>K:ADF_COMPLETE_SET)
</Macro>

Usage:

@SetADF((L:ADF1 Frequency,Khz))

All times are GMT -4. The time now is 16:06.

Kirsch designed by Andrew & Austin


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Powered by vbWiki Pro 1.3 RC4. Copyright ©2006-2007, NuHit, LLC