Compare Block

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.
ModeInputs UsedOutput Result
Equal To A, BTrue if A = B, otherwise False
Not Equal To A, BTrue if A ≠ B, otherwise False
Greater Than A, BTrue if A > B, otherwise False
Less Than A, BTrue if A < B, otherwise False
Greater Than or Equal To A, BTrue if A ≥ B, otherwise False
Less Than or Equal To A, BTrue 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.
InputTypeNotes
A NumericFirst number for comparison
B NumericSecond 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.
OutputTypeNotes
Result LogicResult of the comparison (True or False)
Compare
Quick links