• 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 Why is this pulsing?

Messages
10,163
Country
us-arizona
Hey guys,

I have tried all I know to keep this from pulsing. I trigger this off of a L:var on a switch in the VC.

This is from the hidden gauge which fires the alternators and starters, but there seems to be issues. The Alternator just pulses. It should be on or off. I have tried putting in 'quit' and 'els'. Any suggestions?

The starter also fails to turn on. :( The 'system sync' (this gauge) is designed to turn off the Starters and Alternators when the plane boots up, and also set certain switches to default positions (1 instead of 0), etc.


Code:
<Gauge Name="System Sync" Version="1.0">
  <Size X="5" Y="5" />

<Element>
<Select>
<Value>
(L:Has_Initialized, bool) ! if{ 
    1 (>L:LJ24 HYDRAULIC PUMP, bool) 
    1 (>L:LJ24B BATT MASTER LEFT, bool)
    1 (>L:LJ24B BATT MASTER RIGHT, bool)
   25 (>L:LEFT_GEN_SELECT_POS,number)
      (>K:TOGGLE_STARTER1)
      (>K:TOGGLE_STARTER2)
      (>K:TOGGLE_ALTERNATOR1)
      (>K:TOGGLE_ALTERNATOR2)
    1 (>L:Has_initialized, bool)
      }
  </Value>
</Select>
</Element>


<!-- Turn On Left Generator -->

<Element>
<Select>
<Value>
                (L:LEFT_GEN_SELECT_POS,number) 50 ==
                   if{ (>K:TOGGLE_ALTERNATOR1) quit }
                  els{ 0 }
  </Value>
</Select>
</Element>

<!-- Turn Off Left Generator -->
<Element>
<Select>
<Value>
              (L:LEFT_GEN_SELECT_POS,number) 49 &gt;
              (A:GENERAL ENG GENERATOR SWITCH:2, bool) 1 ==
              and
                   if{ (>K:TOGGLE_ALTERNATOR1) quit }
                  els{ 0 }
  </Value>
</Select>
</Element>

<!-- Turn off Left Starter When Not In Startup Mode -->
<Element>
<Select>
<Value>
       (L:LEFT_GEN_SELECT_POS,number) 1 &gt;
       (A:GENERAL ENG STARTER:1, bool) 1 ==
       and
          if{ (>K:TOGGLE_STARTER1) }
         els{ 0 }

  </Value>
</Select>
</Element>

<!-- Turn off Left Starter When Not In Startup Mode -->

<Element>
<Select>
<Value>
       (L:LEFT_GEN_SELECT_POS,number) 0 &lt;
       (A:GENERAL ENG STARTER:1, bool) 0 ==
       and
          if{ (>K:TOGGLE_STARTER1) }
         els{ 0 }
  </Value>
</Select>
</Element>

</Gauge>
 
I forgot about adding a flag. I got it to turn on, but now I cannot seem to wire it to turn off. Its defying my abilities of logic.


Code:
<!-- Turn On Left Generator -->

<Element>
<Select>
<Value>
                (L:LEFT_GEN_FLAG,number) 0 ==
                (L:LEFT_GEN_SELECT_POS,number) 50 ==
                and
                   if{ (>K:TOGGLE_ALTERNATOR1)
                     1 (>L:LEFT_GEN_FLAG,number) quit }
                  els{ 0 }
  </Value>
</Select>
</Element>

<!-- Turn Off Left Generator -->

<Element>
<Select>
<Value>

              (L:LEFT_GEN_SELECT_POS,number) 49 &gt;
              (A:GENERAL ENG GENERATOR SWITCH:2, bool) 1 ==
              and
                   if{ (>K:TOGGLE_ALTERNATOR1) }
                  els{ 0 }

  </Value>
</Select>
</Element>


I also tried adding a flag on the off side, which causes pulsing and still doesn't allow for shut down of the Alternator1 toggle.

Code:
<!-- Turn On Left Generator -->

<Element>
<Select>
<Value>
                (L:LEFT_GEN_FLAG,number) 0 ==
                (L:LEFT_GEN_SELECT_POS,number) 50 ==
                and
                   if{ (>K:TOGGLE_ALTERNATOR1)
                     1 (>L:LEFT_GEN_FLAG,number) quit }
                  els{ 0 }
  </Value>
</Select>
</Element>

<!-- Turn Off Left Generator -->

<Element>
<Select>
<Value>
              (L:LEFT_GEN_FLAG,number) 1 ==
              (L:LEFT_GEN_SELECT_POS,number) 49 &gt;
              (A:GENERAL ENG GENERATOR SWITCH:2, bool) 1 ==
              and and
                   if{ (>K:TOGGLE_ALTERNATOR1)
                     0 (>L:LEFT_GEN_FLAG,number) quit }
                  els{ 0 }

  </Value>
</Select>
</Element>

Does anyone see what I might be doing wrong on this?


Why would they have toggles only on key commands. I don't get it. If only there was an easy way to on/off command a toggle. sigh......
 
I got it working right. In the hidden gauge, all I am doing is setting the switch to 'off' and turning off the Generators (Alternators).

I then was able to work the on/off condition logic inside the ModelDef 'switch' code. Working lovely. :D

Code:
<CallbackCode>
      (M:Event) 'LeftSingle' scmp 0 ==
      if{
        (M:Y) (&gt;L:LEFT_GEN_MOUSEPOS,number)
                 1 (&gt;L:XMLSND1,enum)
        quit
      }
    
      (M:Event) 'LeftDrag' scmp 0 ==
      if{
        (M:Y) (L:LEFT_GEN_MOUSEPOS,number) - -1.1 * (L:LEFT_GEN_SELECT_POS,number) + 0 max 50 min (&gt;L:LEFT_GEN_SELECT_POS,number)
        (M:Y) (&gt;L:LEFT_GEN_MOUSEPOS,number)
                   quit
            (M:Y) (L:RIGHT_GEN_SELECT_POS,number) 0 ==
                    if{ (A:GENERAL ENG STARTER:1, bool) 0 ==
                      if{ (>K:TOGGLE_STARTER1) } }
      }
    
      (M:Event) 'LeftRelease' scmp 0 ==
      if{
            (M:Y) (L:LEFT_GEN_SELECT_POS,number) 5 &lt;
        if{
                25 (&gt;L:LEFT_GEN_SELECT_POS,number)
                 1 (&gt;L:XMLSND1,enum)

        }
        (M:Y) 6 45 (L:LEFT_GEN_SELECT_POS,number) rng
        if{
                25 (&gt;L:LEFT_GEN_SELECT_POS,number)
                   (A:GENERAL ENG GENERATOR SWITCH:1, bool) 1 ==
                     if{ (>K:TOGGLE_ALTERNATOR1) }
                   (A:GENERAL ENG STARTER:1, bool) 1 ==
                     if{ (>K:TOGGLE_STARTER1) }

        }
        (M:Y) (L:LEFT_GEN_SELECT_POS,number) 46 &gt;
        if{
                50 (&gt;L:LEFT_GEN_SELECT_POS,number)
                   (>K:TOGGLE_ALTERNATOR1)
        }
      }
            </CallbackCode>

The starter isn't though. :(
 
Back
Top