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

Messages
520
Country
australia
HI
Ive been looking at this for a few days now and cant see the forest for the trees.
Code:
<Gauge Name="OhmyOhmy" Version="1.0">
  <Element>
    <Select>
      <Value>(L:prop,enum) 0 == if{ 0 25 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng 8939 (>K:PROP_PITCH1_SET) } 
    </Select>
 </Element>
</Gauge>
this is only one line for testing as I need to set the pitch automatically through the full throttle range....The issue? well as expected it loops
I just cant think of anything else for it to do, or the syntax to do it once and sit till the throttle go's into another range... I know its a simple issue but its got me stuffed :)
Thanks
Wozza
 
Edited because i misunderstood the original question (i think :D)

Hi,
As for the looping issue:
well you have the L:Prop, enum variable which you can use to prevent looping.
What you need to do is set that value to 1 for example after the prop pitch has been set:

Code:
<Gauge Name="OhmyOhmy" Version="1.0">
  <Element>
    <Select>
      <Value>(L:prop,enum) 0 == if{ 0 25 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng 8939 (>K:PROP_PITCH1_SET) 1 (&gt;L:prop,enum) } 
    </Select>
 </Element>
</Gauge>

This would set the prop pitch only once regardless of any future changes in throttle posn, since there is no functionality to reset L:Prop, enum to zero in the above code.
The question remains, what is the need for the throttle position in the code?
Can't you leave it out all together?

Code:
<Gauge Name="OhmyOhmy" Version="1.0">
  <Element>
    <Select>
      <Value>(L:prop,enum) 0 == if{ 8939 (>K:PROP_PITCH1_SET) 1 (&gt;L:prop,enum) } 
    </Select>
 </Element>
</Gauge>

This should set the prop pitch to the desired value upon initialization of the gauge. No more looping.
However, what if the pilot manually changes the prop pitch? Or is this not possible in your aircraft?

Hope this helps

grt
Willem
 
Last edited:
(Im a slow on the keyboard and testing as I write this :) )

Hi
Thanks Im in the ball park now :)
Ive got it sort of working using your(orig) suggested code,the pitch now go's through its full range in relation to the throttle without looping :)
Basically the code is for an ME109 which has an auto pitch adjust when the pilot throws the switch (L: prop) =1 the pitch has a fine manual adjustment
Only issue now is to include the prop bool so when at 1 it allows manual operation of the pitch control.......Oh what a mess lol might have to look into a way to prevent the code from running if prop,bool is 1... something like a macro or find some other dark magic :D
thanks again
Wozza
 
Last edited:
PS here is the full test code... I use all the element tags just to brake up the code for testing and editing on the fly ;)
Code:
<Gauge Name="OhmyOhmy" Version="1.0">
 <Update Frequency="6"/>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != if{ 0 54 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 8939 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } } 
      </Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != if{ 55 57 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 9343 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } } 
      </Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != if{ 58 65 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 10047 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } } 
      </Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != if{ 66 69 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 11455 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } }
      </Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != if{ 70 73 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 12159 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } } 
      </Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != if{ 74 76 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 12863 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } }
      </Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != if{ 77 81 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 13215 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } }
      </Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != if{ 82 90 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 13567 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } 
      </Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != if{ 91 93 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 14271 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } }
      </Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != if{ 94 96 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 15679 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } }
      </Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != if{ 96 100 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 16383 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } }
      </Value>
    </Select>
 </Element>
</Gauge>
 
Aha,
hmm i just edited my first answer thinking you meant something else than what i first thought you meant :D
But seeing the rest of the code makes things more clear.:idea:

I see that you got some of the code from that original answer so that's alright then.

If you already have a switch that controls the L:Prop, enum value, then you need to add an AND statement so as to check whether the throttle posn has changed and the prop switch position is in automatic (being the value of 0 in this case).
Now if L:Prop, enum = 1 ((or rather, not 0) being the manual position of the prop switch) the code is not executed and manual control of prop pitch should be possible.
Bear in mind that upon initialization of the gauge this L:Var will have a value of 0 by default.

Code:
<Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != (L:Prop,enum) 0 == &amp;&amp; if{ 0 54 (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) rng if{ 8939 (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } } 
      </Value>
    </Select>
 </Element>
 
Another brainwave came up.

Why not link the prop pitch directly to the throttle posn?
This way it should move even smoother since you don't have the sections of ranges anymore.
The throttle range is in percentages, so multiply that by 163.83 to obtain a linear increase to the prop pitch setting of 16383 for its upper limit at full throttle.

Code:
Element>
    <Select>
      <Value>(A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (L:Throttle,enum) != (L:Prop,enum) 0 == &amp;&amp; if{ (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) 163.83 * (>K:PROP_PITCH1_SET) (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) (&gt;L:throttle,enum) } 
      </Value>
    </Select>
 </Element>

Hope this helps!

grt
Willem
 
Last edited:
Hi
Unfortunately the auto pitch setting isn't linear.....not to mention it still has to be calibrated, the # for the rng and set command are just place holders at the mo :)
Hmm just tried you suggestion in the other message and it worked YaY! ..I would have sworn I tried that last night and it didnt work :)
then again it was 3 to 6 am :)
thanks for all your help.. now I just need to spend hrs of flight testing calibrating it all :)
Wozza
 
Back
Top