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

FSXA KEAS Variable

Messages
75
Country
unitedstates
I am trying to make a simple xml that will save an L: variable, no switches this time. I seem to be having difficulty and I am not sure why

Code:
0(>A:AIRSPEED TRUE , KNOT)
if{ 
(A:AIRSPEED TRUE , KNOT) (A:AMBIENT DENSITY , SLUGS) 0.002378 / * sqrt (>L:KEAS , NUMBER) }

I also tried

Code:
(A:AIRSPEED TRUE , KNOT) != (L:KEAS , number)
if{ (A:AIRSPEED TRUE , KNOT) (A:AMBIENT DENSITY , SLUGS) 0.002378 / * sqrt (>L:KEAS , NUMBER) }

but I get a 0 value for L:KEAS.

Thanks in advance for any help.
 
The first snippet don't work because you are trying to assign a value to a A:variable which is not possible.

The if-part of the second snippet is in the wrong order. Try:
Code:
(A:AIRSPEED TRUE , KNOT) (L:KEAS , number) !=
if{ 
  (A:AIRSPEED TRUE , KNOT) (A:AMBIENT DENSITY , SLUGS) 0.002378 / * sqrt (>L:KEAS , NUMBER) 
}

Regards
Vitus
 
Using this code L:KEAS , NUMBER is still being returned as 0. :confused:

If I understand correctly, the gauge is instructing:

If (A:AIRSPEED TRUE, KNOT) is not equal to (L:KEAS , NUMBER) then

(L:KEAS , NUMBER) = sqrt((((A:AIRSPEED TRUE, KNOT)*(A:AMBIENT DENSITY , SLUGS))/0.002378)
Code:
<Gauge Name="keas">
   <Element>
      <Select>
         <Value> 
			(A:AIRSPEED TRUE , KNOT) (L:KEAS , NUMBER) !=
			if{ 
				(A:AIRSPEED TRUE , KNOT) (A:AMBIENT DENSITY , SLUGS) * 0.002378 / sqrt (&gt;L:KEAS , NUMBER)
			}
      </Value>
      </Select>
   </Element>
</Gauge>

I tried (A:AIRSPEED TRUE , KNOT) 0 &gt;= . . .
and
(A:AIRSPEED TRUE , KNOT) 0 != . . .

but every time the L value always comes back 0

it should be (L:KEAS , NUMBER) = sqrt( ( ( (A:AIRSPEED TRUE , KNOT) * (A:AMBIENT DENSITY , SLUGS) ) / 0.002378 ) )

Even

Code:
			(A:AIRSPEED TRUE , KNOT) (L:KEAS , NUMBER) !=
			if{ 
				2 (&gt;L:KEAS , NUMBER)
			}

returns L:KEAS as 0. I am very lost
 
I am not sure about that, but try lowercase for the units. I found that sometimes lowercase seems to be required for that. So for instance instead of:
Code:
(A:AIRSPEED TRUE , KNOT)
try:
Code:
(A:AIRSPEED TRUE , knots)

err... yes. knots with s!

But this is just a wild guess, I don't know if it will solve your problems. Check if the A:AIRSPEED TRUE variable returns a value != 0 in the first place.

Vitus
 
Thanks! Tried that too. I am going to see if TAS returns a !=0

confused.jpg


at 49.77 TAS, KEAS should be reading 40.92. but it is still 0. :confused::banghead:

Code:
(A:AIRSPEED TRUE , knots) 0 !=
if{ 
	(A:AIRSPEED TRUE , knots) (A:AMBIENT DENSITY , slugs) * 0.002378 / sqrt (&gt;L:MYAIRSPEED , number)
}

that makes according to the infix to postfix converter: (L:MYAIRSPEED , number) = sqrt( ( ( (A:AIRSPEED TRUE , knots) * (A:AMBIENT DENSITY , slugs) ) / 0.002378 ) );

Can someone else try running it. Maybe its somehow on my end?


I tested != 0

using

Code:
			(A:AIRSPEED TRUE , knots) 0 !=;
			if{ 
				1 (&gt;L:TAS , number)
			}

Result on black box was 0

i tried

Code:
			(A:AIRSPEED TRUE , knots) 20 &lt;
			if{ 
				1 (&gt;L:TAS , number)
			}

while not moving and TAS was 0 in black box

L:TAS was still reporting 0
 
Last edited:
I didn't check your complex example but the last code snippet you posted. The result: the same. It didn't work. BUT if you delete the blanks before and after the decimal point, it will work.
Try:
Code:
        (A:AIRSPEED TRUE,knots) 20 &lt;
        if{
          1 (&gt;L:TAS,number)
        }

YES: XML coding is strange indeed.

Regards
Vitus
 
Vitus

How are you testing the value? In Black box I am still getting a 0 value. Do I need to make a text readout that is in the panel? Is there a limitation on Black Box that I was unaware of?

Thanks for all the help!

confused2.jpg
 
Last edited:
I don't use blackbox - I programmed a small debug gauge for these purposes. It consists of several GaugeString Elements that show the status of various variables.
I added the code posted above to an update object and added the line:
Code:
TAS:..................%((L:TAS,number))%!1.1!
to my debug gauge. And it showed 1.0.

Are you sure that the gauge/element that contains your code is embedded in your panel.cfg and updated?
 
I tried putting the gauge in the 172 in place of the flaps gauge and i have the same results

Black Box code string looks similar

Code:
<String>%((L:TAS,number))%!13.2f!%(' L:TAS')%!-6s!</String>

It just reads the variables in the gauge. Maybe I am missing something more basic. But I will try to place the string in a real gauge right now.

Code:
<String>%((A:AIRSPEED TRUE , knots) (A:AMBIENT DENSITY , slugs) * 0.002378 / sqrt)%!3.0f!</String>

It works when I replaced the default KEAS string gauge with the new but I am still worried why I could not get black box to read.

I have a feeling the issue is currently the one typing this message. :rolleyes:

Well now that issue is resolved, back to the EGT gauge which is still giving me a similar issue.

Thank you very much Vitus for your wonder patience and help.
 
Last edited:
I lied
Code:
<string>%((A:AIRSPEED TRUE,knots) (A:AMBIENT DENSITY,slugs) 0.002378 / sqrt *)%!3.0f!</string>
is the correct equation, which makes the string useless and the gauge disappear

it is supposed to be TAS x sqrt((ambient density/0.002378))
 
Last edited:
So for (A:Ambient Density,slugs) I am getting a reading of 0.03 which at 33,000 feet it is actually 0.0077 - in FS according to FS.

What variable would tell me the density of the air at the altitude of the aircraft?

Im going to take a break. Been working too long at this.
 
I didn't check your complex example but the last code snippet you posted. The result: the same. It didn't work. BUT if you delete the blanks before and after the decimal point, it will work.

YES: XML coding is strange indeed.

Regards
Vitus

Actually, XML syntax follows very precise, literal rules, and spaces are critical!

For example, in this example, the trailing comma delimits the end of the variable name:

(A:AIRSPEED TRUE , knots)

Consequently, it will fail because the space between the E and the , becomes part of the variable's name, which is not recognized by the parser!

In the example below, the extra spaces after the comma delimiter are ignored, so the expression will still be parsed and evaluated correctly.

(A:AIRSPEED TRUE, knots)
 
Well, to be technically acurate, XML doesn't care about whitespace at all. The sections you guys are talking about aren't technically XML, they are just payload data in an XML element (in this case, RPN script code). It's the RPN Script parser that both the panel and animation systems use that is picky about spaces (why whoever did the XML gauge system originally thought allowing spaces in the var names was a good idea, I have no idea; but then again, I also haven't figured out why they thought RPN was a good idea either :-> ).
 
Okay, I should have been more explicit. The schema used for gauge XML script is fussy about white space(s).

In any event, xxx , is invalid; xxx, is valid. :D

BTW, you've conflated this thread with another, as this has nothing to do with payload stations... :stirthepo:rotfl:
 
Last edited:
Wow Thanks a lot. That has been very informative. Thank you for all the help. I noticed whitespace is critical in xml....grr.
 
Back
Top