• 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 Switching between generator voltages

Messages
1,468
Country
italy
Now that my switch is working I have noticed an anomaly which I have tried to resolve without success. If say I switch to Gen1 and gen1 is live I will get a voltage. If whilst the switch is selected to gen1 it goes off line then the voltage stays the same whereas it should of course go to zero.
This is the code for gen2 which gives an example and forces me to reset the switch if I think there is a voltage change.
Code:
   <Element>
      <Select>
         <Value>(A:Electrical genalt2 bus voltage,volts) 0 == if{ (A:Electrical genalt2 bus voltage,volts) (>L:Electrical genalt2 bus voltage,volts) } (A:Electrical genalt2 bus voltage,volts) 0 &gt;
        if{ (A:Electrical genalt2 bus voltage,volts) 87 + (>L:Electrical genalt2 bus voltage,volts) }</Value>
      </Select>
   </Element>This is a separate control gauge

<Click>0 (&gt;G:Var1) 1 (>L:Sound_click,enum) 0 (>L:AC_volts,number) (L:E2GEN_running,bool) 1 ==
        if{ (A:Electrical genalt2 bus voltage,volts) 87 + (>L:AC_volts,number) 5 (>L:needle flicker2, volts) }</Click>

This is an attempt to force the voltage to change without the switch changing its postion which doesn't work. A fourth attempt. It seemed to work in my mind but then with all the stuff I am having to take for my current ailment being two thirds the way through chemotherapy my mind isn't as straight as is should be probably:yikes:
Code:
<Value>(L:Electrical genalt1 bus voltage,volts) (L:AC_volts,number) &gt; (L:Electrical genalt1 bus voltage,volts) (L:AC_volts,number) &lt; | (L:X_check2,bool) 1 == and if{ 1 (&gt;G:Var1) 2 (>L:X_check2,bool) }</Value>

Click>1 (&gt;G:Var1) 1 (>L:Sound_click,enum) 0 (>L:AC_volts,number) (L:E1GEN_running,bool) 1 ==
         if{ (L:Electrical genalt1 bus voltage,volts) (>L:AC_volts,number) 6 (>L:needle flicker2, volts) (L:X_check2,bool) 2 ==
         if{ 1 (>L:X_check2,bool) } }</Click>
 
Last edited:
Code:
(L:Electrical genalt1 bus voltage,volts) (L:AC_volts,number) &gt; (L:Electrical genalt1 bus voltage,volts) (L:AC_volts,number) &lt; |

What's that supposed to do? Wouldn't "(L:Electrical genalt1 bus voltage,volts) (L:AC_volts,number) !=" be way easier?

Also, check (L:X_Check,bool)'s unit considering that you're assigning it a value of 2.
 
Code:
(L:Electrical genalt1 bus voltage,volts) (L:AC_volts,number) &gt; (L:Electrical genalt1 bus voltage,volts) (L:AC_volts,number) &lt; |

What's that supposed to do? Wouldn't "(L:Electrical genalt1 bus voltage,volts) (L:AC_volts,number) !=" be way easier?

Also, check (L:X_Check,bool)'s unit considering that you're assigning it a value of 2.

I'll try both your suggestions H. Many thanks.
 
Hi H,
Unfortunately the AC volts needle steadfastly refuses to move from zero to 115 when the generator goes live. If I click away and back again it works but that is not really correct is it? The (L:Electrical genalt1 bus voltage,volts) does change but it doesn't feed into (L:AC_volts,number) unless I re-click the switch.
 
Last edited:
And if you try another unit for "L:AC_Volts", like "enum" or "volts"?

Also check that "(L:E1GEN_running,bool)" is actually 1 before hitting the switch.
 
Sol...ved "after a fashion!" During the additional check for a voltage change it wasn't actually being told to pass the new value!!! :banghead::banghead::banghead::banghead:
So now I have
Code:
   <Element>......... the Second check
      <Select>
         <Value>(G:Var1) 0 == (L:Electrical genalt2 bus voltage,volts) (L:AC_volts,volts) != and
         if{ 0 (&gt;G:Var1) (L:Electrical genalt2 bus voltage,volts) (>L:AC_volts,volts) 1 (&gt;L:check1,bool) }</Value>
      </Select>
   </Element>
........... the firstcheck <Click>0 (&gt;G:Var1) 1 (>L:Sound_click,enum) 0 (>L:AC_volts,volts) (L:E2GEN_running,bool) 1 ==
        if{ (L:Electrical genalt1 bus voltage,volts) (>L:AC_volts,volts) 5 (>L:needle flicker2, volts) (L:check1,bool) 1 ==
        if{ 0 (&gt;L:check1,bool) } }</Click>
 
Last edited:
And if you try another unit for "L:AC_Volts", like "enum" or "volts"?

Also check that "(L:E1GEN_running,bool)" is actually 1 before hitting the switch.
That is actually a value driven by the switch that trips/puts the generator on-line. There are some other anomalies with that but they are more of a knickers in a twist situation so easily resolved! The principal action though now works. If the switch is already selected to a particular generator and there is a voltage change then the volt meter shows it now :)
 
Back
Top