# Thread: [LOGIC] How to code question

1. ## [LOGIC] How to code question

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  Reply With Quote

2. ## Re: [LOGIC] How to code question

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
>  Reply With Quote

3. ## Re: [LOGIC] How to code question

On Wed, 24 Nov 2004 05:11:06 EST, Enrico
Schiratti wrote:

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