- Messages
- 1,468
- Country

Could someone have a look at the code below to see if there is an error or if I am doing something wrong. Many thanks.
The intended action is that when an engine runs down it trips the generator automatically and at the same time physically moves the switch to the trip position. For engine 4 generator this works perfectly. but for engine 3 it does not. The switch remains in the previous set position. There are differences between engine 3 and 4 generator switches. In that the engine 4 switch has three postions and engine 3 has 2. Engine 3 is correct in reality. So I need to change engines 1,2 and 4 to match engine 3 generator. Engines 1,2 and 4 generator switches all correctly trip. The switches are controlled by Gvars. Many thanks
The intended action is that when an engine runs down it trips the generator automatically and at the same time physically moves the switch to the trip position. For engine 4 generator this works perfectly. but for engine 3 it does not. The switch remains in the previous set position. There are differences between engine 3 and 4 generator switches. In that the engine 4 switch has three postions and engine 3 has 2. Engine 3 is correct in reality. So I need to change engines 1,2 and 4 to match engine 3 generator. Engines 1,2 and 4 generator switches all correctly trip. The switches are controlled by Gvars. Many thanks
Code:
<Element> ///////// code to trip the switch when engines stop//This code works///////
<Select>
<Value>(A:GENERAL ENG4 GENERATOR ACTIVE,bool) 0 == (L:E4GEN_running,bool) 0 == and
(L:E4GEN,number) 2 == and (L:GMS4,bool) 0 == and
if{ 1 (>L:GMS4,bool) 0 (>L:E4GEN_running,bool) }</Value>
</Select>
</Element>
///////// code triggered by the trip code///////
<Value>(L:GMS4,bool) 0 == if{ (A:GENERAL ENG4 GENERATOR ACTIVE,bool) 0 == (L:E4GEN_running,bool) 1 == and
if{ 1 (>G:Var1) 0 (>L:KvarKW4,number) 0 (>L:E4GEN_running,bool) 1 (>L:GMS4,bool) } }</Value>
<Mouse>
<Tooltip>E4 Main Gen</Tooltip>
<Area Top="0" Bottom="30">
<Cursor Type="Hand"/> ///////// close///////
<Click>0 (>G:Var1) (L:E4GEN_running,bool) 1 == (A:GENERAL ENG4 GENERATOR ACTIVE,bool) 1 == and
if{ 0 (>K:TOGGLE_ALTERNATOR4) (>L:E4GEN,number) 0 (>L:E4GEN_running,bool) }</Click>
</Area>
<Area Top="31" Bottom="147">
<Cursor Type="Hand"/> ///////// on///////
<Click>2 (>G:Var1) (L:E4GEN_running,bool) 0 == (A:GENERAL ENG4 GENERATOR ACTIVE,bool) 0 == and
if{ (>K:TOGGLE_ALTERNATOR4) 2 (>L:E4GEN,number) 1 (>L:E4GEN_running,bool) }</Click>
</Area>
<Area Top="148" Bottom="177">
<Cursor Type="Hand"/> ///////// trip///////
<Click>1 (>G:Var1) (L:E4GEN_running,bool) 1 == (A:GENERAL ENG4 GENERATOR ACTIVE,bool) 1 == and
if{ (>K:TOGGLE_ALTERNATOR4) 0 (>L:E4GEN,number) 0 (>L:E4GEN_running,bool) }</Click>
</Area>
</Mouse>>
Code:
<Element> ///////// code to trip the switch when engines stop///////This code doesn't work//
<Select>
<Value>(A:GENERAL ENG3 GENERATOR ACTIVE,bool) 0 == (L:E3GEN_running,bool) 0 == and
(L:E3GEN,number) 2 == and (L:GMS3,bool) 0 == and
if{ 1 (>L:GMS3,bool) 0 (>L:E3GEN_running,bool) }</Value>
</Select>
</Element>
///////// code triggered by the trip code///////
<Value>(L:GMS3,bool) 0 == if{ (A:GENERAL ENG3 GENERATOR ACTIVE,bool) 0 == (L:E3GEN_running,bool) 1 == and
if{ 1 (>G:Var1) 0 (>L:KvarKW3,number) 0 (>L:E3GEN_running,bool) 1 (>L:GMS3,bool) } }</Value>
<Mouse>
<Tooltip>E3 Main Gen</Tooltip>
<Area Top="148" Bottom="177">
<Cursor Type="Hand"/> ///////// trip///////
<Click>0 (>G:Var1) (L:E3GEN_running,bool) 1 == (A:GENERAL ENG3 GENERATOR ACTIVE,bool) 1 == and
if{ (>K:TOGGLE_ALTERNATOR3) (>L:E3GEN,number) 0 (>L:E3GEN_running,bool) }</Click>
</Area>
<Area Top="0" Bottom="147">
<Cursor Type="Hand"/> /////////on///////
<Click>1 (>G:Var1) (L:E3GEN_running,bool) 0 == (A:GENERAL ENG3 GENERATOR ACTIVE,bool) 0 == and
if{ (>K:TOGGLE_ALTERNATOR3) 2 (>L:E3GEN,number) 1 (>L:E3GEN_running,bool) }</Click>
</Area>
</Mouse>
