July 1, 200916 yr Commercial Member <Element> <Select> <Value><!--============== Engine Bleed ==============--> (A:ENG1 N1 RPM,percent) lg 16.0257 * (>L:ENG-BLEED-1,psi) (A:ENG2 N1 RPM,percent) lg 16.0425 * (>L:ENG-BLEED-2,psi) (A:ENG3 N1 RPM,percent) lg 16.0257 * (>L:ENG-BLEED-3,psi) (A:ENG4 N1 RPM,percent) lg 16.0425 * (>L:ENG-BLEED-4,psi) <!--============== SUPPLY-PRESS-L ==============--> (L:ENV-BLEED-2,bool) 1 == if{ (L:ENG-BLEED-2,psi) (>L:SUPPLY-PRESS-L,psi) } els{ (L:ENV-BLEED-APU,bool) 1 == (L:APURPM,number) 74 > (L:ENV-BLEED-ISOL,bool) 0 == and and || (L:EXT-PWR,bool) 1 == || if{ 25 (>L:SUPPLY-PRESS-L,psi) } els{ 0 (>L:SUPPLY-PRESS-L,psi) } } <!--============== SUPPLY-PRESS-R ==============--> (L:ENV-BLEED-3,bool) 1 == if{ (L:ENG-BLEED-3,psi) (>L:SUPPLY-PRESS-R,psi) } els{ (L:ENV-BLEED-APU,bool) 1 == (L:APURPM,number) 74 > and || (L:EXT-PWR,bool) 1 == || if{ 25 (>L:SUPPLY-PRESS-R,psi) } els{ 0 (>L:SUPPLY-PRESS-R,psi) } } <!--============== ISOL ==============--> (L:SUPPLY-PRESS-L,psi) (L:SUPPLY-PRESS-R,psi) > (L:ENV-BLEED-ISOL,bool) 0 == & if{ (L:SUPPLY-PRESS-L,psi) (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-R,psi) (L:SUPPLY-PRESS-L,psi) > (L:ENV-BLEED-ISOL,bool) 0 == & if{ (L:SUPPLY-PRESS-R,psi) (>L:SUPPLY-PRESS-L,psi) } <!--============== Starters ==============--> (A:GENERAL ENG1 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 12 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG2 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 11 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG3 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 14 - (>L:SUPPLY-PRESS-R,psi) } (A:GENERAL ENG4 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 11 - (>L:SUPPLY-PRESS-R,psi) } <!--============== Anti-Ice ==============--> (L:WING-ANTI-ICE,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 2 - (>L:SUPPLY-PRESS-R,psi) (L:SUPPLY-PRESS-L,psi) 3 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG1 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 2 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG2 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 2 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG3 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 4 - (>L:SUPPLY-PRESS-R,psi) } (A:GENERAL ENG4 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 2 - (>L:SUPPLY-PRESS-R,psi) } <!--============== Air Conditioning Packs ==============--> (L:ENV-PACK-L,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 10 - (>L:SUPPLY-PRESS-L,psi) } (L:ENV-PACK-R,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 11 - (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-R,psi) -1 < if{ 0 (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-L,psi) -1 < if{ 0 (>L:SUPPLY-PRESS-L,psi) } </Value> </Select> </Element> Above is the code I've come up with for use in my panel, the aircraft has four engines, my problem is I've not figured out how to utilize the bleed air of engines 1 and 4 in any functional way. Right now the bleed from 1 and 4 are only show in a dummy configuration, so I can initally start the aircraft with engines 1 or 4 I need to start either 2 or 3 first so that I can then start the others - starting off of APU or External Power.I need a better logic to be able of going around this problem.I've had one idea, but it doesn't seem to work - don't know why. I get an value of zero for both L and R supplies. <Element> <Select> <Value><!--============== Engine Bleed ==============--> (A:ENG1 N1 RPM,percent) lg 16.0257 * (>L:ENG-BLEED-1,psi) (A:ENG2 N1 RPM,percent) lg 16.0425 * (>L:ENG-BLEED-2,psi) (A:ENG3 N1 RPM,percent) lg 16.0257 * (>L:ENG-BLEED-3,psi) (A:ENG4 N1 RPM,percent) lg 16.0425 * (>L:ENG-BLEED-4,psi) <!--============== Supply Systems ==============--> (L:ENG-BLEED-1,psi) (L:ENG-BLEED-2,psi) + (>L:ENG-BLEED-L,psi) (L:ENG-BLEED-3,psi) (L:ENG-BLEED-4,psi) + (>L:ENG-BLEED-R,psi) <!--============== SUPPLY-PRESS-L ==============--> (L:ENV-BLEED-1,bool) 1 == (L:ENV-BLEED-2,bool) 1 == || if{ (L:ENG-BLEED-L,psi) (>L:SUPPLY-PRESS-L,psi) } els{ (L:ENV-BLEED-APU,bool) 1 == (L:APURPM,number) 74 > (L:ENV-BLEED-ISOL,bool) 0 == and and || (L:EXT-PWR,bool) 1 == || if{ 25 (>L:SUPPLY-PRESS-L,psi) } els{ 0 (>L:SUPPLY-PRESS-L,psi) } } <!--============== SUPPLY-PRESS-R ==============--> (L:ENV-BLEED-3,bool) 1 == (L:ENV-BLEED-4,bool) 1 == || if{ (L:ENG-BLEED-R,psi) (>L:SUPPLY-PRESS-R,psi) } els{ (L:ENV-BLEED-APU,bool) 1 == (L:APURPM,number) 74 > and || (L:EXT-PWR,bool) 1 == || if{ 25 (>L:SUPPLY-PRESS-R,psi) } els{ 0 (>L:SUPPLY-PRESS-R,psi) } } <!--============== ISOL ==============--> (L:SUPPLY-PRESS-L,psi) (L:SUPPLY-PRESS-R,psi) > (L:ENV-BLEED-ISOL,bool) 0 == & if{ (L:SUPPLY-PRESS-L,psi) (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-R,psi) (L:SUPPLY-PRESS-L,psi) > (L:ENV-BLEED-ISOL,bool) 0 == & if{ (L:SUPPLY-PRESS-R,psi) (>L:SUPPLY-PRESS-L,psi) } <!--============== Starters ==============--> (A:GENERAL ENG1 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 10 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG2 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 11 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG3 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 12 - (>L:SUPPLY-PRESS-R,psi) } (A:GENERAL ENG4 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 11 - (>L:SUPPLY-PRESS-R,psi) } <!--============== Anti-Ice ==============--> (L:WING-ANTI-ICE,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 2 - (>L:SUPPLY-PRESS-R,psi) (L:SUPPLY-PRESS-L,psi) 3 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG1 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 2 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG2 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 2 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG3 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 4 - (>L:SUPPLY-PRESS-R,psi) } (A:GENERAL ENG4 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 2 - (>L:SUPPLY-PRESS-R,psi) } <!--============== Air Conditioning Packs ==============--> (L:ENV-PACK-L,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 10 - (>L:SUPPLY-PRESS-L,psi) } (L:ENV-PACK-R,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 11 - (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-R,psi) -1 < if{ 0 (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-L,psi) -1 < if{ 0 (>L:SUPPLY-PRESS-L,psi) } </Value> </Select> </Element> Good Day, Engjell Berisha
July 1, 200916 yr Moderator Place all the script that needs to be (re)evaluated frequently in an <Update>...</Update> section, rather than an <Element>...</Element> section. Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 1, 200916 yr Author Commercial Member Fr. Bill, not sure wether or not that was the answer to my question - if so I totally don't understand it. If not I assume it's just a tip, for me to put that entire piece of script in <Update></Update> so that it is continuously evalutated.Either way, thx. Good Day, Engjell Berisha
July 2, 200916 yr Moderator Fr. Bill, not sure wether or not that was the answer to my question - if so I totally don't understand it. If not I assume it's just a tip, for me to put that entire piece of script in <Update></Update> so that it is continuously evalutated.Either way, thx.Just what I said. Use <Update Hidden="Yes">...</Update>. By setting the Hidden flag to "Yes" the script will continue to update even if the gauge is off screen. You may also use the Frequency flag to control the update rate. Frequency: Integer value indicating how often the update should be run, in updates per second. Enter 1 for the slowest frequency of updates (one per second). : <Update Hidden="Yes"> <!--============== Engine Bleed ==============--> (A:ENG1 N1 RPM,percent) lg 16.0257 * (>L:ENG-BLEED-1,psi) (A:ENG2 N1 RPM,percent) lg 16.0425 * (>L:ENG-BLEED-2,psi) (A:ENG3 N1 RPM,percent) lg 16.0257 * (>L:ENG-BLEED-3,psi) (A:ENG4 N1 RPM,percent) lg 16.0425 * (>L:ENG-BLEED-4,psi) <!--============== Supply Systems ==============--> (L:ENG-BLEED-1,psi) (L:ENG-BLEED-2,psi) + (>L:ENG-BLEED-L,psi) (L:ENG-BLEED-3,psi) (L:ENG-BLEED-4,psi) + (>L:ENG-BLEED-R,psi) <!--============== SUPPLY-PRESS-L ==============--> (L:ENV-BLEED-1,bool) 1 == (L:ENV-BLEED-2,bool) 1 == || if{ (L:ENG-BLEED-L,psi) (>L:SUPPLY-PRESS-L,psi) } els{ (L:ENV-BLEED-APU,bool) 1 == (L:APURPM,number) 74 > (L:ENV-BLEED-ISOL,bool) 0 == and and || (L:EXT-PWR,bool) 1 == || if{ 25 (>L:SUPPLY-PRESS-L,psi) } els{ 0 (>L:SUPPLY-PRESS-L,psi) } } <!--============== SUPPLY-PRESS-R ==============--> (L:ENV-BLEED-3,bool) 1 == (L:ENV-BLEED-4,bool) 1 == || if{ (L:ENG-BLEED-R,psi) (>L:SUPPLY-PRESS-R,psi) } els{ (L:ENV-BLEED-APU,bool) 1 == (L:APURPM,number) 74 > and || (L:EXT-PWR,bool) 1 == || if{ 25 (>L:SUPPLY-PRESS-R,psi) } els{ 0 (>L:SUPPLY-PRESS-R,psi) } } <!--============== ISOL ==============--> (L:SUPPLY-PRESS-L,psi) (L:SUPPLY-PRESS-R,psi) > (L:ENV-BLEED-ISOL,bool) 0 == & if{ (L:SUPPLY-PRESS-L,psi) (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-R,psi) (L:SUPPLY-PRESS-L,psi) > (L:ENV-BLEED-ISOL,bool) 0 == & if{ (L:SUPPLY-PRESS-R,psi) (>L:SUPPLY-PRESS-L,psi) } <!--============== Starters ==============--> (A:GENERAL ENG1 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 10 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG2 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 11 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG3 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 12 - (>L:SUPPLY-PRESS-R,psi) } (A:GENERAL ENG4 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 11 - (>L:SUPPLY-PRESS-R,psi) } <!--============== Anti-Ice ==============--> (L:WING-ANTI-ICE,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 2 - (>L:SUPPLY-PRESS-R,psi) (L:SUPPLY-PRESS-L,psi) 3 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG1 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 2 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG2 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 2 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG3 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 4 - (>L:SUPPLY-PRESS-R,psi) } (A:GENERAL ENG4 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 2 - (>L:SUPPLY-PRESS-R,psi) } <!--============== Air Conditioning Packs ==============--> (L:ENV-PACK-L,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 10 - (>L:SUPPLY-PRESS-L,psi) } (L:ENV-PACK-R,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 11 - (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-R,psi) -1 < if{ 0 (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-L,psi) -1 < if{ 0 (>L:SUPPLY-PRESS-L,psi) } </Update> Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 2, 200916 yr Author Commercial Member No luck mate, still the same result as before using "Update" rather than "Element" my L and R Supply PSI shows zero.I could post the entire gauge, but that's rather lengthy. If it would be useful/helpful I'll post it. Good Day, Engjell Berisha
July 2, 200916 yr Commercial Member What does the 'lg' do? Ed Wilson Mindstar AviationMy Playland - I69
July 2, 200916 yr Moderator What does the 'lg' do? lg Logarithm to base 10 (1 argument) Example: 10 lg returns a value of 1No luck mate, still the same result as before using "Update" rather than "Element" my L and R Supply PSI shows zero.I could post the entire gauge, but that's rather lengthy. If it would be useful/helpful I'll post it.Now that the script is in the correct place to be updated properly, let's find the problems, eh?Start with this:(L:ENG-BLEED-1,psi)The only valid "units" for custom variables are bool, enum, number or numbers. The SDK does not mention this important bit... :( Try replacing the above with:(L:ENG-BLEED-1,number) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 2, 200916 yr Author Commercial Member That was what happened the first time, with the "Update" replacing the "Element" - I got an indication of "0" on both the left and right Supplies.After replacing element with update, and changing all my Lvar's that used PSI to number (I originally had them all using number, but a friend suggested I use PSI and so I did.) this is what happened:Now both the right and left supplies read "172369". :( Here's what the code looks like, I've also included the display code. <Update Hidden="Yes"> <!--============== Engine Bleed ==============--> (A:ENG1 N1 RPM,percent) lg 16.0257 * (>L:ENG-BLEED-1,number) (A:ENG2 N1 RPM,percent) lg 16.0425 * (>L:ENG-BLEED-2,number) (A:ENG3 N1 RPM,percent) lg 16.0257 * (>L:ENG-BLEED-3,number) (A:ENG4 N1 RPM,percent) lg 16.0425 * (>L:ENG-BLEED-4,number) <!--============== Supply Systems ==============--> (L:ENG-BLEED-1,number) (L:ENG-BLEED-2,number) + (>L:ENG-BLEED-L,number) (L:ENG-BLEED-3,number) (L:ENG-BLEED-4,number) + (>L:ENG-BLEED-R,number) <!--============== SUPPLY-PRESS-L ==============--> (L:ENV-BLEED-1,bool) 1 == (L:ENV-BLEED-2,bool) 1 == || if{ (L:ENG-BLEED-L,number) (>L:SUPPLY-PRESS-L,number) } els{ (L:ENV-BLEED-APU,bool) 1 == (L:APURPM,number) 74 > (L:ENV-BLEED-ISOL,bool) 0 == and and || (L:EXT-PWR,bool) 1 == || if{ 25 (>L:SUPPLY-PRESS-L,number) } els{ 0 (>L:SUPPLY-PRESS-L,number) } } <!--============== SUPPLY-PRESS-R ==============--> (L:ENV-BLEED-3,bool) 1 == (L:ENV-BLEED-4,bool) 1 == || if{ (L:ENG-BLEED-R,number) (>L:SUPPLY-PRESS-R,number) } els{ (L:ENV-BLEED-APU,bool) 1 == (L:APURPM,number) 74 > and || (L:EXT-PWR,bool) 1 == || if{ 25 (>L:SUPPLY-PRESS-R,number) } els{ 0 (>L:SUPPLY-PRESS-R,number) } } <!--============== ISOL ==============--> (L:SUPPLY-PRESS-L,number) (L:SUPPLY-PRESS-R,number) > (L:ENV-BLEED-ISOL,bool) 0 == & if{ (L:SUPPLY-PRESS-L,number) (>L:SUPPLY-PRESS-R,number) } (L:SUPPLY-PRESS-R,number) (L:SUPPLY-PRESS-L,number) > (L:ENV-BLEED-ISOL,bool) 0 == & if{ (L:SUPPLY-PRESS-R,number) (>L:SUPPLY-PRESS-L,number) } <!--============== Starters ==============--> (A:GENERAL ENG1 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-L,number) 10 - (>L:SUPPLY-PRESS-L,number) } (A:GENERAL ENG2 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-L,number) 11 - (>L:SUPPLY-PRESS-L,number) } (A:GENERAL ENG3 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-R,number) 12 - (>L:SUPPLY-PRESS-R,number) } (A:GENERAL ENG4 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-R,number) 11 - (>L:SUPPLY-PRESS-R,number) } <!--============== Anti-Ice ==============--> (L:WING-ANTI-ICE,bool) 1 == if{ (L:SUPPLY-PRESS-R,number) 2 - (>L:SUPPLY-PRESS-R,number) (L:SUPPLY-PRESS-L,number) 3 - (>L:SUPPLY-PRESS-L,number) } (A:GENERAL ENG1 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-L,number) 2 - (>L:SUPPLY-PRESS-L,number) } (A:GENERAL ENG2 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-L,number) 2 - (>L:SUPPLY-PRESS-L,number) } (A:GENERAL ENG3 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-R,number) 4 - (>L:SUPPLY-PRESS-R,number) } (A:GENERAL ENG4 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-R,number) 2 - (>L:SUPPLY-PRESS-R,number) } <!--============== Air Conditioning Packs ==============--> (L:ENV-PACK-L,bool) 1 == if{ (L:SUPPLY-PRESS-L,number) 10 - (>L:SUPPLY-PRESS-L,number) } (L:ENV-PACK-R,bool) 1 == if{ (L:SUPPLY-PRESS-R,number) 11 - (>L:SUPPLY-PRESS-R,number) } (L:SUPPLY-PRESS-R,number) -1 < if{ 0 (>L:SUPPLY-PRESS-R,number) } (L:SUPPLY-PRESS-L,number) -1 < if{ 0 (>L:SUPPLY-PRESS-L,number) } </Update> <Element> <Position X="30" Y="80"/> <FormattedText X="150" Y="50" Font="Glass Gauge" Linespacing="50" Adjust="Left" FontSize="15" Color="#00FF00" Bright="NO"> <String>%((L:SUPPLY-PRESS-L,number))%!2d!</String> </FormattedText> </Element> <Element> <Position X="280" Y="80"/> <FormattedText X="150" Y="50" Font="Glass Gauge" Linespacing="50" Adjust="Left" FontSize="15" Color="#00FF00" Bright="NO"> <String>%((L:SUPPLY-PRESS-R,number))%!2d!</String> </FormattedText> </Element> :( Good Day, Engjell Berisha
July 3, 200916 yr Author Commercial Member SUCCESS!After being really frustrated and toying with it for a real long time, I devised a code that works: <!--============== Engine Bleed ==============--> (A:ENG1 N1 RPM,percent) lg 16.0257 * (>L:ENG-BLEED-1,psi) (A:ENG2 N1 RPM,percent) lg 16.0425 * (>L:ENG-BLEED-2,psi) (A:ENG3 N1 RPM,percent) lg 16.0257 * (>L:ENG-BLEED-3,psi) (A:ENG4 N1 RPM,percent) lg 16.0425 * (>L:ENG-BLEED-4,psi) (L:ENG-BLEED-1,psi) 0 < if{ 0 (>L:ENG-BLEED-1,psi) } (L:ENG-BLEED-2,psi) 0 < if{ 0 (>L:ENG-BLEED-2,psi) } (L:ENG-BLEED-3,psi) 0 < if{ 0 (>L:ENG-BLEED-3,psi) } (L:ENG-BLEED-4,psi) 0 < if{ 0 (>L:ENG-BLEED-4,psi) } (L:ENV-BLEED-1,bool) 1 == if{ (L:ENG-BLEED-1,psi) (>L:ENG-BLEED-L,psi) } (L:ENV-BLEED-2,bool) 1 == if{ (L:ENG-BLEED-2,psi) (>L:ENG-BLEED-L,psi) } (L:ENV-BLEED-3,bool) 1 == if{ (L:ENG-BLEED-3,psi) (>L:ENG-BLEED-R,psi) } (L:ENV-BLEED-4,bool) 1 == if{ (L:ENG-BLEED-4,psi) (>L:ENG-BLEED-R,psi) } (L:ENV-BLEED-1,bool) 1 == (L:ENV-BLEED-2,bool) 1 == and if{ (L:ENG-BLEED-1,psi) (L:ENG-BLEED-2,psi) + (>L:ENG-BLEED-L,psi) } (L:ENV-BLEED-3,bool) 1 == (L:ENV-BLEED-4,bool) 1 == and if{ (L:ENG-BLEED-3,psi) (L:ENG-BLEED-4,psi) + (>L:ENG-BLEED-R,psi) } <!--============== SUPPLY-PRESS-L ==============--> (L:ENV-BLEED-1,bool) 1 == (L:ENV-BLEED-2,bool) 1 == || if{ (L:ENG-BLEED-L,psi) (>L:SUPPLY-PRESS-L,psi) } els{ (L:ENV-BLEED-APU,bool) 1 == (L:APURPM,number) 74 > (L:ENV-BLEED-ISOL,bool) 0 == and and || (L:EXT-PWR,bool) 1 == || if{ 25 (>L:SUPPLY-PRESS-L,psi) } els{ 0 (>L:SUPPLY-PRESS-L,psi) } } <!--============== SUPPLY-PRESS-R ==============--> (L:ENV-BLEED-3,bool) 1 == (L:ENV-BLEED-4,bool) 1 == || if{ (L:ENG-BLEED-R,psi) (>L:SUPPLY-PRESS-R,psi) } els{ (L:ENV-BLEED-APU,bool) 1 == (L:APURPM,number) 74 > and || (L:EXT-PWR,bool) 1 == || if{ 25 (>L:SUPPLY-PRESS-R,psi) } els{ 0 (>L:SUPPLY-PRESS-R,psi) } } <!--============== ISOL ==============--> (L:SUPPLY-PRESS-L,psi) (L:SUPPLY-PRESS-R,psi) > (L:ENV-BLEED-ISOL,bool) 0 == & if{ (L:SUPPLY-PRESS-L,psi) (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-R,psi) (L:SUPPLY-PRESS-L,psi) > (L:ENV-BLEED-ISOL,bool) 0 == & if{ (L:SUPPLY-PRESS-R,psi) (>L:SUPPLY-PRESS-L,psi) } <!--============== Starters ==============--> (A:GENERAL ENG1 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 12 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG2 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 11 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG3 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 14 - (>L:SUPPLY-PRESS-R,psi) } (A:GENERAL ENG4 STARTER,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 11 - (>L:SUPPLY-PRESS-R,psi) } <!--============== Anti-Ice ==============--> (L:WING-ANTI-ICE,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 2 - (>L:SUPPLY-PRESS-R,psi) (L:SUPPLY-PRESS-L,psi) 3 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG1 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 2 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG2 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 2 - (>L:SUPPLY-PRESS-L,psi) } (A:GENERAL ENG3 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 4 - (>L:SUPPLY-PRESS-R,psi) } (A:GENERAL ENG4 ANTI ICE POSITION,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 2 - (>L:SUPPLY-PRESS-R,psi) } <!--============== Air Conditioning Packs ==============--> (L:ENV-PACK-L,bool) 1 == if{ (L:SUPPLY-PRESS-L,psi) 10 - (>L:SUPPLY-PRESS-L,psi) } (L:ENV-PACK-R,bool) 1 == if{ (L:SUPPLY-PRESS-R,psi) 11 - (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-R,psi) -1 < if{ 0 (>L:SUPPLY-PRESS-R,psi) } (L:SUPPLY-PRESS-L,psi) -1 < if{ 0 (>L:SUPPLY-PRESS-L,psi) } Now I've got a true to life 4 engine environmental bleed system, everything works exactly as it should!Thank You for all your help Bill, trully appreciate it! Good Day, Engjell Berisha
July 3, 200916 yr Moderator You are most welcome, although I'm not at all sure I was actually helpful, save perhaps just being a handy ear in which to mutter frustrations... :( Trying to compare your "before and after" script is making my eyes bleed. In brief words, what was the major change that enabled your success? :( Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 3, 200916 yr Author Commercial Member Yea, posting the code that way is totally frustrating to me also, I tried changing the color of the new/changed code but it won't let me.Here's the new code I added from the original: (L:ENG-BLEED-1,psi) 0 < if{ 0 (>L:ENG-BLEED-1,psi) } (L:ENG-BLEED-2,psi) 0 < if{ 0 (>L:ENG-BLEED-2,psi) } (L:ENG-BLEED-3,psi) 0 < if{ 0 (>L:ENG-BLEED-3,psi) } (L:ENG-BLEED-4,psi) 0 < if{ 0 (>L:ENG-BLEED-4,psi) } (L:ENV-BLEED-1,bool) 1 == if{ (L:ENG-BLEED-1,psi) (>L:ENG-BLEED-L,psi) } (L:ENV-BLEED-2,bool) 1 == if{ (L:ENG-BLEED-2,psi) (>L:ENG-BLEED-L,psi) } (L:ENV-BLEED-3,bool) 1 == if{ (L:ENG-BLEED-3,psi) (>L:ENG-BLEED-R,psi) } (L:ENV-BLEED-4,bool) 1 == if{ (L:ENG-BLEED-4,psi) (>L:ENG-BLEED-R,psi) } (L:ENV-BLEED-1,bool) 1 == (L:ENV-BLEED-2,bool) 1 == and if{ (L:ENG-BLEED-1,psi) (L:ENG-BLEED-2,psi) + (>L:ENG-BLEED-L,psi) } (L:ENV-BLEED-3,bool) 1 == (L:ENV-BLEED-4,bool) 1 == and if{ (L:ENG-BLEED-3,psi) (L:ENG-BLEED-4,psi) + (>L:ENG-BLEED-R,psi) } The first set helps a lot because when I shut off the engines their subsequent bleed psi can go below zero (using the method that I had to derive bleed psi) and so now if it goes below zero it is forced to be zero so it doesn't mess up the total bleed from the engines on the L or R side.Then I told the system that if (L:ENV-BLEED-1,bool) 1 == which is the bleed switch feeding the air from engine 1 then that equals the total bleed on the left, but if both of them are on then the total of their psi's equals the Left engine bleed and that subsequently equals the Supply Press Left.The solution was fairly simple now that I think about it, but it required a different perspective which you definatley helped me with. I'd designed the gauge many, many months ago and never thought about this particular approach to derive what I wanted.Thanks loads Bill, really appreciate it! :( Good Day, Engjell Berisha
Create an account or sign in to comment