Creating a logical sum and a logical product

When creating configurations, it is often necessary to make the state of one output dependent on the states of several other inputs/outputs. The example of using these conditions can be valves and pumps dedicated for underfloor heating.


In order to reach desired results, there is needed creating the following conditions in the text script:


* for logical sum (at least 1 of relay output must be equal to 1):

if(CLU->VALVE_DOUT1->Value==1 or CLU->VALVE_DOUT2->Value==1 or CLU->VALVE_DOUT3->Value==1 or CLU->VALVE_DOUT4->Value==1) then 
CLU->POMP_P1->SwitchOn(0)
else
CLU->POMP_P1->SwitchOff(0)
end


* for logical product (all relay outputs must be equal to 1):

if(CLU->VALVE_DOUT1->Value==1 and CLU->VALVE_DOUT2->Value==1 and CLU->VALVE_DOUT3->Value==1 and CLU->VALVE_DOUT4->Value==1) then 
CLU->POMP_P2->SwitchOn(0)
else
CLU->POMP_P2->SwitchOff(0)
end