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

FS2004 Digital negative readouts problem (SOLVED)

Messages
1,451
Country
mexico
Hello all

This weekend I am trying to get work some digital readouts for the Bell 429. Nevertheless, I am having bad time displaying readings from variables below to zero. When the values are below to cero, FS9 returns garbage values. I am trying this code and I can't figure out what's wrong.

HTML:
<Element>
<Position X="120" Y="20"/>
   (A:ENG1 TRANSMISSION TEMPERATURE, celsius) 20 &gt;
        if{
            <FormattedText X="150" Y="20" Font="Arial" FontSize="20" Color="#05DA23" Adjust="Center" VerticalAdjust="Center" Bright="Yes">
              <String>%((A:ENG1 TRANSMISSION TEMPERATURE,celsius))%!0.3d!</String>
            </FormattedText>
           }
        els{
             <FormattedText X="150" Y="20" Font="Arial" FontSize="20" Color="#FFFFFF" Adjust="Center" VerticalAdjust="Center" Bright="Yes">
               <String>WARN</String>
             </FormattedText>
            }
</Element>

In advance, thank you.
Sergio.
 
Last edited:
I note that the Units for that A:Var are Celsius scalar 16K (Degrees * 16384) according to SDK. Does that explains your results??

Bob
 
Last edited:
Hello Bob

I am confused, I don't get it. I am not a programmer and I just can't see the problem. Would you mind to elaborate?

Thank you.
Sergio.
 
Hello Bob

Ok, It's a scalar, which means I need an absolute temperature scale; like rankine. So, I need to convert the reading to Celsius; store the value and print the value. In a single prhase, I don't have a clue how to do it. I will studying the problem from a different angle.

Thank you.
Sergio.
 
Last edited:
Well

Changing the code for:

HTML:
<Element>
   <Position X="120" Y="20"/>
     (A:ENG1 TRANSMISSION TEMPERATURE, rankine) 491.67 &gt;
     if{
        <FormattedText X="150" Y="20" Font="Arial" FontSize="20" Color="#05DA23" Adjust="Center" VerticalAdjust="Center" Bright="Yes">
          <String>%((A:ENG1 TRANSMISSION TEMPERATURE, rankine) 491.67 - 1.8 /)%!0.2d!</String>
        </FormattedText>
       }
   els{
         <FormattedText X="150" Y="20" Font="Arial" FontSize="20" Color="#FFFFFF" Adjust="Center" VerticalAdjust="Center" Bright="Yes">
            <String>%(((A:ENG1 TRANSMISSION TEMPERATURE, rankine) 491.67 - 1.8 /) /-/)%-%!2d!</String>
         </FormattedText>
       }
</Element>

Does not solve the problem either... I'd keep trying.
 
Hello Walter

Thank you, in the next code; not even the 491.67 (0 ºC) restriction worked:
HTML:
<Element>
   <Visible>(A:ENG1 TRANSMISSION TEMPERATURE, rankine) 491.67 &gt;</Visible>
   <Position X="120" Y="20"/>
      <FormattedText X="150" Y="20" Font="Arial" FontSize="20" Color="#05DA23" Adjust="Center" VerticalAdjust="Center" Bright="Yes">
         <String>%((A:ENG1 TRANSMISSION TEMPERATURE, rankine) 491.67 - 1.8 /)%!0.3d!</String>
      </FormattedText>
</Element>

And if I understood well, what's the difference between !03d! and !0.3d!
I only know the second format :oops:

In any event, that not work with either. So much pain just to show a variable...

Sergio.
 
Last edited:
I was thinking that decimals don't mix well with integers...

HTML:
  <Element>
    <Visible>(A:ENG1 TRANSMISSION TEMPERATURE, rankine) 491.67 &gt;</Visible>
    <Position X="120" Y="20"/>
        <FormattedText X="150" Y="20" Font="Arial" FontSize="20" Color="#05DA23" Adjust="Center" VerticalAdjust="Center" Bright="Yes">
           <String>%((A:ENG1 TRANSMISSION TEMPERATURE, rankine) 491.67 - 1.8 /))%!3.2f!</String>
        </FormattedText>
  </Element>

  <Element>
    <Visible>(A:ENG1 TRANSMISSION TEMPERATURE, rankine) 491.67 &lt;</Visible>
    <Position X="120" Y="20"/>
        <FormattedText X="150" Y="20" Font="Arial" FontSize="20" Color="#05DA23" Adjust="Center" VerticalAdjust="Center" Bright="Yes">
           <String>%(((A:ENG1 TRANSMISSION TEMPERATURE, rankine) 491.67 - 1.8 /)) abs)%-%!3.2f!</String>
        </FormattedText>
  </Element>

The FSX SDK just states as...rankine (no futher information about it is an integer, double, float or anything else). Same with FS9 SDK; It's nice to be so naive...
Sergio.
 
Last edited:
!0.3d! gives readout to 3 decimal places , ie; 0.458

!03d! gives readout as 3 figures , ie; 327 or 028 or 005

!03d! do not precede with zero if negative readout is required , instead use !3d!

!3.2f! gives readout as figure to 2 decimal places , ie; 5.48

Cheers
karol
 
Last edited:
Sergio,

I have tried your code and it always comes up with 'WARN'. I also displayed (A:ENG TRANSMISSION TEMPERATURE:1, celsius) and (A:ENG1 TRANSMISSION TEMPERATURE, celsius) and it always displays 0.00 (even when multiplied by 16384!). Displayed as rankine it shows 492.

I use FS9 and am in a C172. Does this reading only pertain to helicopter engines?

Walter
 
I would be interested in hearing under what operational circumstances your
transmission temperatures would fall below zero ?

Even at altitude the insides of a transmission unit would be running hot ,
even in arctic conditions the transmission (lubricant) would need to be
pre heated along with the helicopter engine before start up .
it may well be that negative temperatures (below zero) are not modelled in the sim .

Cheers
Karol
 
According to the FSX and P3D SDKs, I do not have the FS9 one, this variable only applies to the Bell helicopter.
As Bob said, it's units are degrees celsius * 16384 so it only covers positive degrees celsius. As Karol said you would hardly ever get negative transmission temps.
Also the variable is ENG TRANSMISSION TEMPERATURE and there is only one of those transmission drives in a Bell so you do not need to call it "eng1"
Roy
 
Hello All

@Mr. Walter:
I know, it's garbage only. Since I am not a programmer, and certainly the lesser HTML creature in the flight simulator food chain (LOL). Unfortunatelly, in this area I am relying in my own skills to read codes provided by very kind members and learn the best I can of it.
@Karol:
Well, it happens just when I am testing the aicraft in very cold conditions: Dog Fish Bay, Alaska. Real weather @ -15 ºC.
@Mr. Holmes:
You are right! I miss that one and makes sence; the helicopter is "configured" in the aircraft.cfg Bell_429.air files to have three engines.
The main purpose of this configurations, are to simulate the best I can a twin engine helicopter; where "Engine 1" is to simulate both rotors sounds,
"Engines 2 and 3" to control turbines via gauge creation.

I must point, that I am following a tradition of this started by the former gauge designers and the creators of this system. As far as I know,
Jordan Moore, Thomas Röhl and George Arana, are the most succesful people in FS9 achieving these. I have written permission from all of them
to use their gauge code. Right now, I am trying to combine all this technology depending on the gauge nature.

From Jordan and George, I am learning analog gauges and from Thomas, Uwe Inger, Ken Mitchell and Manuel Gonzalez digital gauges!. Since the 429 has both kinds, I am trying to "link" all ideas in one.

Thank you very much for taking time to read and reply this thread!
Kindest regards,
Sergio.
 
Now we are talking about!

HTML:
<Element>
  <Visible>(A:Circuit general panel on, bool) 1 == (L:Eng2Running,bool) 1 == &amp;&amp;) &#124;&#124; 
              (A:Circuit general panel on, bool) 1 == (L:Eng3Running,bool) 1 == &amp;&amp;</Visible>
  <Position X="526" Y="870"/>
     <FormattedText X="150" Y="20" Font="Arial" FontSize="20" Color="#05DA23" Adjust="Center" VerticalAdjust="Center" Bright="Yes">
       <String>%((A:ENG TRANSMISSION TEMPERATURE, celsius) abs)%!0.2d!</String>
     </FormattedText>
</Element>

<Element>
   <Visible>(A:Circuit general panel on, bool) 1 == (L:Eng2Running,bool) 0 == &amp;&amp;) &#124;&#124; 
               (A:Circuit general panel on, bool) 1 == (L:Eng3Running,bool) 0 == &amp;&amp;</Visible>
   <Position X="526" Y="870"/>
      <FormattedText X="150" Y="20" Font="Arial" FontSize="20" Color="#05DA23" Adjust="Center" VerticalAdjust="Center" Bright="Yes">
         <String>- - -</String>
      </FormattedText>
</Element>

This worked for me! Thank you all.
Sergio.
;)
 
Hello lads

Just as a note: I don't know why the logical operator OR stated as || in the SDK, only worked for me if I use its equivalent in the ASCII code for HTML; that is &#124;&#124;

Bye.
 
FS9/FSX will take "and" and "or" just fine. No need to bother with the stupid "&amp;&amp;" and "||".
 
Just as a note: I don't know why the logical operator OR
The operator "or" must be lower case, and must have a space before it. I habitually place a space before and after it...

Also, both variables to be compared must come before the operator(s), e.g.,

Code:
a b or
 
a b and
 
Hello

I see... I was suffering because of this nonsens using the wrong code. Perhaps is the programm I am using to buld text is doing that. It is not the default notepad and it provides me with visual assistance for indentation. Very often I miss a semicolon, or even an ending <\Element> :duck:

Bill and Heretic, thank you both.
Kindest regards,
Sergio.
 
Hi all!

Ji! for example, within the code I posted (seen with fresh eyes) I noted a big error and... it is working??? I will rewrite it using colors:

(A:Circuit general panel on, bool) 1 == (L:Eng2Running,bool) 1 == &amp;&amp;) &#124;&#124; (A:Circuit general panel on, bool) 1 == (L:Eng3Running,bool) 1 == &amp;&amp;

Following this, a question has arisen. If I need to enclose and logically evaluate several conditions, it would work if I write it as follows? For example:

<Visible>((A:Circuit general panel on, bool) 1 == (L:Eng2Running,bool) 1 == and) ((A:Circuit general panel on, bool) 1 == (L:Eng3Running,bool) 1 == and) or <\Visible>

I know boolean algebra; nevertheless it seems to fail for me in HTML. The blue brackets as far as I understand, conforms a single returned value, evaluating the "true if equal" expresions first. So the first pair of blue brackets would be "a" evaluated first with "and". The second blue brackets (if the first condition is well conformed) must be "b" with the two expressions inside "ANDed". Lets take the case where:

a1, b1 => (A:Circuit general panel on, bool) 1 ==
a2 => (L:Eng2Running,bool) 1 ==
b2 => (L:Eng3Running,bool) 1 ==
v => Visibility return value

Bulding the logical tables:
LOGICAL_TABLES.jpg


Greetings,
Sergio.
 
Following this, a question has arisen. If I need to enclose and logically evaluate several conditions, it would work if I write it as follows? For example:

<Visible>((A:Circuit general panel on, bool) 1 == (L:Eng2Running,bool) 1 == and) ((A:Circuit general panel on, bool) 1 == (L:Eng3Running,bool) 1 == and) or <\Visible>

No, no need to add extra brackets. FS parses text code sequentially and put values and evaluation results on the stack in the same way.
So, your example works as:

<Visible>(A:Circuit general panel on, bool) (L:Eng2Running,bool) and (A:Circuit general panel on, bool) (L:Eng3Running,bool) and or</Visible> (mind / goes instead of \)

boolean values return 1 or 0, then no need to compare using 1 == or 0 ==

Tom
 
Back
Top