- Messages
- 232
- Country
While digging deep into my 747 electrical system, I have stumbled into an interesting problem.
I am trying to program the following bit of the electrical system: AC Bus 4 can be powered either by Generator 4, or by Generator 3 if Bus Tie Breakers 3 and 4 are closed.
Here is my code:
For whatever reason, this code is powering AC Bus 4 with whatever the final variable of the longest line is. In the example above, closing Bus Tie Breaker 4 will cause AC Bus 4 to be powered, even if no generator is online!
If I take out one of the L vars in that line, the code will function as written, i.e. if I write this:
Then AC Bus 4 will only be powered when Gen 3 is online and BTB 3 is closed.
What's going on here?
I am trying to program the following bit of the electrical system: AC Bus 4 can be powered either by Generator 4, or by Generator 3 if Bus Tie Breakers 3 and 4 are closed.
Here is my code:
XML:
<!-- AC Bus 4 -->
<Element>
<Select>
<Value>
(L:Gen 4 Powered, bool) 1 ==
if{ 1 (>L:AC Bus 4 Powered, bool) }
(L:Gen 3 Powered, bool) 1 == (L:BTB 3 Closed, bool) 1 == (L:BTB 4 Closed, bool) 1 == &&&
if{ 1 (>L:AC Bus 4 Powered, bool) }
els{ 0 (>L:AC Bus 4 Powered, bool) }
</Value>
</Select>
</Element>
For whatever reason, this code is powering AC Bus 4 with whatever the final variable of the longest line is. In the example above, closing Bus Tie Breaker 4 will cause AC Bus 4 to be powered, even if no generator is online!
If I take out one of the L vars in that line, the code will function as written, i.e. if I write this:
XML:
(L:Gen 3 Powered, bool) 1 == (L:BTB 3 Closed, bool) 1 == &&
Then AC Bus 4 will only be powered when Gen 3 is online and BTB 3 is closed.
What's going on here?