dS378
dS378
User Manual v2.19
Boolean equations
Both relay automation and email triggering use the boolean equation solver.
The three types that can be used in boolean equations are:
1. Relays, R1 – R8
2. Digital I/O's, D1 – D7
3. Analog inputs, A1 – A7
4. Schedules, S1 – S8
5. Counters, C1 – C8
6. 1Hz Time base, T1
The simplest equation is R1. This is true when R1 is active and not true when R1 is in-active. If
you enter R1 in the relay 2 automation box it will simply follow whatever R1 does.
The exclamation mark ! is used as a “not”. So !R1 is true when relay 1 is in-active.
Enter !R1 in the relay 2 automation box it will follow the opposite of R1. Relay 2 will be active
when relay 1 is inactive.
The same applies to the digital I/O's. Enter D2 in the relay 2 automation box and the relay will
follow the input.
Analog inputs are compared with a value to obtain a true/false boolean result. In this example
we have set I/O8 to be an analogue input with a 5v reference. Then we can enter A1<1000 in
the relay2 automation box. This will turn on relay 2 when the input A1 falls below 1000. If A1
is connected to a temperature sensor and R2 controls a heater – well, you get the idea. Analog
comparisons use the “less than” < and “greater than” > symbols only. There is no equal or not
equal. Checking for equality on a potentially jittery analogue input is not really useful.
As well as “not” !, you can use “and” & and “or” | in your equations.
Enter D2&D3 and the result is true only when both D2 and D3 are active.
Enter D2|D3 and the result is true when either D2 or D3 is active.
What happens here:
D2|D3&D4
The answer is that boolean expressions are evaluated left to right. So D2 is ORed with D3 and
the result ANDed with D4. You can change the order of precedence by using parenthesis ().
D2|(D3&D4)
will now AND D3 with D4 and the result is Ored with D2.
Copyright
© 2016-2017,
Devantech Ltd.
All rights reserved.
27
www.pishrobot.com