The Compare block compares two numbers to find out whether they are equal, or which number is greater. You can choose one of six different comparisons. The output result is True or False.
Compare Modes
Mode Selector Inputs Output
Choose the type of comparison you want to use by selecting a mode with the Mode Selector. The block will calculate the Result output by comparing the two inputs A and B as shown in the table below.
Mode
Inputs Used
Output Result
Equal To
A, B
True if A = B, otherwise False
Not Equal To
A, B
True if A ≠ B, otherwise False
Greater Than
A, B
True if A > B, otherwise False
Less Than
A, B
True if A < B, otherwise False
Greater Than or Equal To
A, B
True if A ≥ B, otherwise False
Less Than or Equal To
A, B
True if A ≤ B, otherwise False
Example
This block sequence tests to see if the value of the “power” variable is greater than 100, and if so, it sets it to 100. The Compare block compares the value of the variable to 100, and the Logic result is used by the Switch to choose whether to change the value of the variable.
Inputs and Outputs
The inputs of the Compare block are the two numbers to compare. You can enter the input values directly into the block. Alternatively, the input values can be supplied by Data Wires from the outputs of other Programming Blocks.
Input
Type
Notes
A
Numeric
First number for comparison
B
Numeric
Second number for comparison
The output of the block gives the result of the comparison. To use the output, use a Data Wire to connect it to another Programming Block.