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

XML - variable problem

Messages
187
Country
us-california
This is FSX but I'm using the simpler FS9 XML.

I've been tearing out what little hair I have left trying to
understand why something that SEEMS so simple does
not work.

I am trying to construct code that will be dependent upon
several conditions and am adding them and testing as I
go along.

One variable test is giving me fits.

First, This basic code does what I want:

Code:
<Element> 
  <Select> 
   <Value>1 4 (A:Nav2 dme, nmiles) rng 
         if{ 1 (&gt;L:In_ZONE,bool) } 
           els{ 0 (&gt;L:In_ZONE,bool) }
   </Value>
  </Select>
</Element>

However adding another variable and it fails to work even
through a display of:
(A:NAV ACTIVE FREQUENCY:2,MHz) yields 117.95 Mhz

Code:
<Element> 
  <Select> 
   <Value>1.5 4 (A:Nav2 dme, nmiles) rng (A:NAV ACTIVE FREQUENCY:2,MHz) 117.95 == &amp;&amp;
         if{ 1 (&gt;L:In_ZONE,bool) } 
           els{ 0 (&gt;L:In_ZONE,bool) }
   </Value>
  </Select>
</Element>

Even this simple form does not work for some reason:

Code:
<Element> 
  <Select> 
   <Value>(A:NAV ACTIVE FREQUENCY:2,MHz) 117.95 == 
         if{ 1 (&gt;L:In_ZONE,bool) } 
           els{ 0 (&gt;L:In_ZONE,bool) }
   </Value>
  </Select>
</Element>

I know there are some rather unusual requirements vis a vis
the direct setting of the NAV 1 & 2 frequencies which had
me baffled until I happened upon the XML FAQ posts in
the Avsim Panels and Gauges forum. Seems one needs to
go through the process of converting the frequency to
4 digit BCD form, dropping the leading "1" before attempting
to inject it into the statement (&gt;K:NAV2_RADIO_SET).

I'm wondering what hoop I may need to jump through
to be able to test the tuned frequency of NAV 2.
Right now I have to do a brute force set mof the required
frequency which is not the way I wish to go as I want the
user to be able to detune that radio in order to deactivate
the feature I am coding.

TIA for any help/advice.

Paul
 
Last edited:
Back
Top