PDA

View Full Version : [LOGIC] How to code question



null null
11-14-2004, 05:44 PM
Hi Enrico
Trying to understand how to code the Isolation valve logic in the
737txt [logic] section, This is what I need

If the Isolation valve switch is in the "auto" position
(isolationvalve = 1), and any of the following are off

Engine 1 Bleed = off (eng1bleed = 0)
Engine 2 Bleed = off (eng2bleed = 0)
Pack 1 = off (pack1 = 0)
Pack 2 = off (pack2 = 0)

Then the isolation valve opens . OR

If the Isolation valve switch position is in the "open" position the
isolation valve opens

if (isolationvalve = 1 and ((eng1bleed = 0) or (eng2bleed = 0) or
(pack1 = 0) or (pack2 = 0))) or (isolationvalve = 2)
if b1r > b2r
b2r = b1r - 1
else
b1r = b2r - 1
endif
else
b1r = b1r + 1
b2r = b2r + 1
endif

Thanks

David

Enrico Schiratti
11-24-2004, 06:11 AM
Hi,

so you are changing completely from the current code?

I would do the following, if I understand it correctly

if isolationvalve = 0
isolationvalveopen = 0
else
if isolationvalve = 1
isolationvalveopen = (eng1bleed = 0) or (eng2bleed = 0) or (pack1 =

0) or (pack2 = 0)
else
isolationvalveopen = 1
endif
endif

then use the temp variable isolationvalveopen instead of isolationvalve

Ciao

Enrico

"David Allen" wrote in message
news:269651.53525@wb.onvix.com...
> Hi Enrico
> Trying to understand how to code the Isolation valve logic in the
> 737txt [logic] section, This is what I need
>
> If the Isolation valve switch is in the "auto" position
> (isolationvalve = 1), and any of the following are off
>
> Engine 1 Bleed = off (eng1bleed = 0)
> Engine 2 Bleed = off (eng2bleed = 0)
> Pack 1 = off (pack1 = 0)
> Pack 2 = off (pack2 = 0)
>
> Then the isolation valve opens . OR
>
> If the Isolation valve switch position is in the "open" position the
> isolation valve opens
>
> if (isolationvalve = 1 and ((eng1bleed = 0) or (eng2bleed = 0) or
> (pack1 = 0) or (pack2 = 0))) or (isolationvalve = 2)
> if b1r > b2r
> b2r = b1r - 1
> else
> b1r = b2r - 1
> endif
> else
> b1r = b1r + 1
> b2r = b2r + 1
> endif
>
> Thanks
>
> David
>

null null
11-24-2004, 02:41 PM
On Wed, 24 Nov 2004 05:11:06 EST, Enrico
Schiratti wrote:

>Hi,
>
>so you are changing completely from the current code?

Short answer yes

>I would do the following, if I understand it correctly

You did and it works GREAT!

Thanks

David