Compare

Description

The Compare block performs a comparison between two numeric values to create a boolean result. The comparison operator is chosen from the drop down list in the center of the block and can be any of the following:

         >  Greater Than
>= Greater Than or Equal To
< Less Than
<= Less Than or Equal To
= Equal To
<> Not Equal To

Note that comparing two floating point numbers for exact equivalance is unlikely to be ever be true since a very small discrepency will make the comparison false. The Round operator may be need to be involved.

Escapes

The Compare block does not produce any escapes.

Examples

This block list checks for an out-of-bounds error:

This block list fills a tank until an analog level sensor indicates the tank is full:

This block list produces an indicated number of parts. Numeric variables are floating point so if an ordinal whole number is needed use the Round operator:

Related Topics

If
If Else
While
Repeat Until