The leader in industrial automation and control solutions

Instruction Parameters

Supported PLC Series

PLC-AESPLC-FBPLC-ES

Supported Data Registers

MXYKLFTCSZRQD@DConstant
S1
S2

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1
CarryF11.2

Number of Steps

Steps
3

Operands

OperandDescription
S1The first operand.
Entries are unsigned DWORD data registers or constants.

The unsigned value range is 0 ~ 4,294,967,295 (232-1).
The Hexadecimal value range is H00000000 ~ HFFFFFFFF.

Only unsigned or Hexadecimal values will be compared.
S2The second operand.
Entries are unsigned DWORD data registers or constants.

The unsigned value range is 0 ~ 4,294,967,295 (232-1).
The Hexadecimal value range is H00000000 ~ HFFFFFFFF.

Only unsigned or Hexadecimal values will be compared.

Notice

Error Flag (F11.0) Notice

The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type.

ComparisonOperatorFlagComparison Range
Less ThanS1 \< S2F12.00 ~ 4,294,967,295
Less Than Equal ToS1 ≤ S2F12.10 ~ 4,294,967,295
EqualS1 = S2F12.20 ~ 4,294,967,295
Greater ThanS1 > S2F12.30 ~ 4,294,967,295
Greater Than Equal ToS1 ≥ S2F12.40 ~ 4,294,967,295
Not EqualS1 ≠ S2F12.50 ~ 4,294,967,295

Comparison Flags

The UDCMP instruction must be accompanied by a BOOL-type flag (F12.0 ~ F12.5). Please refer to each example on how to use the different flags.

Ladder Diagram Examples

Less Than (\<)

ComparisonOperatorFlagComparison Range
Less ThanS1 \< S2F12.00 ~ 4,294,967,295

The UDCMP instruction compares a DWORD value, S1, to another DWORD value, S2, and is true if S1 is less than S2. If S1 is less than S2, the BOOL flag F12.0 is true, and the output is energized.

If the contact, M0.1, is powered ON (1) and the expression, D46

If the contact, M0.1, is powered ON (1) and the expression, D46 < D48 (8,451,238 < 745,128) is FALSE, the less than flag, F12.0 is deenergized. As a result, the coil, Y0.1, is deenergized.

If the contact, M0.1, is powered ON (1) and the expression, D46

If the contact, M0.1, is powered ON (1) and the expression, D46 < D48 (647,522 < 745,128) is TRUE, the less than flag, F12.0 is energized. As a result, the coil, Y0.1, is energized.

Memory Monitor

Memory Monitor for MapleLogic UDCMP instruction.

Notice

Notice for MapleLogic UDCMP instruction.

One-Shot Warning

A rising-edge (one-shot) or falling-edge (one-shot) contact will NOT energize the output.

Less Than Equal To (≤)

ComparisonOperatorFlagComparison Range
Less Than Equal ToS1 ≤ S2F12.10 ~ 4,294,967,295

The UDCMP instruction compares a DWORD value, S1, to another DWORD value, S2, and is true if S1 is less than or equal to S2. If S1 is less than or equal to S2, the BOOL flag F12.1 is true, and the output is energized.

If the contact, M0.1, is powered ON (1) and the expression, D45 ≤ D47 (824,059 ≤ 653,212) is FALSE, the less than flag, F12.1 is deenergiz

If the contact, M0.1, is powered ON (1) and the expression, D45D47 (824,059653,212) is FALSE, the less than flag, F12.1 is deenergized. As a result, the coil, Y1.1, is deenergized.

If the contact, M0.1, is powered ON (1) and the expression, D41 ≤ D43 (824,059 ≤ 824,059) is TRUE, the less than flag, F12.1 is energized.

If the contact, M0.1, is powered ON (1) and the expression, D41D43 (824,059824,059) is TRUE, the less than flag, F12.1 is energized. As a result, the coil, Y1.1, is energized.

Memory Monitor

Memory Monitor for MapleLogic UDCMP instruction.

Notice

Notice for MapleLogic UDCMP instruction.

One-Shot Warning

A rising-edge (one-shot) or falling-edge (one-shot) contact will NOT energize the output.

Equal (=)

ComparisonOperatorFlagComparison Range
EqualS1 = S2F12.20 ~ 4,294,967,295

The UDCMP instruction compares a DWORD value, S1, to another DWORD value, S2, and is true if S1 is equal to S2. If S1 is equal to S2, the BOOL flag F12.2 is true, and the output is energized.

If the contact, M0.1, is powered ON (1) and the expression, D54 ≠ D56 (97,643,125 ≠ 13,467,985) is FALSE, the less than flag, F12.2 is dee

If the contact, M0.1, is powered ON (1) and the expression, D54D56 (97,643,12513,467,985) is FALSE, the less than flag, F12.2 is deenergized. As a result, the coil, Y2.1, is deenergized.

If the contact, M0.1, is powered ON (1) and the expression, D54 = D56 (13,467,985 = 13,467,985) is TRUE, the less than flag, F12.2 is energized.

If the contact, M0.1, is powered ON (1) and the expression, D54 = D56 (13,467,985 = 13,467,985) is TRUE, the less than flag, F12.2 is energized. As a result, the coil, Y2.1, is energized.

Memory Monitor

Memory Monitor for MapleLogic UDCMP instruction.

Notice

Notice for MapleLogic UDCMP instruction.

One-Shot Warning

A rising-edge (one-shot) or falling-edge (one-shot) contact will NOT energize the output.

Greater Than (>)

ComparisonOperatorFlagComparison Range
Greater ThanS1 > S2F12.30 ~ 4,294,967,295

The UDCMP instruction compares a DWORD value, S1, to another DWORD value, S2, and is true if S1 is greater than S2. If S1 is greater than S2, the BOOL flag F12.3 is true, and the output is energized.

If the contact, M0.1, is powered ON (1) and the expression D62 &gt; D64 (12,345,678 &gt; 87,654,321) is FALSE, the less than flag is set to 1 and the equal flag is set to 0. D64 (12,345,678 > 87,654,321) is FALSE, the less than flag, F12.3 is deenergized.”/>

If the contact, M0.1, is powered ON (1) and the expression, D62 > D64 (12,345,678 > 87,654,321) is FALSE, the less than flag, F12.3 is deenergized. As a result, the coil, Y3.1, is deenergized.

If the contact, M0.1, is powered ON (1) and the expression D62 &gt; D64 (87,654,321 &gt; 12,345,678) is TRUE, the less than flag is set to 0 and the equal flag is set to 0. D64 (87,654,321 > 12,345,678) is TRUE, the less than flag, F12.3 is energized.”/>

If the contact, M0.1, is powered ON (1) and the expression, D62 > D64 (87,654,321 > 12,345,678) is TRUE, the less than flag, F12.3 is energized. As a result, the coil, Y3.1, is energized.

Memory Monitor

Memory Monitor for MapleLogic UDCMP instruction.

Notice

Notice for MapleLogic UDCMP instruction.

One-Shot Warning

A rising-edge (one-shot) or falling-edge (one-shot) contact will NOT energize the output.

Greater Than Equal To (≥)

ComparisonOperatorFlagComparison Range
Greater Than Equal ToS1 ≥ S2F12.40 ~ 4,294,967,295

The UDCMP instruction compares a DWORD value, S1, to another DWORD value, S2, and is true if S1 is greater than or equal to S2. If S1 is greater than or equal to S2, the BOOL flag F12.4 is true, and the output is energized.

If the contact, M0.1, is powered ON (1) and the expression, D70 ≥ D72 (45,130 ≥ 65,410) is FALSE, the less than flag, F12.4 is deenergized

If the contact, M0.1, is powered ON (1) and the expression, D70D72 (45,13065,410) is FALSE, the less than flag, F12.4 is deenergized. As a result, the coil, Y4.1, is deenergized.

If the contact, M0.1, is powered ON (1) and the expression, D70 ≥ D72 (8,745,112 ≥ 7,451,323) is TRUE, the less than flag, F12.4 is energi

If the contact, M0.1, is powered ON (1) and the expression, D70D72 (8,745,1127,451,323) is TRUE, the less than flag, F12.4 is energized. As a result, the coil, Y4.1, is energized.

Memory Monitor

Memory Monitor for MapleLogic UDCMP instruction.

Notice

Notice for MapleLogic UDCMP instruction.

One-Shot Warning

A rising-edge (one-shot) or falling-edge (one-shot) contact will NOT energize the output.

Not Equal (≠)

ComparisonOperatorFlagComparison Range
Not EqualS1 ≠ S2F12.50 ~ 4,294,967,295

The UDCMP instruction compares a DWORD value, S1, to another DWORD value, S2, and is true if S1 is not equal to S2. If S1 is not equal to S2, the BOOL flag F12.5 is true, and the output is energized.

If the contact, M0.1, is powered ON (1) and the expression, D78 = D80 (784,512 = 784,512) is FALSE, the less than flag, F12.5 is deenergized.

If the contact, M0.1, is powered ON (1) and the expression, D78 = D80 (784,512 = 784,512) is FALSE, the less than flag, F12.5 is deenergized. As a result, the coil, Y5.1, is deenergized.

If the contact, M0.1, is powered ON (1) and the expression, D78 ≠ D80 (784,512,000 ≠ 784,512) is TRUE, the less than flag, F12.5 is energi

If the contact, M0.1, is powered ON (1) and the expression, D78D80 (784,512,000784,512) is TRUE, the less than flag, F12.5 is energized. As a result, the coil, Y5.1, is energized.

Memory Monitor

Memory Monitor for MapleLogic UDCMP instruction.

Notice

Notice for MapleLogic UDCMP instruction.

One-Shot Warning

A rising-edge (one-shot) or falling-edge (one-shot) contact will NOT energize the output.