Compare instructions – Rockwell Automation 1785-Lxxx Enhanced and Ethernet PLC-5 Programmable Controllers User Manual

Page 305

Advertising
background image

Publication 1785-UM012D-EN-P - July 2005

Instruction Set Quick Reference D-5

Compare Instructions

Count Down
CTD

Status Bits:
CU-Count Up
CD-Count Down
DN-Count Down done
OV-Overflow
UN-Underflow

Instruction

Description

CTD

COUNT DOWN

Counter

Preset

C5:1

10
35

Accum

If the input conditions go true, counter C5:1 starts
counting, decrementing by 1 every time the rung goes from
false-to-true. When the accumulated value is less than the
preset value (10), the counter resets the counter done bit.

Rung

Condition

CD

14

DN

13

UN

11

ACC

Value

CTD

Status

False

Toggle True

True

0

1

1

0

1

0

0

0

0

0

dec by 1

< preset

Disabled

Counting

Done

True

1

0

1

< -32768

Underflow

False

0

1

0

>= preset

Preload

See page F-8 for a description of prescan operation for
this instruction.

Instruction

Description

Limit Test
LIM

Mask Compare Equal
MEQ

LIM

LIMIT TEST (CIRC)

Low limit

Test

High limit

N7:10

N7:15

N7:20

3

4

22

If the Test value (N7:15) is >= the Low Limit (N7:10) and <= the
High Limit (N7:20), this instruction is true.

Low Limit

LIM

0

-5

5

10

Test

10

0

5

11

0

5

T

T

F

T

F

High Limit

10

10

10

0

-5

10

11

T

5

MEQ

MASKED EQUAL

Source

Mask

Compare

D9:5

D9:6

D9:10

0

0000

0000

0000

The controller takes the value in the Source (D9:5) and passes
that value through the Mask (D9:6). Then the controller compare
the result to the Compare value (D9:10). If the result and this
comparison values are equal, the instruction is true.

Source

MEQ

0008

0008

0087

0087

Mask

0008

0001

000F

00F0

T

F

T

F

Compare

0009

0001

0007

0007

Advertising