#Fuel Tank Selection

1 messages · Page 1 of 1 (latest)

charred raft
#

Hi
I am working on a small panel to display and select what fuel tanks are active.
I typically fly the G36 or the 208 Caravan. The G36 is either Left OR Right Or both off. The 208 is Left OR Right OR Both OR both off.

I have three LEDS, left, right, and off. I also have three buttons, left, right, and off.
The G36 is working, the 208 is what is giving me trouble.

This is the code I am trying get working:

(A:FUEL TANK SELECTOR:1,enum) 3 ==
IF{
1 (>K:FUEL_SELECTOR_SET)
} ELS{
2 (>K:FUEL_SELECTOR_SET)
}

The idea is that when I press the Left Button and the Right Tank is already selected I will set the tanks to Both, otherwise I will turn on the Left Tank.
1 = Both
2 = Left
3 = Right

It appears that my If statement is always testing false. The Selector statements work when executed.
I am using the (A:FUEL TANK SELECTOR:1,enum) to drive the LEDs and they are responding correctly.
Will (A:FUEL TANK SELECTOR:1,enum) not return data in this application?

This code is in the On Press Preset Code window.

Thanks for any guidance.

balmy kite
#

If you check the RPN guide in the msfs SDK site, you can see the correct syntax. Both if and els should be all lower case.

balmy kite
#

Try

(A:FUEL TANK SELECTOR:1,enum) 3 == if{ 1 (>K:FUEL_SELECTOR_SET) } 
els{ 2 (>K:FUEL_SELECTOR_SET) }
charred raft
#

Thankyou
I had a note that the code was CAP sensitive, I will have to reread the guide.

charred raft
#

worked perfect

#

i will reread the guide tonight

balmy kite
#

(A:FUEL TANK SELECTOR:1, enum) has identical meaning to (A:fuEl TaNk SeLecTOR:1,ENUm)

#

The variable type designator A:, L:, B:, K: must be upper case.

#

Spaces are also critical, every element must be separated by at least one space, except if and els, which has to be with no spaces between the operator and the opening bracket.