Skip to main content

Comparison Relay Flags

Comparison Relay Flags (F012)

The comparison flags, F012, are used to indicate the result of arithmetic or logical comparisons performed by the PLC while using the UCMP or UDCMP instructions.
These flags are essential for decision-making processes within the PLC program.

Comparison Relay Flags
Flag BitNameDescriptionUse Case
F012.0Less Than (<)ON (1) when the result of an unsigned comparison is less thanUsed to evaluate conditions where one value is less than another
F012.1Less Than Equal To (≤)ON (1) when the result of an unsigned comparison is less than or equalUsed to evaluate conditions where one value is less than or equal to another
F012.2Equal (=)ON (1) when the result of an unsigned comparison is equalUsed to evaluate conditions where one value is equal to another
F012.3Greater Than (>)ON (1) when the result of an unsigned comparison is greater thanUsed to evaluate conditions where one value is greater than another
F012.4Greater Than Equal To (≥)ON (1) when the result of an unsigned comparison is less than or equalUsed to evaluate conditions where one value is less than or equal to another
F012.5Not Equal (≠)ON (1) when the result of an unsigned comparison is not equalUsed to evaluate conditions where one value is not equal to another

F012.0 - Less Than (<)

Description

The less than (<) flag is ON (1) when the result of a comparison indicates that the first value is less than the second value.

Use Case

  • Used to evaluate conditions in control logic where one value must be smaller than another.
  • Example: Check if the current temperature is below the set point.

F12.0 OFF


The data register, D0 (32,757), is NOT less than the data register, D1 (105).
The less than flag, F12.0, is NOT ON (1).
Therefore, the coil, Y0.0, is NOT energized.

F12.0 ON


The data register, D0 (32,757), is less than the data register, D1 (65,535).
The less than flag, F12.0, is ON (1).
Therefore, the coil Y0.0, is energized.

F012.1 - Less Than Equal To (≤)

Description

The less than equal to (≤) flag is ON (1) when the result of a comparison indicates that the first value is less than or equal to the second value.

Use Case

  • Monitor conditions where a value must not exceed a threshold.
  • Example: Ensure the machine load is within safe operational limits.

F12.1 OFF


The data register, D0 (32,757), is NOT less than or equal to the data register, D1 (105).
The less than equal to flag, F12.1, is NOT ON (1).
Therefore, the coil, Y0.1, is NOT energized.

F12.1 ON


The data register, D0 (32,757), is less than or equal to the data register, D1 (65,535).
The less than equal to flag, F12.1, is ON (1).
Therefore, the coil Y0.1, is energized.

F012.2 - Equal (=)

Description

The equal (=) flag is ON (1) when the result of a comparison indicates that the first value is equal to the second value.

Use Case

  • Verify equality between two variables or parameters.
  • Example: Check if the target and actual positions of a motor are the same.

F12.2 OFF


The data register, D0 (32,757), is NOT equal to the data register, D1 (65,535).
The equal flag, F12.2, is NOT ON (1).
Therefore, the coil, Y0.2, is NOT energized.

F12.2 ON


The data register, D0 (32,757), is equal to the data register, D1 (65,535).
The equal flag, F12.2, is ON (1).
Therefore, the coil Y0.2, is energized.

F012.3 - Greater Than (>)

Description

The greater than (>) flag is ON (1) when the result of a comparison indicates that the first value is greater than the second value.

Use Case

  • Detect when one parameter exceeds another.
  • Example: Trigger an alert when the current exceeds a predefined limit.

F12.3 OFF


The data register, D0 (65,535), is NOT greater than the data register, D1 (65,535).
The greater than flag, F12.3, is NOT ON (1).
Therefore, the coil, Y0.3, is NOT energized.

F12.3 ON


The data register, D0 (65,535), is greater than the data register, D1 (32,767).
The greater than flag, F12.3, is ON (1).
Therefore, the coil Y0.3, is energized.

F012.4 - Greater Than Equal To (≥)

Description

The greater than equal to (≥) flag is ON (1) when the result of a comparison indicates that the first value is greater than or equal to the second value.

Use Case

  • Monitor conditions requiring a minimum threshold.
  • Example: Ensure sufficient material is available before starting a process.

F12.4 OFF


The data register, D0 (32,767), is NOT greater than or equal to the data register, D1 (65,535).
The greater than equal to flag, F12.4, is NOT ON (1).
Therefore, the coil, Y0.4, is NOT energized.

F12.4 ON


The data register, D0 (32,767), is greater than or equal to the data register, D1 (32,767).
The greater than equal to flag, F12.4, is ON (1).
Therefore, the coil Y0.4, is energized.

F012.5 - Not Equal (≠)

Description

The not equal (≠) flag is ON (1) when the result of a comparison indicates that the first value is not equal to the second value.

Use Case

  • Detect mismatches or unexpected values.
  • Example: Check if a safety condition is violated.

F12.5 OFF


The data register, D0 (32,767), is equal to the data register, D1 (32,767).
The not equal to flag, F12.5, is NOT ON (1).
Therefore, the coil, Y0.5, is NOT energized.

F12.5 ON


The data register, D0 (0), is NOT equal to the data register, D1 (32,767).
The not equal to flag, F12.5, is ON (1).
Therefore, the coil Y0.5, is energized.