July 2, 200718 yr HiI am working on an old prop aircraft, and having a little trouble getting the Hydraulic to work as they should. Should work like this: It has Hydraulic Pumps on engine 2 and 3, and on the Engineers panel there is a switch which selects which Hydraulic pump is used. So when Hydraulic pump 2 is selected and Engine 2 is running Hydraulic pressure should equals about 650 psi, same goes for Engine 3. If Hydraulic Pump 2 or 3 is selected and the selected Engine is not running then no Hydraulic pressure should be got from that Engine. If both engine are shut down then Hydraulic pressure comes from an electric pump.The selector on the engineers panel has 3 position, Up selects Engine 2 (0), central (1) for off, and down (2) for Engine 3.This code works correctly for engine 2:(L:Hydraulic Select,enum) 0 == (A:ENG2 COMBUSTION, bool) && if{ 650 (>L:Hydraulic Pressure,psi) } els{ 0 (>L:Hydraulic Pressure,psi) }So if the engine is not running, and the switch is selected, no Hydraulic pressure is provided, and if the engine is running and the switch is not selected then that also provides no hydraulic pressure, the problem comes when I add the code for Engine number 3 to work the same(L:Hydraulic Select,enum) 0 == (A:ENG2 COMBUSTION, bool) && if{ (650 (>L:Hydraulic Pressure,psi) } els{ (L:Hydraulic Select,enum) 2 == (A:ENG3 COMBUSTION, bool) && if{ 650 (>L:Hydraulic Pressure,psi) } } els{ 0 (>L:Hydraulic Pressure,psi) } Everything stops working using the above code, I have always had a few problem linking code, but after hours of checking and trying other codes, still no joy.This is the working code for the Auxiliary switch:(L:Auxiliary Hydraulic Switch,bool) if{ 450 (>L:Hydraulic Pressure,psi) } els{ 0 (>L:Hydraulic Pressure,psi) } Thanks in advance for any help.
July 2, 200718 yr Hi Russell,One of the greatest advantages of XML is the possibilty to use briefed code:(L:Hydraulic Select,enum) 0 == (A:ENG2 COMBUSTION, bool) and(L:Hydraulic Select,enum) 2 == (A:ENG3 COMBUSTION, bool) andor 650 * (>L:Hydraulic Pressure,psi) And you can use registers to shorten the code even more.Tom
July 2, 200718 yr Hi TomTried your code Tom and unfortunatly it did not work, when the pump for engine 3 was selected and engine 3 was running, worked as it should, but when pump 2 was selected and engine was running, there was no hydraulic pressure. I have however managed to get it working using this code:(L:Hydraulic Select,enum) 0 == (A:ENG2 COMBUSTION, bool) 1 == && if{ 650 (>L:Hydraulic Pressure,psi) } els{ (L:Hydraulic Select,enum) 2 == (A:ENG3 COMBUSTION, bool) 1 == && if{ 650 (>L:Hydraulic Pressure,psi) } els{ (L:Auxiliary Hydraulic Switch,bool) if{ 450 (>L:Hydraulic Pressure,psi) } els{ 0(>L:Hydraulic Pressure,psi) } } } I tried this code last night before posting, but could not get it to work, this morning I had a look at it and moved the } } to the end of the code and it works excatly as it should.Thanks for posting.
July 2, 200718 yr Russell,THe code I posted MUST work, if properly set. It's a logical fact.But...whatever :-)Tom
July 2, 200718 yr Author Moderator You will find such errors faster if you get in the habit of using indented lines for your code: (L:Hydraulic Select,enum) 0 == (A:ENG2 COMBUSTION, bool) 1 == && if{ 650 (>L:Hydraulic Pressure,psi) } els{ (L:Hydraulic Select,enum) 2 == (A:ENG3 COMBUSTION, bool) 1 == && if{ 650 (>L:Hydraulic Pressure,psi) } els{ (L:Auxiliary Hydraulic Switch,bool) if{ 450 (>L:Hydraulic Pressure,psi) } els{ 0(>L:Hydraulic Pressure,psi) } } } Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 3, 200718 yr The code I posted MUST work, if properly set. It's a logical fact.But...whateverI give it another try, it might well have been me not setting the code out right.You will find such errors faster if you get in the habit of using indented lines for your code:I will give it a try BillCheers.
July 3, 200718 yr Author Moderator BTW, in case you aren't aware, there's a rather neat new tool in the FSX SDK that will allow us to convert from "infix notation" to "postfix notation" and vice-versa.Sometimes it helps to convert from XML to C$ stype "infix" to validate our logic. Here is the same XML code in C# "infix notation": if ( ( (L:Hydraulic Select , enum) == 0 ) && ( (A:ENG2 COMBUSTION , bool) == 1 ) ) { (L:Hydraulic Pressure , psi) = 650 ; } else { if ( ( (L:Hydraulic Select , enum) == 2 ) && ( (A:ENG3 COMBUSTION , bool) == 1 ) ) { (L:Hydraulic Pressure , psi) = 650 ; } else { if (L:Auxiliary Hydraulic Switch , bool) { (L:Hydraulic Pressure , psi) = 450 ; } else { (L:Hydraulic Pressure , psi) = 0 ; } } } Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 4, 200718 yr Hi BillI have not made the move to FSX yet, but I will make a note of your post for future reference.Thanks
July 4, 200718 yr Author Moderator >Hi Bill>>I have not made the move to FSX yet, but I will make a note of>your post for future reference.Just to be clear, although this tool is in the FSX SDK, it will work with FS9 XML just as well... ;) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 4, 200718 yr Is it possible for Fs9 users to download the FSX SDK and use this tool? Gerry Howard
July 4, 200718 yr Author Moderator >Is it possible for Fs9 users to download the FSX SDK and use>this tool?Unfortunately, no. The SDK SP1a download will only install if the user already has the FSX RTM SDK installed. Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
Create an account or sign in to comment