The Comparator building block compares two Number values and sets its output value based on the result of the comparison.
A Comparator building block has two Number inputs and one ON/OFF output. When either input value changes, the block will compare the two input values and update its output value. The block can use one of five comparison methods:
greater than — the output value is ON when the left input value is greater than the right input value
greater than or equal to — the output value is ON when the left input value is greater than or equal to the right input value
equal to — the output value is ON when the left input value is equal to the right input value
less than or equal to — the output value is ON when the left input value is less than or equal to the right input value
less than — the output value is ON when the left input value is less than the right input value
To configure a Comparator building block, select the comparison method. The block can be configured to ignore any change that does not cause its output value to change by turning on the Report new output values only option.
In the example to the right, the building block will turn its output ON when the left input value is greater than or equal to the right input value. It will ignore any change that does not cause its output value to change.