Element Path: <cwt><CORE><Inputhandler>
Element Path: <cwt><CORE><Inputhandler><logicButton>
![]() | any change in the element or addition of an element |
This feature allows you to describe the logic for a set of inputs. These are buttons and/or sensors.
The logic statement can be in the form of:
1.a Statement in the form of "in<X> <Operator> in<Y>"
2.A collection of these statements on the form of:
a."(<Statement>) <Operator> in<Z>"
b."in<Z> <Operator> (<Statement>)"
c."(<Statement>) <Operator> (<Statement>)"
<logicButton buttonId="2100" buttonDeAssertionId="2101" in0="TopHatSensor" in1="StnDispSensor" in2="WakeUpButton" in3="StartButton">
((IN0 OR IN3) AND IN1) OR IN2
</logicButton>
The relation between the input and the logic code to use in the formula is set in the in<X>="input device"
The formula is place between the <logicButton> element and the <logicButton> element
Inputs
The inputs in<x> can be:
in0, in1, in2, in3,
NOT in0, NOT in1, NOT in2, NOT in3
Operators
the Operators <Operator> can be:
AND | produces an output which is true if both inputs are true |
NAND | (Not AND) produces an output which is false only if both its inputs are true |
OR | produces an output which is true if one of the inputs is true or both inputs are true |
NOR | (Not OR) produces an output which is true only if both inputs are false |
XOR | (Exclusive OR) produces and output which is true if only one of the inputs is true, otherwise it produces false |
Examples
E.g. (1): in0 AND NOT in1
E.g. (2): (in0 AND NOT in1) OR in2
E.g. (3): in2 XOR (in0 AND NOT in1)
E.g. (4): (in0 AND NOT in1) NAND (in2 NOR in3)
Notes: - The statement is case insensitive. - The statement cannot have more parenthesis than necessary. You can define several logicButtons. |
Attributes
buttonId
Range: | 2000 - 2999 |
Description: | Id that will be called when the logic statement changes from false to true |
buttonDeAssertionId
Range: | 2000 - 2999 |
Description: | Id that will be called when the logic statement changes from true to false |
in0-in3
Range: | NoInput, WakeUpButton, TopHatSensor, StnDispSensor, StartButton |
Description: | Input corresponding to in<X> in the logic statement |
Example:
( (TopHatSensor or StartButton) AND StnDispSensor ) or WakeUpButton
<cwt ...>
<CORE...>
<inputhandler>
<logicButton buttonId="2100" buttonDeAssertionId="2101" in0="TopHatSensor" in1="StnDispSensor" in2="WakeUpButton" in3="StartButton">
((IN0 OR IN3) AND IN1) OR IN2
</logicButton>
</inputhandler>
</CORE>
</cwt>